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


PHP CUserCounter::GetValues方法代码示例

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


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

示例1: GetMessage

     }
 }
 $arResult["Events"] = $arTmpEventsNew;
 if ($arParams["LOG_ID"] > 0 && count($arResult["Events"]) <= 0) {
     $arResult["FatalError"] = GetMessage("SONET_73_ENTRY_NOT_FOUND");
 }
 if ($arTmpEvent["DATE_FOLLOW"]) {
     $arResult["dateLastPageTS"] = MakeTimeStamp($arTmpEvent["DATE_FOLLOW"], CSite::GetDateFormat("FULL"));
     $dateLastPage = ConvertTimeStamp($arResult["dateLastPageTS"], "FULL");
 } elseif ($arParams["USE_FOLLOW"] == "N" && $arTmpEvent["LOG_UPDATE"]) {
     $arResult["dateLastPageTS"] = MakeTimeStamp($arTmpEvent["LOG_UPDATE"], CSite::GetDateFormat("FULL"));
     $dateLastPage = ConvertTimeStamp($arResult["dateLastPageTS"], "FULL");
 }
 $arResult["WORKGROUPS_PAGE"] = $folderWorkgroups;
 if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y") {
     $arCounters = CUserCounter::GetValues($user_id, SITE_ID);
     if (isset($arCounters[$arResult["COUNTER_TYPE"]])) {
         $arResult["LOG_COUNTER"] = intval($arCounters[$arResult["COUNTER_TYPE"]]);
     } else {
         $bEmptyCounter = true;
         $arResult["LOG_COUNTER"] = 0;
     }
 } else {
     $arParams["SHOW_UNREAD"] = "N";
 }
 if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y" && (intval($arResult["LOG_COUNTER"]) > 0 || $bEmptyCounter)) {
     CUserCounter::ClearByUser($user_id, array(SITE_ID, "**"), $arResult["COUNTER_TYPE"], true);
     CUserCounter::ClearByUser($user_id, SITE_ID, "BLOG_POST_IMPORTANT");
 }
 if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_PAGE_CACHE"] == "Y" && $dateLastPage && (!$dateLastPageStart || $dateLastPageStart != $dateLastPage || $bNeedSetLogPage)) {
     $groupCode = strlen($arResult["COUNTER_TYPE"]) > 0 ? $arResult["COUNTER_TYPE"] : "**";
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: foreach

             $arUnread[$data['senderId']]['USER'] = $arMessage['users'][$data['senderId']];
         }
         foreach ($arUnread as $userId => $data) {
             $arData[$userId] = $data;
         }
         uasort($arData, create_function('$a, $b', 'if($a["MESSAGE"]["date"] < $b["MESSAGE"]["date"] ) return 1; elseif($a["MESSAGE"]["date"]  > $b["MESSAGE"]["date"] ) return -1; else return 0;'));
         $arResult['COUNTER_UNREAD_MESSAGES'] = $arData;
     }
     if (CModule::IncludeModule('pull')) {
         $arChannel = CPullChannel::Get($USER->GetId());
         if (is_array($arChannel)) {
             $arResult['PULL_CONFIG'] = array('CHANNEL_ID' => $arChannel['CHANNEL_ID'], 'LAST_ID' => $arChannel['LAST_ID'], 'PATH' => $arChannel['PATH'], 'PATH_WS' => $arChannel['PATH_WS'], 'METHOD' => $arChannel['METHOD'], 'ERROR' => '');
         }
     }
     // Counters
     $arResult["COUNTERS"] = CUserCounter::GetValues($USER->GetID(), $_POST['SITE_ID']);
     $arResult["ERROR"] = $errorMessage;
     echo CUtil::PhpToJsObject($arResult);
 } else {
     if ($_POST['IM_NOTIFY_LOAD'] == 'Y') {
         $CIMNotify = new CIMNotify();
         $arNotify = $CIMNotify->GetUnreadNotify(array('SPEED_CHECK' => 'N', 'USE_TIME_ZONE' => 'N'));
         if ($arNotify['result']) {
             $arSend['NOTIFY'] = $arNotify['notify'];
             $arSend['UNREAD_NOTIFY'] = $arNotify['unreadNotify'];
             $arSend['FLASH_NOTIFY'] = CIMNotify::GetFlashNotify($arNotify['unreadNotify']);
             $arSend['ERROR'] = '';
             if ($arNotify['maxNotify'] > 0) {
                 $CIMNotify->MarkNotifyRead($arNotify['maxNotify'], true);
             }
         }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:im.ajax.php

示例3: foreach

    }
    foreach ($arTmpEventsNew as $key => $arTmpEvent) {
        if (!is_array($arPrevPageLogID) || !in_array($arTmpEvent["ID"], $arPrevPageLogID)) {
            $arTmpEventsNew[$key]["EVENT_ID_FULLSET"] = CSocNetLogTools::FindFullSetEventIDByEventID($arTmpEvent["EVENT_ID"]);
        } else {
            unset($arTmpEventsNew[$key]);
        }
    }
    $arResult["Events"] = $arTmpEventsNew;
    if ($arTmpEvent["DATE_FOLLOW"]) {
        $dateLastPage = ConvertTimeStamp(MakeTimeStamp($arTmpEvent["DATE_FOLLOW"], CSite::GetDateFormat("FULL")), "FULL");
    } elseif ($arParams["USE_FOLLOW"] == "N" && $arTmpEvent["LOG_UPDATE"]) {
        $dateLastPage = ConvertTimeStamp(MakeTimeStamp($arTmpEvent["LOG_UPDATE"], CSite::GetDateFormat("FULL")), "FULL");
    }
    if ($arParams["LOG_ID"] <= 0 && intval($arParams["NEW_LOG_ID"]) <= 0 && $GLOBALS["USER"]->IsAuthorized()) {
        $arCounters = CUserCounter::GetValues($GLOBALS["USER"]->GetID(), SITE_ID);
        if (isset($arCounters[$arResult["COUNTER_TYPE"]])) {
            $arResult["LOG_COUNTER"] = intval($arCounters[$arResult["COUNTER_TYPE"]]);
        } else {
            $bEmptyCounter = true;
            $arResult["LOG_COUNTER"] = 0;
        }
    }
    if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y" && (intval($arResult["LOG_COUNTER"]) > 0 || $bEmptyCounter)) {
        CUserCounter::ClearByUser($GLOBALS["USER"]->GetID(), array(SITE_ID, "**"), $arResult["COUNTER_TYPE"]);
    }
    if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_PAGE_CACHE"] == "Y" && $dateLastPage && (!$dateLastPageStart || $dateLastPageStart != $dateLastPage || $bNeedSetLogPage)) {
        CSocNetLogPages::Set($GLOBALS["USER"]->GetID(), $dateLastPage, $arParams["PAGE_SIZE"], $arResult["PAGE_NUMBER"], SITE_ID, strlen($arResult["COUNTER_TYPE"]) > 0 ? $arResult["COUNTER_TYPE"] : "**");
    }
} else {
    $rsCurrentUser = CUser::GetByID($GLOBALS["USER"]->GetID());
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例4: isset

	return;
else
	define("IM_COMPONENT_INIT", true);

if (intval($USER->GetID()) <= 0)
	return;

if (!CModule::IncludeModule('im'))
	return;

$arParams["DESKTOP"] = isset($arParams['DESKTOP']) && $arParams['DESKTOP'] == 'Y'? 'Y': 'N';

$arResult = Array();

// Counters
$arResult["COUNTERS"] = CUserCounter::GetValues($USER->GetID(), SITE_ID);

CIMContactList::SetOnline(null, true);

if ($arParams['DESKTOP'] == 'Y')
{
	$GLOBALS["APPLICATION"]->SetPageProperty("BodyClass", "im-desktop");
	CIMMessenger::SetDesktopStatusOnline();
}

$arParams["INIT"] = 'Y';
$arParams["DESKTOP_LINK_OPEN"] = 'N';

// Exchange
$arResult["PATH_TO_USER_MAIL"] = "";
$arResult["MAIL_COUNTER"] = 0;
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:component.php

示例5: GetValues

 public static function GetValues($site_id = SITE_ID, &$arLastDate = array())
 {
     return CUserCounter::GetValues(CUserCounter::SYSTEM_USER_ID, $site_id, $arLastDate);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:4,代码来源:global_counter.php

示例6: recountCounters_ORIGINATORS_WITHOUT_DEADLINES

 private static function recountCounters_ORIGINATORS_WITHOUT_DEADLINES($userId)
 {
     global $DB;
     $DB->startTransaction();
     // Count tasks without DEADLINES
     // not in states: CTasks::STATE_SUPPOSEDLY_COMPLETED, CTasks::STATE_COMPLETED, CTasks::STATE_DECLINED
     // and where CREATED_BY != RESPONSIBLE_ID.
     // Count tasks for originators.
     $strSql = "SELECT COUNT(T.ID) AS T_WO_DEADLINES, \n\t\t\t\tT.CREATED_BY AS CREATED_BY\n\t\t\tFROM b_tasks T\n\t\t\tWHERE \n\t\t\t\tT.ZOMBIE = 'N'\n\t\t\t\tAND T.CREATED_BY != T.RESPONSIBLE_ID\n\t\t\t\tAND T.CREATED_BY != 0\n\t\t\t\tAND T.RESPONSIBLE_ID != 0\n\t\t\t\tAND T.DEADLINE IS NULL\n\t\t\t\tAND T.STATUS != " . CTasks::STATE_DECLINED . "\n\t\t\t\tAND T.STATUS != " . CTasks::STATE_SUPPOSEDLY_COMPLETED . "\n\t\t\t\tAND T.STATUS != " . CTasks::STATE_COMPLETED . "\n\t\t\t";
     if ($userId !== '*') {
         // All users or not?
         $strSql .= " AND T.CREATED_BY = " . (int) $userId;
     }
     $strSql .= " GROUP BY T.CREATED_BY";
     $rc = $DB->query($strSql);
     $i = 0;
     while ($ar = $rc->fetch()) {
         $arValues = CUserCounter::GetValues($ar['CREATED_BY'], $site_id = '**');
         $total = 0;
         if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_TOTAL])) {
             $total = (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_TOTAL];
         }
         $subtotal = 0;
         if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR])) {
             $subtotal = (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR];
         }
         CUserCounter::Set((int) $ar['CREATED_BY'], CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR_WO_DEADLINE, (int) $ar['T_WO_DEADLINES'], '**', $tag = '', false);
         CUserCounter::Set((int) $ar['CREATED_BY'], CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR, $subtotal + (int) $ar['T_WO_DEADLINES'], '**', $tag = '', false);
         CUserCounter::Set((int) $ar['CREATED_BY'], CTaskCountersProcessor::COUNTER_TASKS_TOTAL, $total + (int) $ar['T_WO_DEADLINES'], '**', $tag = '', false);
         // commit on after every 100 users have been processed
         if (!(++$i % 100)) {
             soundex('commit every 100 users');
             $DB->commit();
             $DB->startTransaction();
         }
     }
     $DB->commit();
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:38,代码来源:countersprocessorinstaller.php

