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


PHP Chat::getBanInformation方法代码示例

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


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

示例1: onLogLine

 public static function onLogLine($logType, $logaction, $title, $paramArray, &$comment, &$revert, $logTimestamp)
 {
     global $wgUser, $wgCityId;
     if (strpos($logaction, 'chatban') === 0) {
         $user = User::newFromId($paramArray[1]);
         if (!empty($user) && Chat::getBanInformation($wgCityId, $user) !== false && $wgUser->isAllowed('chatmoderator')) {
             $revert = "(" . "<a class='chat-change-ban' data-user-id='{$paramArray[1]}' href='#'>" . wfMsg('chat-ban-log-change-ban-link') . "</a>" . ")";
         }
     } elseif ($logaction === 'chatconnect' && !empty($paramArray)) {
         $ipLinks = array();
         if ($wgUser->isAllowed('multilookup')) {
             $mlTitle = GlobalTitle::newFromText('MultiLookup', NS_SPECIAL, 177);
             // Need to make the link manually for this as Linker's normaliseSpecialPage
             // makes the link local if the special page exists locally, rather than
             // keeping the global title
             $ipLinks[] = Xml::tags('a', array('href' => $mlTitle->getFullURL('target=' . urlencode($paramArray[0]))), wfMessage('multilookup')->escaped());
             $ipLinks[] = Linker::makeKnownLinkObj(GlobalTitle::newFromText('Phalanx', NS_SPECIAL, 177), wfMessage('phalanx')->escaped(), wfArrayToCGI(array('type' => '8', 'target' => $paramArray[0], 'wpPhalanxCheckBlocker' => $paramArray[0])));
             $ipLinks[] = Linker::blockLink(0, $paramArray[0]);
             $revert = '(' . implode(wfMessage('pipe-separator')->plain(), $ipLinks) . ')';
         }
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:23,代码来源:ChatHelper.php

示例2: BanModal

 function BanModal()
 {
     ChatHelper::info(__METHOD__ . ': Method called');
     global $wgRequest, $wgCityId, $wgLang;
     wfProfileIn(__METHOD__);
     $tmpl = new EasyTemplate(dirname(__FILE__) . '/templates/');
     $userId = $wgRequest->getVal('userId', 0);
     $isChangeBan = false;
     $isoTime = "";
     $fmtTime = "";
     if (!empty($userId) && ($user = User::newFromID($userId))) {
         $ban = Chat::getBanInformation($wgCityId, $user);
         if ($ban !== false) {
             $isChangeBan = true;
             $isoTime = wfTimestamp(TS_ISO_8601, $ban->end_date);
             $fmtTime = $wgLang->timeanddate(wfTimestamp(TS_MW, $ban->end_date), true);
         }
     }
     $tmpl->set_vars(array('options' => Chat::GetBanOptions(), 'isChangeBan' => $isChangeBan, 'isoTime' => $isoTime, 'fmtTime' => $fmtTime));
     $retVal = array();
     $retVal['template'] = $tmpl->render("banModal");
     $retVal['isChangeBan'] = $isChangeBan;
     wfProfileOut(__METHOD__);
     return $retVal;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:ChatAjax.class.php

示例3: canChat

 /**
  * Since the permission essentially has to be implemented as an anti-permission, this function removes the
  * need for confusing double-negatives in the code.
  *
  * @param userObject - an object of class User (such as wgUser).
  */
 public static function canChat($userObject)
 {
     global $wgCityId;
     if ($userObject->isBlocked()) {
         return false;
     }
     if (Chat::getBanInformation($wgCityId, $userObject) !== false) {
         return false;
     }
     return $userObject->isLoggedin() && $userObject->isAllowed('chat');
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:17,代码来源:Chat.class.php

示例4: getTagFromGroups

 /**
  * @return string
  */
 protected function getTagFromGroups()
 {
     $this->app->wf->ProfileIn(__METHOD__);
     $result = '';
     $group = $this->getUsersHighestGroup($this->user);
     if ($group) {
         $result = $this->app->wf->Msg('user-identity-box-group-' . $group);
     }
     /* See if user is banned from chat */
     if (!empty($this->app->wg->EnableChat) && Chat::getBanInformation($this->app->wg->CityId, $this->user) !== false) {
         $result = wfMsg('user-identity-box-banned-from-chat');
     }
     $this->app->wf->ProfileOut(__METHOD__);
     return $result;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:18,代码来源:UserTagsStrategyBase.class.php

示例5: canChat

 /**
  * Since the permission essentially has to be implemented as an anti-permission, this function removes the
  * need for confusing double-negatives in the code.
  *
  * @param User $userObject - an object of class User (such as wgUser).
  *
  * @return bool
  */
 public static function canChat(User $userObject)
 {
     if ($userObject->isAnon()) {
         return false;
     }
     if ($userObject->isBlocked()) {
         return false;
     }
     if (Chat::getBanInformation(F::app()->wg->CityId, $userObject) !== false) {
         return false;
     }
     return $userObject->isAllowed('chat');
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:21,代码来源:Chat.class.php


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