當前位置: 首頁>>代碼示例>>PHP>>正文


PHP notifications::broadcast方法代碼示例

本文整理匯總了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");
開發者ID:blasiuscosa,項目名稱:manobo-2008,代碼行數:31,代碼來源:daily-cleaner.php

示例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.");
    }
}
開發者ID:blasiuscosa,項目名稱:manobo-2008,代碼行數:33,代碼來源:functions.php


注:本文中的notifications::broadcast方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。