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


PHP c2cTools::getUsersToNotify方法代碼示例

本文整理匯總了PHP中c2cTools::getUsersToNotify方法的典型用法代碼示例。如果您正苦於以下問題:PHP c2cTools::getUsersToNotify方法的具體用法?PHP c2cTools::getUsersToNotify怎麽用?PHP c2cTools::getUsersToNotify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在c2cTools的用法示例。


在下文中一共展示了c2cTools::getUsersToNotify方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: error

 // If the posting user is logged in, increment his/her post count
 if (!$pun_user['is_guest']) {
     if ($pun_user['num_posts'] == 0) {
     }
     $low_prio = $db_type == 'mysql' ? 'LOW_PRIORITY ' : '';
     $db->query('UPDATE ' . $low_prio . $db->prefix . 'users SET num_posts=num_posts+1, last_post=' . $now . ' WHERE id=' . $pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
 }
 // Redirect to "symfony app" after comment has been posted
 if ($is_comment) {
     $doc_param = get_doc_param($cur_posting['subject'] ? $cur_posting['subject'] : $subject);
     // clear symfony cache for the corresponding docs view, diff, history.. - in order to have number of comments properly displayed)
     c2cTools::clearCommentCache($doc_param[0], $doc_param[1]);
     // if this is the first comment on an outing or an image, we should send notifications to concerned people
     // and subscribe them to topic
     if ($fid) {
         $users = c2cTools::getUsersToNotify($doc_param[0]);
         if (!empty($users)) {
             // subscribe users to topic
             $values = array();
             foreach ($users as $user) {
                 $values[] = '(\'' . $user . "', '{$new_tid}')";
             }
             $db->query('INSERT INTO ' . $db->prefix . 'subscriptions (user_id, topic_id) VALUES ' . implode(', ', $values)) or error('Unable to add subscription', __FILE__, __LINE__, $db->error());
             // TODO maybe just continue silently if subscription fails?
             // send mails to concerned users
             require PUN_ROOT . 'include/email.php';
             $result = $db->query('SELECT id, language, email FROM ' . $db->prefix . 'users WHERE id IN (' . implode(', ', $users) . ')') or error('Unable to fetch user languages', __FILE__, __LINE__, $db->error());
             // TODO idem
             if ($db->num_rows($result) != count($users)) {
                 message($lang_common['Bad request']);
             }
開發者ID:snouhaud,項目名稱:camptocamp.org,代碼行數:31,代碼來源:post.php


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