| 1 |
<?php |
<?php |
| 2 |
// $Id: node_invite.send.inc,v 1.4.2.3 2009/09/03 00:17:30 hadsie Exp $ |
// $Id: node_invite.send.inc,v 1.4.2. hadsie Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Provides the invite sending form. |
* Provides the invite sending form. |
| 59 |
$form['submit'] = array( |
$form['submit'] = array( |
| 60 |
'#type' => 'submit', |
'#type' => 'submit', |
| 61 |
'#value' => t('Submit'), |
'#value' => t('Submit'), |
| 62 |
|
'#weight' => 20, |
| 63 |
); |
); |
| 64 |
|
|
| 65 |
return $form; |
return $form; |
| 128 |
|
|
| 129 |
// 3. store a record in {node_invites} and get insert_id |
// 3. store a record in {node_invites} and get insert_id |
| 130 |
// (which we use to build the message) |
// (which we use to build the message) |
| 131 |
|
$account = user_load(array('mail' => $recip_email)); |
| 132 |
$params = array( |
$params = array( |
| 133 |
'nid' => $node->nid, |
'nid' => $node->nid, |
| 134 |
'email_invitee' => $email, |
'email_invitee' => $recip_email, |
| 135 |
|
'name_invitee' => $recip_name, |
| 136 |
|
'uid_invitee' => $account ? $account->uid : 0, |
| 137 |
'uid_inviter' => $user->uid, |
'uid_inviter' => $user->uid, |
| 138 |
'status' => 'NEW', |
'status' => 'NEW', |
| 139 |
); |
); |
| 140 |
$invite = node_invite_save('', $params); |
$invite = node_invite_save('', $params); |
| 141 |
|
|
|
/* |
|
|
$sent = time(); |
|
|
$hash = md5($email . $sent); |
|
|
db_query("INSERT INTO {node_invites} (nid, email_invitee, uid_inviter, status, sent, hash) VALUES (%d, '%s', %d, '%s', %d, '%s')", $node->nid, $email, $user->uid, 'NEW', $sent, $hash); |
|
|
$insert_id = db_last_insert_id('node_invites', 'iid'); |
|
|
*/ |
|
|
|
|
| 142 |
// 3.5 we need to send the invite stuff to token_replace (so it can drp in names, etc. |
// 3.5 we need to send the invite stuff to token_replace (so it can drp in names, etc. |
| 143 |
// this also over-rides the old (and right) way of doing this where we pulled inviter-name/mail from global $user |
// this also over-rides the old (and right) way of doing this where we pulled inviter-name/mail from global $user |
| 144 |
$node->invite_specific_info = array( |
$node->invite_specific_info = array( |