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


PHP CSocNetUser::IsOnLine方法代码示例

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


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

示例1: _FormatUser

 function _FormatUser(&$arUser, $arPath)
 {
     global $USER, $CACHE_ABSENCE;
     if ($arUser['PERSONAL_PHOTO']) {
         $arImage = CIntranetUtils::InitImage($arUser['PERSONAL_PHOTO'], 30);
         $arUser['PERSONAL_PHOTO'] = $arImage['IMG'];
     }
     if ($arPath['DETAIL_URL']) {
         $arUser['DETAIL_URL'] = str_replace('#ID#', $arUser['ID'], $arPath['DETAIL_URL']);
     }
     $arUser["canViewProfile"] = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arUser['ID'], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
     $arUser["canMessage"] = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arUser['ID'], "message", CSocNetUser::IsCurrentUserModuleAdmin());
     if ($arPath['MESSAGES_CHAT_URL']) {
         $arUser['MESSAGES_CHAT_URL'] = str_replace('#ID#', $arUser['ID'], $arPath['MESSAGES_CHAT_URL']);
     }
     $arUser['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
     $arUser['IS_ONLINE'] = CSocNetUser::IsOnLine($arUser['ID']);
     if ($arUser['IS_ABSENT']) {
         $maxAbsence = 0;
         foreach ($CACHE_ABSENCE[$arUser["ID"]] as $arAbsence) {
             if (MakeTimeStamp($arAbsence["DATE_TO"]) > $maxAbsence) {
                 $arUser['ABSENT_TILL'] = $arAbsence["DATE_TO"];
             }
         }
     }
     $arFilter = array("TO_USER_ID" => $arUser['ID'], "MESSAGE_TYPE" => SONET_MESSAGE_PRIVATE, "FROM_USER_ID" => $USER->GetID());
     $dbMessages = CSocNetMessages::GetList(array("DATE_CREATE" => "DESC"), $arFilter, false, array("nTopCount" => 1), array("ID", "DATE_CREATE"));
     if ($arMessages = $dbMessages->GetNext()) {
         $arUser['LAST_CHAT'] = $arMessages["DATE_CREATE"];
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:32,代码来源:index.php

示例2: array_diff

 if (is_array($arUser['UF_DEPARTMENT']) && count($arUser['UF_DEPARTMENT']) > 0) {
     $arNewDep = array_diff($arUser['UF_DEPARTMENT'], $arDepCache);
     if (count($arNewDep) > 0) {
         $dbRes = CIBlockSection::GetList(array('SORT' => 'ASC'), array('ID' => $arNewDep));
         while ($arSect = $dbRes->Fetch()) {
             $arDepCache[] = $arSect['ID'];
             $arDepCacheValue[$arSect['ID']] = $arSect['NAME'];
         }
     }
     foreach ($arUser['UF_DEPARTMENT'] as $key => $sect) {
         $arDep[$sect] = $arDepCacheValue[$sect];
     }
 }
 $arUser['UF_DEPARTMENT'] = $arDep;
 $arUser["DETAIL_URL"] = $arItem["URL"];
 $arUser['IS_ONLINE'] = $bSoNet && CSocNetUser::IsOnLine($arUser['ID']);
 if ($arUser['PERSONAL_BIRTHDAY']) {
     $arBirthDate = ParseDateTime($arUser['PERSONAL_BIRTHDAY'], CSite::GetDateFormat('SHORT'));
     $arUser['IS_BIRTHDAY'] = intval($arBirthDate['MM']) == date('n') && intval($arBirthDate['DD']) == date('j');
 }
 $arUser['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arUser['ID']);
 $arUser['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
 $arUser['ACTIVITY_STATUS'] = 'active';
 $arUser['EXTRANET'] = false;
 if (count($arUser['UF_DEPARTMENT']) <= 0) {
     $arUser["ACTIVITY_STATUS"] = 'extranet';
     $arUser['EXTRANET'] = true;
 }
 if ($arUser["ACTIVE"] == "N") {
     $arUser["ACTIVITY_STATUS"] = 'fired';
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:result_modifier.php

示例3: array

        default:
            $suffix = "unknown";
    }
    $arResult["User"]["PERSONAL_PHOTO"] = COption::GetOptionInt("socialnetwork", "default_user_picture_" . $suffix, false, SITE_ID);
}
$arResult["User"]["PersonalPhotoFile"] = array("src" => "");
if (intval($arResult["User"]["PERSONAL_PHOTO"]) > 0) {
    $imageFile = CFile::GetFileArray($arResult["User"]["PERSONAL_PHOTO"]);
    if ($imageFile !== false) {
        $arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 42, "height" => 42), BX_RESIZE_IMAGE_EXACT, true);
    }
    if ($arFileTmp && array_key_exists("src", $arFileTmp)) {
        $arResult["User"]["PersonalPhotoFile"] = $arFileTmp;
    }
}
$arResult["IS_ONLINE"] = CSocNetUser::IsOnLine($arResult["User"]["ID"]);
if (CModule::IncludeModule('intranet')) {
    $arResult['IS_HONOURED'] = CIntranetUtils::IsUserHonoured($arResult["User"]["ID"]);
    $arResult['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arResult["User"]["ID"]);
}
if ($arResult["User"]['PERSONAL_BIRTHDAY'] != '') {
    $arBirthDate = ParseDateTime($arResult["User"]['PERSONAL_BIRTHDAY'], CSite::GetDateFormat('SHORT'));
    $arResult['IS_BIRTHDAY'] = intval($arBirthDate['MM']) == date('n') && intval($arBirthDate['DD']) == date('j');
}
$arResult["CurrentUserPerms"] = CSocNetUserPerms::InitUserPerms($GLOBALS["USER"]->GetID(), $GLOBALS["USER"]->GetID(), CSocNetUser::IsCurrentUserModuleAdmin());
if (CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite()) {
    $arResult["CurrentUserPerms"]["Operations"]["viewfriends"] = false;
}
if ($this->__component->__parent && $this->__component->__parent->arResult && array_key_exists("PATH_TO_USER_PROFILE_EDIT", $this->__component->__parent->arResult)) {
    $arResult["Urls"]["Edit"] = CComponentEngine::MakePathFromTemplate($this->__component->__parent->arResult["PATH_TO_USER_PROFILE_EDIT"], array("user_id" => $GLOBALS["USER"]->GetID()));
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:result_modifier.php

示例4: array

 }
 $arImage = CSocNetTools::InitImage($arUserRequests["FROM_USER_PERSONAL_PHOTO"], $ImageSize, "/bitrix/images/socialnetwork/nopic_user_" . $ImageSize . ".gif", $ImageSize, $pu, $canViewProfile);
 $arData[1] = $arUserRequests["ID"];
 //1
 $arData[2] = $arUserRequests["FROM_USER_ID"];
 //2
 //				$arData[3] = $arUserRequests["FROM_USER_NAME"]." ".$arUserRequests["FROM_USER_LAST_NAME"];
 $arTmpUser = array("NAME" => $arUserRequests["~FROM_USER_NAME"], "LAST_NAME" => $arUserRequests["~FROM_USER_LAST_NAME"], "SECOND_NAME" => $arUserRequests["~FROM_USER_SECOND_NAME"], "LOGIN" => $arUserRequests["~FROM_USER_LOGIN"]);
 $arData[3] = CUser::FormatName($arParams['NAME_TEMPLATE'], $arTmpUser, $bUseLogin);
 $arData[4] = $arImage["IMG"];
 //4
 $arData[5] = $pu;
 //5
 $arData[6] = $canViewProfile ? "Y" : "N";
 //6
 $arData[7] = CSocNetUser::IsOnLine($arUserRequests["FROM_USER_ID"]) ? "Y" : "N";
 //7
 $arData[8] = $arUserRequests["DATE_CREATE"];
 //8
 $arData[9] = $arUserRequests["MESSAGE_TYPE"];
 //9
 //$arData[0] = $arUserRequests["TITLE"]; //10
 $arData[10] = $parser->convert($arUserRequests["~MESSAGE"], false, array(), array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LIST" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "SMILES" => "Y", "UPLOAD" => "N", "NL2BR" => "N"));
 //10
 $arData[11] = $arUserRequests["MESSAGE_TYPE"] == SONET_MESSAGE_PRIVATE && $canAnsver ? "Y" : "N";
 //11
 $arData[12] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MESSAGE_FORM_MESS"], array("user_id" => $arUserRequests["FROM_USER_ID"], "message_id" => $arUserRequests["ID"]));
 //12
 $arData[13] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MESSAGES_CHAT"], array("user_id" => $arUserRequests["FROM_USER_ID"], "message_id" => $arUserRequests["ID"]));
 //13
 $arData[14] = "EventType=Message&eventID=" . $arUserRequests["ID"] . "&action=close";
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:get_message.php


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