Hello.
I think very usefull hook. hook_notify();
I made this. it very few code.
/**
* Displays a notification message when an invited user has registered.
*
* @param $uid
* The user id to check accepted invitations for.
*/
function invite_notify($uid) {
$result = db_query('SELECT invitee FROM {invite_notifications} WHERE uid = %d', $uid);
while ($row = db_fetch_object($result)) {
$account = user_load(array('uid' => $row->invitee, 'status' => 1));
if ($account) {
drupal_set_message(t('!user (@email) has joined @site-name!', array('!user' => theme('username', $account), '@email' => $account->mail, '@site-name' => variable_get('site_name', t('Drupal')))));
db_query("DELETE FROM {invite_notifications} WHERE uid = %d AND invitee = %d", $uid, $row->invitee);
//I add this
$args = array('invitee' => $account, 'inviter' => $uid);
module_invoke_all('invite', 'notify', $args);
}
}
}
/**
* Implementation of hook_invite().
*/
function hook_invite($op, $arg) {
switch($op) {
case 'notify':
//example
$flag = flag_get_flag('flag_name');
$flag->flag('flag', $arg['inviter'], $arg['invitee'], TRUE);
$flag->flag('flag', $arg['invitee']->uid);
break;
}
}
Closed: outdated
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.