本文整理汇总了PHP中notification类的典型用法代码示例。如果您正苦于以下问题:PHP notification类的具体用法?PHP notification怎么用?PHP notification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了notification类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addUpdateEndorsement
public function addUpdateEndorsement($skill_endorsement_id, $skill_id, $display_user_id, $logged_user_id, $message)
{
$dbc = mysqli_connect($GLOBALS['db_servername'], $GLOBALS['db_username'], $GLOBALS['db_password'], $GLOBALS['db_name']) or die("Not connected..");
if ($skill_endorsement_id <= 0) {
$q = "INSERT INTO skill_endorsements (user_id, skill_id, endorsed_by_user_id, comments)\nVALUES (" . $display_user_id . "," . $skill_id . "," . $logged_user_id . ",'" . $message . "')";
} else {
$q = "Update skill_endorsements \n\t\t\t\t\tset \n\t\t\t\t\t\tcomments='" . $message . "',\n\t\t\t\t\t\tendorsed_on=CURRENT_TIMESTAMP\n\t\t\t\t\twhere skill_endorsement_id=" . $skill_endorsement_id;
}
//echo $q . '<br>';
$r = mysqli_query($dbc, $q);
// Get $skill_endorsement_id of the insert query
if ($skill_endorsement_id <= 0) {
$skill_endorsement_id = -1;
if ($r) {
$skill_endorsement_id = mysqli_insert_id($dbc);
}
}
mysqli_close($dbc);
// close the connection
if ($r) {
// Add notification -- endorsed
$objNotification = new notification();
$result = $objNotification->addNotification(3, $display_user_id, $logged_user_id, $skill_endorsement_id);
return true;
} else {
return false;
}
}
开发者ID:kamalthakker,项目名称:Skills_Endorsement_Project,代码行数:28,代码来源:endorsement.php
示例2: checknoti
public function checknoti()
{
$notifications = notification::where('user_id', Auth::user()->id)->get();
//dd(empty($notifications));
if ($notifications->count()) {
return response()->json(1);
}
return response()->json(0);
}
开发者ID:jonasvr,项目名称:auction,代码行数:9,代码来源:profileController.php
示例3: album
static function album($menu, $theme)
{
if (!user::active()->guest) {
$item = $theme->item();
if ($item) {
$watching = notification::is_watching($item);
$menu->append(Menu::factory("link")->id("watch")->label(t("Enable notifications for this album"))->url(url::site("notification/watch/{$item->id}?csrf=" . access::csrf_token()))->css_id($watching ? "gRemoveWatchLink" : "gAddWatchLink"));
}
}
}
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:10,代码来源:notification_menu.php
示例4: site_menu
static function site_menu($menu, $theme)
{
if (!user::active()->guest) {
$item = $theme->item();
if ($item && $item->is_album() && access::can("view", $item)) {
$watching = notification::is_watching($item);
$label = $watching ? t("Remove notifications") : t("Enable notifications");
$menu->get("options_menu")->append(Menu::factory("link")->id("watch")->label($label)->css_id("gNotifyLink")->url(url::site("notification/watch/{$item->id}?csrf=" . access::csrf_token())));
}
}
}
开发者ID:eo04837,项目名称:gallery3,代码行数:11,代码来源:notification_event.php
示例5: notify
/**
* Takes notification data and sends a message or email.
* Expected data:
* - sender => stdClass (User object)
* - subject => string
* - content => string
* - contentformat => int (e.g. FORMAT_HTML). Optional; default FORMAT_PLAIN
* - notification => bool|int
* - recipients => array (Array of user objects)
* - recipientemails => array (Array of email addresses)
*
* @param array $data Notification data
* @return array
*/
public static function notify(\core\event\base $event)
{
$dataformid = $event->other['dataid'];
$man = \mod_dataform_notification_manager::instance($dataformid);
$result = false;
if ($rules = $man->get_type_rules_enabled()) {
$params = array();
$params['event'] = $event->eventname;
$params['dataformid'] = $dataformid;
$params['viewid'] = !empty($event->other['viewid']) ? $event->other['viewid'] : null;
$params['entryid'] = !empty($event->other['entryid']) ? $event->other['entryid'] : null;
foreach ($rules as $rule) {
if ($rule->is_applicable($params)) {
$notification = new notification();
$message = $notification->prepare_data($event, $rule);
$result = ($result or $notification->send_message($message));
}
}
}
return $result;
}
开发者ID:parksandwildlife,项目名称:learning,代码行数:35,代码来源:notification.php
示例6: watch
function watch($id)
{
access::verify_csrf();
$item = ORM::factory("item", $id);
access::required("view", $item);
if (notification::is_watching($item)) {
notification::remove_watch($item);
message::success(sprintf(t("You are no longer watching %s"), $item->title));
} else {
notification::add_watch($item);
message::success(sprintf(t("You are now watching %s"), $item->title));
}
url::redirect($item->url(array(), true));
}
开发者ID:xafr,项目名称:gallery3,代码行数:14,代码来源:notification.php
示例7: watch
function watch($id)
{
access::verify_csrf();
$item = ORM::factory("item", $id);
access::required("view", $item);
$watching = notification::is_watching($item);
if (!$watching) {
notification::add_watch($item);
message::success(sprintf(t("Watch Enabled on %s!"), $item->title));
} else {
notification::remove_watch($item);
message::success(sprintf(t("Watch Removed on %s!"), $item->title));
}
url::redirect($item->url());
}
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:15,代码来源:notification.php
示例8: mysqli_query
} else {
// echo "<script> alert('3'); </script>";
$stm = "select * from users where email='" . $email . "'";
$res = mysqli_query($conn, $stm);
if (mysqli_num_rows($res) > 0) {
// echo "<script> alert('4'); </script>";
$_SESSION['errorMess'] = 2;
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/registerHere.php'>";
// echo "<script> alert('5'); </script>";
} else {
// echo "<script> alert('6'); </script>";
$value = 0;
$cnumber = $cc . $cnumber;
$stm = "insert into users(name, lname, email, username, password, contactNumber, activationCode,activated) values('" . $fname . "','" . $lname . "','" . $email . "','" . $uname . "','" . $password . "'," . $cnumber . "," . $activation . "," . $value . ");";
mysqli_query($conn, $stm);
// echo "<script> alert('7'); </script>";
$not = new notification();
$link = "http://32.208.103.211/chatRegistration/activateAccount.php?activationCode=" . $activation . "&email=" . $email;
$body = "Thank you for registering with us.<br><br><a href='" . $link . "'>Click here</a> to activate your account.";
$ans = $not->email("[email protected]", "Administration", "[email protected]", "mailstodeliver", $email, "Activation Email", $body);
$_SESSION['emailSent'] = $ans;
echo "<script> alert('" . $ans . "'); </script>";
if ($ans == 1) {
$refCode = $not->message("12035432147", $cnumber, $link);
}
// echo "<script> alert('8'); </script>";
$_SESSION['newlyRegistered'] = $uname;
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/imageUpload.php'>";
}
}
mysqli_close($conn);
开发者ID:naikamish,项目名称:Chat-Client,代码行数:31,代码来源:mailAndMessage.php
示例9: course_recurrence_handler
/**
* Function to handle course recurrence events.
*
* @param user $user CM user object representing the user in the course
*
* @return boolean TRUE is successful, otherwise FALSE
*/
public static function course_recurrence_handler($user)
{
global $CFG, $CURMAN;
require_once $CFG->dirroot . '/curriculum/lib/notifications.php';
/// Does the user receive a notification?
$sendtouser = $CURMAN->config->notify_courserecurrence_user;
$sendtorole = $CURMAN->config->notify_courserecurrence_role;
$sendtosupervisor = $CURMAN->config->notify_courserecurrence_supervisor;
/// If nobody receives a notification, we're done.
if (!$sendtouser && !$sendtorole && !$sendtosupervisor) {
return true;
}
$context = get_system_context();
/// Make sure this is a valid user.
$enroluser = new user($user->id);
if (empty($enroluser->id)) {
print_error('nouser', 'block_curr_admin');
return true;
}
$message = new notification();
/// Set up the text of the message
$text = empty($CURMAN->config->notify_courserecurrence_message) ? get_string('notifycourserecurrencemessagedef', 'block_curr_admin') : $CURMAN->config->notify_courserecurrence_message;
$search = array('%%userenrolname%%', '%%coursename%%');
$replace = array(fullname($user), $user->coursename);
$text = str_replace($search, $replace, $text);
$eventlog = new Object();
$eventlog->event = 'course_recurrence';
$eventlog->instance = $user->enrolmentid;
$eventlog->fromuserid = $user->id;
if ($sendtouser) {
$message->send_notification($text, $user, null, $eventlog);
}
$users = array();
if ($sendtorole) {
/// Get all users with the notify_courserecurrence capability.
if ($roleusers = get_users_by_capability($context, 'block/curr_admin:notify_courserecurrence')) {
$users = $users + $roleusers;
}
}
if ($sendtosupervisor) {
/// Get parent-context users.
if ($supervisors = cm_get_users_by_capability('user', $user->id, 'block/curr_admin:notify_courserecurrence')) {
$users = $users + $supervisors;
}
}
foreach ($users as $u) {
$message->send_notification($text, $u, $enroluser, $eventlog);
}
return true;
}
开发者ID:remotelearner,项目名称:elis.cm,代码行数:57,代码来源:course.class.php
示例10: task_header
print "mailing to {$recipient_name} <{$email}>\n";
$content = task_header($recipient_name);
$sql = "SELECT tas.id, tas.name, pro.id, pro.name, tas.priority, tas.status, tas.due_date\r\n FROM " . $tableCollab["tasks"] . " tas, " . $tableCollab["projects"] . " pro\r\n WHERE tas.status IN (2,3) \r\n AND tas.project = pro.id\r\n AND tas.assigned_to = '{$staffid}'\r\n ORDER BY tas.due_date, tas.status";
$rows = mysql_query($sql, $res);
while ($row = mysql_fetch_row($rows)) {
if ($row[6] < $datenow) {
$content .= task_row($row, $late_task_color);
} elseif ($row[6] == $datenow) {
$content .= task_row($row, $today_task_color);
} else {
$content .= task_row($row, $normal_task_color);
}
}
$content .= task_footer();
// set up the email object
$tasknotice = new notification();
$tasknotice->From = $from_email;
$tasknotice->FromName = $from_name;
$tasknotice->Subject = $subject_txt;
$tasknotice->Body = $content;
$tasknotice->AddAddress($email);
// $tasknotice->getUserinfo($staffid,"to");
if ($send_html) {
$tasknotice->IsHTML("true");
$tasknotice->AltBody = "this message uses html entities, but you prefer plain text !";
}
// send the email
if (!$tasknotice->Send()) {
echo "Message was not sent\n";
echo "Mailer Error: " . $tasknotice->ErrorInfo . "\n\n";
}
开发者ID:jgatica,项目名称:Netoffice,代码行数:31,代码来源:taskreminder.php
示例11: IN
<?php
$tmpquery = "WHERE tas.id IN({$id})";
$taskNoti = new request();
$taskNoti->openTasks($tmpquery);
$tmpquery = "WHERE pro.id = '{$project}'";
$projectNoti = new request();
$projectNoti->openProjects($tmpquery);
$tmpquery = "WHERE noti.member IN({$at})";
$listNotifications = new request();
$listNotifications->openNotifications($tmpquery);
$comptListNotifications = count($listNotifications->not_id);
if ($listNotifications->not_statustaskchange[0] == "0") {
$mail = new notification();
$mail->getUserinfo($idSession, "from");
$mail->partSubject = $strings["noti_prioritytaskchange1"];
$mail->partMessage = $strings["noti_prioritytaskchange2"];
if ($projectNoti->pro_org_id[0] == "1") {
$projectNoti->pro_org_name[0] = $strings["none"];
}
$complValue = $taskNoti->tas_completion[0] > 0 ? $taskNoti->tas_completion[0] . "0 %" : $taskNoti->tas_completion[0] . " %";
$idStatus = $taskNoti->tas_status[0];
$idPriority = $taskNoti->tas_priority[0];
$body = $mail->partMessage . "\n\n" . $strings["task"] . " : " . $taskNoti->tas_name[0] . "\n" . $strings["start_date"] . " : " . $taskNoti->tas_start_date[0] . "\n" . $strings["due_date"] . " : " . $taskNoti->tas_due_date[0] . "\n" . $strings["completion"] . " : " . $complValue . "\n" . $strings["priority"] . " : {$priority[$idPriority]}\n" . $strings["status"] . " : {$status[$idStatus]}\n" . $strings["description"] . " : " . $taskNoti->tas_description[0] . "\n\n" . $strings["project"] . " : " . $projectNoti->pro_name[0] . " (" . $projectNoti->pro_id[0] . ")\n" . $strings["organization"] . " : " . $projectNoti->pro_org_name[0] . "\n\n" . $strings["noti_moreinfo"] . "\n";
if ($taskNoti->tas_mem_organization[0] == "1") {
$body .= "{$root}/general/login.php?url=tasks/viewtask.php%3Fid={$id}";
} else {
if ($taskNoti->tas_mem_organization[0] != "1" && $projectNoti->pro_published[0] == "0" && $taskNoti->tas_published[0] == "0") {
$body .= "{$root}/general/login.php?url=projects_site/home.php%3Fproject=" . $projectNoti->pro_id[0];
}
}
开发者ID:ColBT,项目名称:php_tut,代码行数:31,代码来源:noti_prioritytaskchange.php
示例12: notification
<?php
include_once 'classes/notification.php';
if (isset($_REQUEST['user_id'])) {
$user_id = $_REQUEST['user_id'];
$objNotification = new notification();
$unreadMessageCount = $objNotification->getUnreadMessageCount($user_id);
if (isset($unreadMessageCount) && $unreadMessageCount > 0) {
echo $unreadMessageCount;
}
}
开发者ID:kamalthakker,项目名称:Skills_Endorsement_Project,代码行数:11,代码来源:notification_getCount.php
示例13: IN
}
$tmpquery = "WHERE mee.id IN({$num})";
$meetingNoti = new request();
$meetingNoti->openMeetings($tmpquery);
$tmpquery = "WHERE pro.id = '{$project}'";
$projectNoti = new request();
$projectNoti->openProjects($tmpquery);
$tmpquery = "WHERE noti.member IN({$att_mem_id_list})";
$listNotifications = new request();
$listNotifications->openNotifications($tmpquery);
$comptListNotifications = count($listNotifications->not_id);
for ($i = 0; $i < $comptListNotifications; $i++) {
if ($listNotifications->not_meetingassignment[$i] != "0") {
continue;
}
$mail = new notification();
$mail->getUserinfo($_SESSION['idSession'], "from");
$mail->partSubject = $strings["noti_meetingassignment1"];
$mail->partMessage = $strings["noti_meetingassignment2"];
if ($projectNoti->pro_org_id[0] == "1") {
$projectNoti->pro_org_name[0] = $strings["none"];
}
$idStatus = $meetingNoti->mee_status[0];
$idPriority = $meetingNoti->mee_priority[0];
$body = $mail->partMessage . "\n\n" . $strings["meeting"] . " : " . $meetingNoti->mee_name[0] . "\n" . $strings["me_agenda"] . " : " . $meetingNoti->mee_agenda[0] . "\n" . $strings["date"] . " : " . $meetingNoti->mee_date[0] . "\n" . $strings["start_time"] . " : " . $meetingNoti->mee_start_time[0] . "\n" . $strings["end_time"] . " : " . $meetingNoti->mee_end_time[0] . "\n" . $strings["me_location"] . " : " . $meetingNoti->mee_location[0] . "\n" . $strings["priority"] . " : {$priority[$idPriority]}\n" . $strings["status"] . " : {$status[$idStatus]}\n\n" . $strings["project"] . " : " . $projectNoti->pro_name[0] . " (" . $projectNoti->pro_id[0] . ")\n" . $strings["organization"] . " : " . $projectNoti->pro_org_name[0] . "\n\n" . $strings["noti_moreinfo"] . "\n";
if ($meetingNoti->mee_mem_organization[0] == "1") {
$body .= "{$root}/general/login.php?url=meetings/viewmeeting.php%3Fid={$num}";
} else {
if ($meetingNoti->mee_mem_organization[0] != "1" && $projectNoti->pro_published[0] == "0" && $meetingNoti->mee_published[0] == "0") {
$body .= "{$root}/general/login.php?url=projects_site/home.php%3Fproject=" . $projectNoti->pro_id[0];
}
开发者ID:TICanalyste,项目名称:netOffice--remix-,代码行数:31,代码来源:noti_meetingassignment.php
示例14: session_start
session_start();
define('DOCROOT', realpath(dirname(__FILE__)) . '/');
require DOCROOT . 'dbConn.php';
$con = new dbConn();
$password = $_POST['password'];
$email = $_SESSION['email'];
require DOCROOT . 'activationAndNotifications.php';
$stm = "select pwcr from users where email = '" . $email . "';";
$res = $con->execute($stm);
if ($res->num_rows > 0) {
while ($row = $res->fetch_assoc()) {
if ($row['pwcr'] == 1) {
$stm = "update users set password = '" . $password . "' where email='" . $email . "';";
if ($con->execute($stm) === true) {
$not = new notification();
$body = "Password changed successfully.";
$not->email("[email protected]", "Administration", "[email protected]", "mailstodeliver", $email, "Password Changed Successfully", $body);
$stm = "update users set pcwr = 0 where email = '" . $email . "';";
$con->execute($stm);
$stm = "update users set activationCode = 0 where email = '" . $email . "';";
$con->execute($stm);
$_SESSION['homeMessage'] = "Password has been changed successfully.";
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/index.php'>";
} else {
$_SESSION['homeMessage'] = "Link has been expired.";
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/index.php'>";
}
}
}
}
开发者ID:naikamish,项目名称:Chat-Client,代码行数:30,代码来源:passverifi.php
示例15: addInstanceToPool
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param notification $value A notification object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(notification $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
self::$instances[$key] = $obj;
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:22,代码来源:BasenotificationPeer.php
示例16: notify_admin
function notify_admin($action, $parent, $child)
{
$cclass = $child->get__table();
$cname = $child->nname;
$pclass = $parent->getClass();
$pname = $parent->nname;
$not = new notification(null, null, 'client-admin');
$not->get();
if (!array_search_bool($cclass, $not->class_list)) {
return;
}
$subject = "{$cclass} {$cname} was {$action} to {$pclass} {$pname} ";
send_mail_to_admin($subject, $subject);
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:lib.php
示例17: unset
unset($product_row[$product_key]);
}
}
$subject = "Search Ad - Search Ads products budget has ended";
$message = "The following Search Ad products have reached balance 0 (zero)." . PHP_EOL . PHP_EOL;
foreach ($product_row as $product_details) {
$new_balance = $product_details['balance'] - $product_details['last_cost'];
$new_balance = $new_balance < 0 ? 0 : number_format($new_balance, 2);
$add_product_to_message = false;
if ($product_details['balance'] != '') {
try {
$values = array('budget_credit' => $new_balance, 'last_adwords_date' => $yesterday_date);
$db_syssql->update()->table('sYra.google_advertising_product_credit')->values($values)->where('product_data_id = :monthly_budget_product_data_id')->binds(array(':monthly_budget_product_data_id' => $product_details['monthly_budget_product_data_id']))->execute();
} catch (DatabaseException $dbe) {
//Show generic error for db class exceptions
throw new Exception('An error has occurred, please try again');
}
if ($new_balance <= 0) {
$add_product_to_message = true;
}
}
if ($add_product_to_message) {
$message .= "Product ID: {$product_details['product_data_id']}" . PHP_EOL . "Member ID: {$product_details['member_id']}" . PHP_EOL . "Client ID: {$product_details['client_id']}" . PHP_EOL . PHP_EOL;
$send_email = true;
}
}
if ($send_email) {
notification::send($to, FROM_EMAIL, FROM_EMAIL_NAME, $subject, $message);
}
}
cron_commit($execution_id);
开发者ID:daviptch,项目名称:search_ad,代码行数:31,代码来源:calculate_monthly_balance.php
示例18: init_cobalt
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig ([email protected])
//****************************************************************************************
require 'path.php';
init_cobalt('View notification');
if (xsrf_guard()) {
init_var($_POST['btn_cancel']);
init_var($_POST['btn_submit']);
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button');
redirect("listview_notification.php");
}
if ($_POST['btn_submit']) {
log_action('Pressed submit button');
require 'subclasses/notification.php';
$dbh_notification = new notification();
if ($message == "") {
log_action('Exported table data to CSV');
$timestamp = date('Y-m-d');
$token = generate_token(0, 'fs');
$csv_name = $token . $_SESSION['user'] . '_notification_' . $timestamp . '.csv';
$filename = TMP_DIRECTORY . '/' . $csv_name;
$csv_contents = $dbh_notification->export_to_csv();
$csv_file = fopen($filename, "wb");
fwrite($csv_file, $csv_contents);
fclose($csv_file);
chmod($filename, 0755);
$csv_name = urlencode($csv_name);
$message = 'CSV file successfully generated: <a href="/' . BASE_DIRECTORY . '/download_generic.php?filename=' . $csv_name . '">Download the CSV file.</a>';
$message_type = 'system';
}
开发者ID:seans888,项目名称:Bgy-Project,代码行数:31,代码来源:csv_notification.php
示例19: getIndicator
private static function getIndicator()
{
if (!self::$indicator) {
self::$indicator = new myFileIndicator("gogonotifications");
}
return self::$indicator;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:7,代码来源:notification.php
示例20: save_posts_locked_from_submit
/**
* Save the locked state for a post
*
* @return result array.
*/
public function save_posts_locked_from_submit()
{
global $DB;
// Ensure that post exists and get the right courseid.
$postid = required_param('postid', PARAM_INT);
if (!($post = $DB->get_record('format_socialwall_posts', array('id' => $postid)))) {
print_error('invalidpostid', 'format_socialwall');
}
// ... check capability.
$coursecontext = \context_course::instance($post->courseid);
if (!has_capability('format/socialwall:lockcomment', $coursecontext)) {
print_error('missingcaplockcomment', 'format_socialwall');
}
$locked = optional_param('locked', '0', PARAM_INT);
if ($post->locked != $locked) {
$post->locked = $locked;
$post->timemodified = time();
$DB->update_record('format_socialwall_posts', $post);
// We use a instant enqueueing, if needed you might use events here.
notification::enqueue_post_locked($post);
}
return array('error' => '0', 'message' => 'postsaved', 'postid' => $post->id, 'locked' => "{$post->locked}");
}
开发者ID:HarcourtsAcademy,项目名称:moodle-format_socialwall,代码行数:28,代码来源:posts.php
注:本文中的notification类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论