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


PHP CUser::IsOnLine方法代码示例

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


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

示例1: GetSendMode

 public static function GetSendMode($userId)
 {
     $result = self::SEND_IMMEDIATELY;
     $isMobile = false;
     if (CModule::IncludeModule('mobile')) {
         $isMobile = Bitrix\Mobile\User::checkOnline($userId);
     }
     $isDesktop = false;
     $isDesktopIdle = false;
     if (CModule::IncludeModule('im')) {
         $arOnline = CIMStatus::GetList(array('ID' => $userId, 'SKIP_CHECK' => 'Y'));
         $isOnline = isset($arOnline['users'][$userId]) && $arOnline['users'][$userId]['status'] != 'offline';
         $isDesktop = CIMMessenger::CheckDesktopStatusOnline($userId);
         if ($isDesktop && intval($arOnline['users'][$userId]['idle']) > 0) {
             $isDesktopIdle = true;
         }
     } else {
         $isOnline = CUser::IsOnLine($userId, 120);
     }
     if ($isMobile) {
         $result = self::SEND_IMMEDIATELY;
     } else {
         if ($isOnline) {
             $result = self::SEND_DEFERRED;
             if ($isDesktop) {
                 $result = self::SEND_SKIP;
                 if ($isDesktopIdle) {
                     $result = self::SEND_IMMEDIATELY;
                 }
             }
         }
     }
     return $result;
 }
开发者ID:vim84,项目名称:b-markt,代码行数:34,代码来源:pull_push.php

示例2: AddQueue

 public function AddQueue($arParams)
 {
     global $DB;
     if (isset($arParams['USER_ID']) && intval($arParams['USER_ID']) > 0) {
         $arFields['USER_ID'] = intval($arParams['USER_ID']);
     } else {
         return false;
     }
     if (isset($arParams['MESSAGE']) && strlen(trim($arParams['MESSAGE'])) > 0) {
         $arFields['MESSAGE'] = str_replace(array("\r\n", "\n\r", "\n", "\r"), " ", trim($arParams['MESSAGE']));
         if (strlen($arFields['MESSAGE']) > 110) {
             $arFields['MESSAGE'] = substr($arFields['MESSAGE'], 0, 105) . ' ...';
         }
     } else {
         return false;
     }
     $arFields['TAG'] = '';
     if (isset($arParams['TAG']) && strlen(trim($arParams['TAG'])) > 0 && strlen(trim($arParams['TAG'])) <= 255) {
         $arFields['TAG'] = trim($arParams['TAG']);
     }
     $arFields['PARAMS'] = '';
     if (isset($arParams['PARAMS']) && strlen(trim($arParams['PARAMS'])) > 0) {
         $arFields['PARAMS'] = $arParams['PARAMS'];
     }
     if ((IsModuleInstalled('im') || IsModuleInstalled('socialnetwork')) && !CUser::IsOnLine($arFields['USER_ID'], 120)) {
         $arAdd = array('USER_ID' => $arFields['USER_ID'], 'MESSAGE' => $arFields['MESSAGE'], 'PARAMS' => $arFields['PARAMS']);
         $CPushManager = new CPushManager();
         $CPushManager->SendMessage(array($arAdd), defined('PULL_PUSH_SANDBOX') ? true : false);
     } else {
         $arAdd = array('USER_ID' => $arFields['USER_ID'], 'MESSAGE' => $arFields['MESSAGE'], 'TAG' => $arFields['TAG'], 'PARAMS' => $arFields['PARAMS'], '~DATE_CREATE' => $DB->CurrentTimeFunction());
         $DB->Add("b_pull_push_queue", $arAdd, array("PARAMS"));
         CAgent::AddAgent("CPushManager::SendAgent();", "pull", "N", 30, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 30, "FULL"));
     }
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:35,代码来源:pull_push.php

示例3: array

        echo $COMMENT['ID'];
        ?>
">	
					<?php 
        if ($COMMENT['USER']['PERSONAL_PHOTO'] != "") {
            $file = CFile::ResizeImageGet($COMMENT['USER']['PERSONAL_PHOTO'], array('width' => 50, 'height' => 50), BX_RESIZE_IMAGE_EXACT, true);
        } else {
            $file["src"] = "/images/user_photo.png";
        }
        ?>
					<div class="gallery_comm_item_avatar" style="background-image: url('<?php 
        echo $file["src"];
        ?>
');">
						<div <?php 
        if (CUser::IsOnLine($COMMENT['USER']["ID"], 12000)) {
            echo 'class="gallery_comm_item_avatar_online"';
        }
        ?>
></div>
					</div>
					<?php 
        $username = $COMMENT['USER']['NAME'] != "" ? $COMMENT['USER']['NAME'] . ' ' . $COMMENT['USER']['LAST_NAME'] : $COMMENT['USER']['LOGIN'];
        ?>
					<div class="gallery_comm_item_info">
						<div class="gallery_comm_item_date"><?php 
        echo $COMMENT['DATE_CREATE'];
        ?>
</div>
						<div class="gallery_comm_item_name">
							<?php 
开发者ID:dayAlone,项目名称:MyQube,代码行数:31,代码来源:template.php

