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


PHP Chat::Destroy方法代码示例

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


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

示例1: CreateAutoForward

 function CreateAutoForward()
 {
     global $INTLIST, $CONFIG;
     $this->LoadForward(false, false);
     if (!($this->Forward != null && !$this->Forward->Processed)) {
         $allForwards = $this->GetForwards();
         $targets = array();
         setOperator();
         if (count($INTLIST) >= 2) {
             $forwardedToCount = array();
             foreach ($INTLIST as $opsysId => $ccount) {
                 $lastForwardToTime = $ccount;
                 foreach ($allForwards as $forward) {
                     if ($forward->TargetSessId == $opsysId) {
                         $lastForwardToTime = max($forward->Created, $lastForwardToTime);
                         if (!isset($forwardedToCount[$opsysId])) {
                             $forwardedToCount[$opsysId] = 0;
                         }
                         $forwardedToCount[$opsysId]++;
                     }
                 }
                 $targets[$opsysId] = $lastForwardToTime;
             }
             if (count($forwardedToCount) > 0) {
                 $forwardedToCount = min($forwardedToCount);
             } else {
                 $forwardedToCount = 0;
             }
             if (!empty($CONFIG["gl_mcfc"]) && is_numeric($CONFIG["gl_mcfc"])) {
                 if ($CONFIG["gl_mcfc"] <= $forwardedToCount) {
                     return false;
                 }
             }
             if (!empty($targets)) {
                 asort($targets);
                 foreach ($targets as $targetsysid => $time) {
                     if ($targetsysid != $this->DesiredChatPartner) {
                         $forward = new Forward($this->ChatId, $this->DesiredChatPartner);
                         $forward->InitiatorSystemId = $this->DesiredChatPartner;
                         $forward->ReceiverUserId = $this->UserId;
                         $forward->ReceiverBrowserId = $this->BrowserId;
                         $forward->TargetSessId = $targetsysid;
                         $forward->TargetGroupId = $this->DesiredChatGroup;
                         $forward->Invite = false;
                         $forward->Auto = true;
                         $forward->Save();
                         Chat::Destroy($this->ChatId);
                         return true;
                     }
                 }
             }
         } else {
             if (!empty($CONFIG["gl_mcfc"])) {
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:elderxavier,项目名称:SII9-CREATIVE-STUDIO,代码行数:59,代码来源:objects.global.users.inc.php

示例2: CreateAutoForward

 function CreateAutoForward($_user)
 {
     $this->LoadForward(false, false);
     if (!($this->Forward != null && !$this->Forward->Processed)) {
         $allForwards = $this->GetForwards();
         $targets = array();
         $this->FindOperator(VisitorChat::$Router, $_user, false, false, array($this->DesiredChatPartner => $this->DesiredChatPartner), false);
         $isTargetAvailable = count(VisitorChat::$Router->OperatorsAvailable) >= 2 || count(VisitorChat::$Router->OperatorsAvailable) == 1 && !empty($this->DesiredChatPartner) && !isset(VisitorChat::$Router->OperatorsAvailable[$this->DesiredChatPartner]);
         if ($isTargetAvailable) {
             $forwardedToCount = array();
             foreach (VisitorChat::$Router->OperatorsAvailable as $opsysId => $ccount) {
                 $lastForwardToTime = $ccount;
                 foreach ($allForwards as $forward) {
                     if ($forward->TargetSessId == $opsysId) {
                         $lastForwardToTime = max($forward->Created, $lastForwardToTime);
                         if (!isset($forwardedToCount[$opsysId])) {
                             $forwardedToCount[$opsysId] = 0;
                         }
                         $forwardedToCount[$opsysId]++;
                     }
                 }
                 $targets[$opsysId] = $lastForwardToTime;
             }
             if (count($forwardedToCount) > 0) {
                 $forwardedToCount = min($forwardedToCount);
             } else {
                 $forwardedToCount = 0;
             }
             if (!empty(Server::$Configuration->File["gl_mcfc"]) && is_numeric(Server::$Configuration->File["gl_mcfc"])) {
                 if (Server::$Configuration->File["gl_mcfc"] <= $forwardedToCount) {
                     return false;
                 }
             }
             if (!empty($targets)) {
                 asort($targets);
                 foreach ($targets as $targetsysid => $time) {
                     if ($targetsysid != $this->DesiredChatPartner) {
                         $forward = new Forward($this->ChatId, $this->DesiredChatPartner);
                         $forward->InitiatorSystemId = $this->DesiredChatPartner;
                         $forward->ReceiverUserId = $this->UserId;
                         $forward->ReceiverBrowserId = $this->BrowserId;
                         $forward->TargetSessId = $targetsysid;
                         $forward->TargetGroupId = $this->DesiredChatGroup;
                         $forward->Invite = false;
                         $forward->Auto = true;
                         $forward->Save();
                         $this->ArchiveCreated = 2;
                         Chat::Destroy($this->ChatId);
                         return true;
                     }
                 }
             }
         }
     }
     return true;
 }
开发者ID:sgh1986915,项目名称:laravel-eyerideonline,代码行数:56,代码来源:objects.global.users.inc.php


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