1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60:
<?php
class Buddy_Notify_Background extends SMF_BackgroundTask
{
public function execute()
{
global $smcFunc, $sourcedir;
require_once($sourcedir . '/Subs-Notify.php');
$prefs = getNotifyPrefs($this->_details['receiver_id'], 'buddy_request', true);
if ($prefs[$this->_details['receiver_id']]['buddy_request'])
{
$alert_row = array(
'alert_time' => $this->_details['time'],
'id_member' => $this->_details['receiver_id'],
'id_member_started' => $this->_details['id_member'],
'member_name' => $this->_details['member_name'],
'content_type' => 'member',
'content_id' => $this->_details['id_member'],
'content_action' => 'buddy_request',
'is_read' => 0,
'extra' => '',
);
$smcFunc['db_insert']('insert', '{db_prefix}user_alerts',
array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int', 'member_name' => 'string',
'content_type' => 'string', 'content_id' => 'int', 'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'),
$alert_row, array()
);
updateMemberData($this->_details['receiver_id'], array('alerts' => '+'));
}
return true;
}
}
?>