本文整理汇总了PHP中notifications::broadcast方法的典型用法代码示例。如果您正苦于以下问题:PHP notifications::broadcast方法的具体用法?PHP notifications::broadcast怎么用?PHP notifications::broadcast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notifications
的用法示例。
在下文中一共展示了notifications::broadcast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: improvement
while ($row = tep_db_fetch_array($q)) {
$i = new improvement($row['improvements_id']);
$i->updateStatus('4', '5', $username);
}
$logger->write("- Auto move to Checkings Tab");
//$q = tep_db_query("SELECT improvements_id, DATEDIFF(deadline, '$today') AS deadline_diff FROM improvements WHERE status<4 HAVING deadline_diff<=1");
$q = tep_db_query("SELECT improvements_id, DATEDIFF(deadline, '{$today}') AS deadline_diff FROM improvements WHERE status<4 OR status=7 HAVING deadline_diff<=1");
while ($row = tep_db_fetch_array($q)) {
$i = new improvement($row['improvements_id']);
$targets = array();
$targets[] = $i->owner_id;
if ($i->pic > 0) {
$targets[] = $i->pic;
}
$message = $obj_notifications->messageTemplateDeadlineReminder($username, 'Improvement', $i->id, $row['deadline_diff'], improvement::getTeamCategories($i->team, $i->category), $i->name);
$obj_notifications->broadcast($targets, $message, $username, 'open=improvement&id=' . $i->id, false, $targets);
}
$logger->write("- Deadline Notifications Sent");
$logger->write("Task 3 - End");
$logger->write("Task 4a (CLEAR OLD NOTIFICATIONS) - Start");
////////////////////////////////////////////////
// CLEAR OLD NOTIFICATIONS OLDER THAN 1 MONTH //
////////////////////////////////////////////////
$max_days = 30;
$date_max = date('Y-m-d 00:00:00', strtotime("-{$max_days} days"));
$q = tep_db_query("DELETE FROM minierp_users_has_notifications WHERE posted_date<='{$date_max}' AND status=0 AND need_feedback=0");
$logger->write("Task 4b (RESET NEW STATUS FOR UNCONFIRMED FEEDBACK) - Start");
/////////////////////////////////////////
// SET BACK UNANSWERED FEEDBACK AS NEW //
/////////////////////////////////////////
$q = tep_db_query("UPDATE minierp_users_has_notifications SET status=0 WHERE need_feedback=1 AND status=1");
示例2: tep_db_error
function tep_db_error($query, $errno, $error)
{
global $session_userinfo, $DEBUGER_USERNAME;
$timestamp = date('d.m.Y H:i:s');
$username = isset($session_userinfo) ? $session_userinfo['username'] : 'NOSESSION';
use_class('logger');
$logger = new logger('general', 'query_error', false);
//save error to a log file
$logger->write('User: ' . $username);
$logger->write($_SERVER['REQUEST_URI']);
if (isset($_POST) && count($_POST) > 0) {
$logger->write('--- POST vars sent ---');
foreach ($_POST as $pk => $pv) {
$logger->write("{$pk} = {$pv}");
}
$logger->write('--- POST vars end ---');
}
$logger->write($errno . ' - ' . $error);
$logger->write($query);
$logger->close();
//notify it team via notfication system
use_class('notifications');
$obj_notifications = new notifications();
$team_followers = load_config('teams_followers');
$message = '<strong>ACHTUNG!</strong> Query Error found in ' . $_SERVER['REQUEST_URI'] . ', please check general query error log file for details!';
$obj_notifications->broadcast($team_followers[1], $message, 'auto-set', 'open=log-analyzer&logfilename=general_query_error', true);
if (SERVERTYPE != SERVERTYPE_LIVE || isset($session_userinfo) && in_array($session_userinfo['username'], $DEBUGER_USERNAME)) {
$show_err_msg = SERVERTYPE != SERVERTYPE_LIVE ? 'accessing a non live environment' : 'logged in as ' . $session_userinfo['username'];
die('<em>This detail error message is displayed because you are ' . $show_err_msg . '</em><br /><br />' . '<strong>Query Error: ' . $errno . '</strong>' . '<br />' . $error . '<br /><br />' . '<strong>QUERY:</strong><br />' . $query);
} else {
die("Sorry, Manobo found an error while executing a database query," . "<br />a log has been created and a notification has been sent to IT Team." . "<br /><br />If you keep seeing this error message please wait until further notice from IT Team." . "<br /><br />We're sorry for the inconvenience.");
}
}