当前位置: 首页>>代码示例>>PHP>>正文


PHP messages::SendBlockedTServices方法代码示例

本文整理汇总了PHP中messages::SendBlockedTServices方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::SendBlockedTServices方法的具体用法?PHP messages::SendBlockedTServices怎么用?PHP messages::SendBlockedTServices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在messages的用法示例。


在下文中一共展示了messages::SendBlockedTServices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Blocked

 public function Blocked($id, $user_id, $reason, $reason_id = 0)
 {
     $data = $this->getCardModeration($id);
     if (!$data) {
         return false;
     }
     if ($data['is_blocked'] == 't') {
         return true;
     }
     $sQuery = "\n             UPDATE {$this->TABLE_MODERATION} SET \n                 status = 2 \n             WHERE \n                rec_id = ?i \n                AND rec_type = ?i \n             RETURNING rec_id";
     $sRecId = $this->db()->val($sQuery, $id, user_content::MODER_TSERVICES);
     //Если вдруг записи нет на модерации добавляем
     if (!$sRecId) {
         $this->sendToModeration($id, $data, 2);
     }
     $sBlockId = $this->db()->insert($this->TABLE_BLOCKED, array('src_id' => $id, 'admin' => $user_id, 'reason' => $reason, 'reason_id' => $reason_id, 'blocked_time' => 'NOW()'), 'id');
     if (!$sBlockId) {
         return false;
     }
     $sObjLink = sprintf('%s/tu/%d/%s.html', $GLOBALS['host'], $data['id'], translit(strtolower(htmlspecialchars_decode($data['title'], ENT_QUOTES))));
     //пишем лог админских действий
     admin_log::addLog(admin_log::OBJ_CODE_TSERVICES, 64, $data['uid'], $id, $data['title'], $sObjLink, 0, '', 0, $reason, $sBlockId, '', $user_id);
     //отправляем сообщение о блокировки
     messages::SendBlockedTServices($data, $reason);
     return true;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:26,代码来源:tservices.php

示例2: resolveTServices

 /**
  * Типовые услуги. Утверждение/удаление записи
  * 
  * @param  string $stream_id идентификатор потока
  * @param  int $user_id идентификатор модератора
  * @param  int $from_id идентификатор пользователя
  * @param  int $rec_id идентификатор записи
  * @param  int $rec_type тип записи 
  * @param  int $action действие: 1 - утверждено, 2 - удалено
  * @param  string $is_sent было ли отправлено уведомление
  * @param  string $reason причина удаления
  */
 function resolveTServices($stream_id = '', $user_id = 0, $from_id = 0, $rec_id = 0, $rec_type = 0, $action = 1, $is_sent = '', $reason = '')
 {
     $bRet = false;
     $sQuery = 'UPDATE moderation SET moder_num = ?i, status = ?i WHERE rec_id = ?i AND rec_type = ?i AND stream_id = ? RETURNING rec_id';
     $sRecId = $GLOBALS['DB']->val($sQuery, $this->nResolveCnt, $action, $rec_id, self::MODER_TSERVICES, $stream_id);
     if ($sRecId) {
         require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/admin_log.php';
         $tservice = $GLOBALS['DB']->row("\n                SELECT\n                s.id,\n                s.title, \n                u.login, \n                u.uname,\n                u.usurname,\n                COALESCE(sb.src_id::boolean, FALSE) AS is_blocked \n            FROM tservices AS s \n            LEFT JOIN tservices_blocked AS sb ON sb.src_id = s.id  \n            INNER JOIN freelancer AS u ON u.uid = s.user_id \n            WHERE s.id = ?i \n            LIMIT 1\n            ", $rec_id);
         if ($tservice) {
             $bRet = true;
             $sObjLink = sprintf('%s/tu/%d/%s.html', $GLOBALS['host'], $tservice['id'], translit(strtolower(htmlspecialchars_decode($tservice['title'], ENT_QUOTES))));
             if ($action == 1 && $tservice['is_blocked'] == 't') {
                 //разблокируем
                 $GLOBALS['DB']->query("\n                        DELETE FROM tservices_blocked \n                        WHERE src_id = ?i\n                    ", $rec_id);
                 // пишем лог админских действий
                 admin_log::addLog(admin_log::OBJ_CODE_TSERVICES, 65, $from_id, $rec_id, $tservice['title'], $sObjLink, 0, '', 0, '');
             } elseif ($action == 2 && $tservice['is_blocked'] != 't') {
                 //блокируем
                 $sBlockId = $GLOBALS['DB']->val("\n                        INSERT INTO tservices_blocked (\n                            src_id, \n                            admin, \n                            reason, \n                            reason_id, \n                            blocked_time) \n                        VALUES(?i, ?i, ?, ?i, NOW()) RETURNING id\n                     ", $rec_id, $user_id, $reason, 0);
                 //пишем лог админских действий
                 admin_log::addLog(admin_log::OBJ_CODE_TSERVICES, 64, $from_id, $rec_id, $tservice['title'], $sObjLink, 0, '', 0, $reason, $sBlockId);
                 //отправляем сообщение о блокировки
                 require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages.php';
                 messages::SendBlockedTServices($tservice, $reason);
             }
         }
     }
     return $bRet;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:41,代码来源:user_content.php


注:本文中的messages::SendBlockedTServices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。