本文整理汇总了PHP中Notifications::post方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifications::post方法的具体用法?PHP Notifications::post怎么用?PHP Notifications::post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifications
的用法示例。
在下文中一共展示了Notifications::post方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
Safe::header('Status: 400 Bad Request', TRUE, 400);
die(i18n::s('Request is invalid.'));
}
break;
case 'hello':
if (!isset($_REQUEST['message'])) {
Safe::header('Status: 400 Bad Request', TRUE, 400);
die(i18n::s('Request is invalid.'));
}
break;
default:
Safe::header('Status: 400 Bad Request', TRUE, 400);
die(i18n::s('Request is invalid.'));
}
// save in the database
Notifications::post($fields);
// thread update will trigger screen repaint through separate pending call of this script
die('OK');
// look for some notification
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
// change session data to extend life of related file
if (!isset($_SESSION['heartbit'])) {
$_SESSION['heartbit'] = 0;
}
$_SESSION['heartbit']++;
// refresh the watchdog
$_SESSION['watchdog'] = time();
// update surfer presence
$query = "UPDATE " . SQL::table_name('users') . " SET click_date='" . gmstrftime('%Y-%m-%d %H:%M:%S') . "'" . " WHERE (id = " . SQL::escape(Surfer::get_id()) . ")";
SQL::query($query, FALSE, $context['users_connection']);
// assign article for more time