示例7: refreshTotalCounter

 private static function refreshTotalCounter($userId)
 {
     $arValues = CUserCounter::GetValues($userId, $site_id = '**');
     $total = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_TOTAL])) {
         $total = (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_TOTAL];
     }
     $my = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_MY])) {
         $my = (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_MY];
     }
     $accomplice = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE])) {
         $accomplice = (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE];
     }
     $auditor = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_AUDITOR])) {
         $auditor = (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_AUDITOR];
     }
     $originator = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR])) {
         $originator = (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR];
     }
     // Responsible's real counters:
     $realMy = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_NEW])) {
         $realMy += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_NEW];
     }
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_EXPIRED])) {
         $realMy += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_EXPIRED];
     }
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_WO_DEADLINE])) {
         $realMy += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_WO_DEADLINE];
     }
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_EXPIRED_CANDIDATES])) {
         $realMy += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_MY_EXPIRED_CANDIDATES];
     }
     // Accomplices' real counters:
     $realAccomplice = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE_NEW])) {
         $realAccomplice += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE_NEW];
     }
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE_EXPIRED])) {
         $realAccomplice += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE_EXPIRED];
     }
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE_EXPIRED_CANDIDATES])) {
         $realAccomplice += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE_EXPIRED_CANDIDATES];
     }
     // Originator's real counters:
     $realOriginator = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR_WO_DEADLINE])) {
         $realOriginator += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR_WO_DEADLINE];
     }
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR_EXPIRED])) {
         $realOriginator += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR_EXPIRED];
     }
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR_WAIT_CTRL])) {
         $realOriginator += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR_WAIT_CTRL];
     }
     // Auditors' real counters:
     $realAuditor = 0;
     if (isset($arValues[CTaskCountersProcessor::COUNTER_TASKS_AUDITOR_EXPIRED])) {
         $realAuditor += (int) $arValues[CTaskCountersProcessor::COUNTER_TASKS_AUDITOR_EXPIRED];
     }
     // Total:
     $realTotal = $realMy + $realAccomplice + $realOriginator + $realAuditor;
     if ($realTotal != $total) {
         //$s = '[USER_ID= ' . $userId . '] update master counter to: ' . $realTotal;
         //soundex($s);
         CUserCounter::Increment($userId, CTaskCountersProcessor::COUNTER_TASKS_TOTAL, $site_id = '**', $sendPull = true, $realTotal - $total);
     }
     if ($realMy != $my) {
         CUserCounter::Increment($userId, CTaskCountersProcessor::COUNTER_TASKS_MY, $site_id = '**', $sendPull = true, $realMy - $my);
     }
     if ($realOriginator != $originator) {
         CUserCounter::Increment($userId, CTaskCountersProcessor::COUNTER_TASKS_ORIGINATOR, $site_id = '**', $sendPull = true, $realOriginator - $originator);
     }
     if ($realAccomplice != $accomplice) {
         CUserCounter::Increment($userId, CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE, $site_id = '**', $sendPull = true, $realAccomplice - $accomplice);
     }
     if ($realAuditor != $auditor) {
         CUserCounter::Increment($userId, CTaskCountersProcessor::COUNTER_TASKS_AUDITOR, $site_id = '**', $sendPull = true, $realAuditor - $auditor);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:84,代码来源:countersprocessor.php


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