示例4: AddQueue

 public function AddQueue($arParams)
 {
     if (!CPullOptions::GetPushStatus()) {
         return false;
     }
     global $DB;
     if (isset($arParams['USER_ID']) && intval($arParams['USER_ID']) > 0) {
         $arFields['USER_ID'] = intval($arParams['USER_ID']);
     } else {
         return false;
     }
     if (isset($arParams['MESSAGE']) && strlen(trim($arParams['MESSAGE'])) > 0) {
         $arFields['MESSAGE'] = str_replace(array("\r\n", "\n\r", "\n", "\r"), " ", trim($arParams['MESSAGE']));
         if (strlen($arFields['MESSAGE']) > 110) {
             $arFields['MESSAGE'] = substr($arFields['MESSAGE'], 0, 105) . ' ...';
         }
     }
     $arFields['TAG'] = '';
     if (isset($arParams['TAG']) && strlen(trim($arParams['TAG'])) > 0 && strlen(trim($arParams['TAG'])) <= 255) {
         $arFields['TAG'] = trim($arParams['TAG']);
     }
     $arFields['SUB_TAG'] = '';
     if (isset($arParams['SUB_TAG']) && strlen(trim($arParams['SUB_TAG'])) > 0 && strlen(trim($arParams['SUB_TAG'])) <= 255) {
         $arFields['SUB_TAG'] = trim($arParams['SUB_TAG']);
     }
     $arFields['BADGE'] = -1;
     if (isset($arParams['BADGE']) && $arParams['BADGE'] != '' && intval($arParams['BADGE']) >= 0) {
         $arFields['BADGE'] = intval($arParams['BADGE']);
     }
     $arFields['PARAMS'] = '';
     if (isset($arParams['PARAMS']) && strlen(trim($arParams['PARAMS'])) > 0) {
         $arFields['PARAMS'] = $arParams['PARAMS'];
     }
     if (strlen($arParams['SOUND']) > 0) {
         $arFields['SOUND'] = $arParams['SOUND'];
     }
     $arFields['APP_ID'] = strlen($arParams['APP_ID']) > 0 ? $arParams['APP_ID'] : "Bitrix24";
     if (isset($arParams['SEND_IMMEDIATELY']) && $arParams['SEND_IMMEDIATELY'] == 'Y' || !CUser::IsOnLine($arFields['USER_ID'], 120)) {
         $arAdd = array('USER_ID' => $arFields['USER_ID']);
         if (strlen($arFields['MESSAGE']) > 0) {
             $arAdd['MESSAGE'] = $arFields['MESSAGE'];
         }
         if (strlen($arFields['PARAMS']) > 0) {
             $arAdd['PARAMS'] = $arFields['PARAMS'];
         }
         if (intval($arFields['BADGE']) >= 0) {
             $arAdd['BADGE'] = $arFields['BADGE'];
         }
         if (strlen($arFields['SOUND']) > 0) {
             $arAdd['SOUND'] = $arFields['SOUND'];
         }
         if (strlen($arParams['EXPIRY']) > 0) {
             $arAdd['EXPIRY'] = $arParams['EXPIRY'];
         }
         $arAdd['APP_ID'] = $arFields['APP_ID'];
         $CPushManager = new CPushManager();
         $CPushManager->SendMessage(array($arAdd));
     } else {
         $arAdd = array('USER_ID' => $arFields['USER_ID'], 'TAG' => $arFields['TAG'], 'SUB_TAG' => $arFields['SUB_TAG'], '~DATE_CREATE' => $DB->CurrentTimeFunction());
         if (strlen($arFields['MESSAGE']) > 0) {
             $arAdd['MESSAGE'] = $arFields['MESSAGE'];
         }
         if (strlen($arFields['PARAMS']) > 0) {
             $arAdd['PARAMS'] = $arFields['PARAMS'];
         }
         if (intval($arFields['BADGE']) >= 0) {
             $arAdd['BADGE'] = $arFields['BADGE'];
         }
         $arAdd['APP_ID'] = $arFields['APP_ID'];
         $DB->Add("b_pull_push_queue", $arAdd, array("PARAMS"));
         CAgent::AddAgent("CPushManager::SendAgent();", "pull", "N", 30, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 30, "FULL"));
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:74,代码来源:pull_push.php

示例5: IsOnLine

 /**
  * <p>Метод проверяет, находится ли сейчас пользователь на сайте. Пользователь находится на сайте, если он совершал на сайте какие-либо действия за последние 2 минуты.</p>
  *
  *
  *
  *
  * @param int $userID  Код пользователя. </h
  *
  *
  *
  * @return bool <p>True, если пользователь сейчас на сайте. Иначе - false.</p> <br><br>
  *
  * @static
  * @link http://dev.1c-bitrix.ru/api_help/socialnetwork/classes/CSocNetUser/IsOnLine.php
  * @author Bitrix
  */
 public static function IsOnLine($userID)
 {
     $userID = IntVal($userID);
     if ($userID <= 0) {
         return false;
     }
     return CUser::IsOnLine($userID, 120);
 }
开发者ID:rasuldev,项目名称:torino,代码行数:24,代码来源:user.php

示例6: IsOnLine

	function IsOnLine($userID)
	{
		$userID = IntVal($userID);
		if ($userID <= 0)
			return false;

		return CUser::IsOnLine($userID, 120);
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:8,代码来源:user.php


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