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


PHP CUserCounter::IncrementWithSelect方法代码示例

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


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

示例1: CounterIncrement

	public static function CounterIncrement($log_id, $event_id = false, $arOfEntities = false, $type = "L")
	{
		if (intval($log_id) <= 0)
			return false;

		CUserCounter::IncrementWithSelect(
			CSocNetLogCounter::GetSubSelect(
				$log_id, false, false, false, false,
				$arOfEntities, false, false, "Y", $type
			)
		);

		if ($event_id == "blog_post_important")
		{
			CUserCounter::IncrementWithSelect(
				CSocNetLogCounter::GetSubSelect(
					$log_id, false, false, false, false,
					$arOfEntities, false, false, "Y", "L",
					array("CODE" => "'BLOG_POST_IMPORTANT'")
				)
			);
		}
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:23,代码来源:log.php

示例2: SendEvent


//.........这里部分代码省略.........
             }
             $intranet_site_id = CSite::GetDefSite();
         }
         $arIntranetUsers = CExtranet::GetIntranetUsers();
         $extranet_site_id = CExtranet::GetExtranetSiteID();
     }
     $dbSubscribers = CSocNetLogEvents::GetList(array("TRANSPORT" => "DESC"), array("USER_ACTIVE" => "Y", "SITE_ID" => array_merge($arLogSites, array(false))), false, false, array("USER_ID", "ENTITY_TYPE", "ENTITY_ID", "ENTITY_CB", "ENTITY_MY", "USER_NAME", "USER_LAST_NAME", "USER_LOGIN", "USER_LID", "USER_EMAIL", "TRANSPORT"), $arListParams);
     $arListParams = array("USE_SUBSCRIBE" => "Y", "ENTITY_TYPE" => $arLogComment["ENTITY_TYPE"], "ENTITY_ID" => $arLogComment["ENTITY_ID"], "EVENT_ID" => $arLogComment["EVENT_ID"], "USER_ID" => $arLogComment["USER_ID"], "OF_ENTITIES" => $arOfEntities, "TRANSPORT" => "N");
     $dbUnSubscribers = CSocNetLogEvents::GetList(array("TRANSPORT" => "DESC"), array("USER_ACTIVE" => "Y", "SITE_ID" => array_merge($arLogSites, array(false))), false, false, array("USER_ID", "SITE_ID", "ENTITY_TYPE", "ENTITY_ID", "ENTITY_CB", "ENTITY_MY", "TRANSPORT", "EVENT_ID"), $arListParams);
     $arUnSubscribers = array();
     while ($arUnSubscriber = $dbUnSubscribers->Fetch()) {
         $arUnSubscribers[] = $arUnSubscriber["USER_ID"] . "_" . $arUnSubscriber["ENTITY_TYPE"] . "_" . $arUnSubscriber["ENTITY_ID"] . "_" . $arUnSubscriber["ENTITY_MY"] . "_" . $arUnSubscriber["ENTITY_CB"] . "_" . $arUnSubscriber["EVENT_ID"];
     }
     $bHasAccessAll = CSocNetLogRights::CheckForUserAll($arLog["ID"] ? $arLog["ID"] : $arLogComment["LOG_ID"]);
     $arSentUserID = array("M" => array(), "X" => array());
     while ($arSubscriber = $dbSubscribers->Fetch()) {
         if (is_array($arIntranetUsers) && !in_array($arSubscriber["USER_ID"], $arIntranetUsers) && !in_array($extranet_site_id, $arLogSites)) {
             continue;
         }
         if (array_key_exists($arSubscriber["TRANSPORT"], $arSentUserID) && in_array($arSubscriber["USER_ID"], $arSentUserID[$arSubscriber["TRANSPORT"]])) {
             continue;
         }
         if (intval($arSubscriber["ENTITY_ID"]) != 0 && $arSubscriber["EVENT_ID"] == "all" && (in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arSubscriber["ENTITY_ID"] . "_N_" . $arSubscriber["ENTITY_CB"] . "_" . $arLogComment["EVENT_ID"], $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arSubscriber["ENTITY_ID"] . "_Y_" . $arSubscriber["ENTITY_CB"] . "_" . $arLogComment["EVENT_ID"], $arUnSubscribers))) {
             continue;
         } elseif (intval($arSubscriber["ENTITY_ID"]) == 0 && $arSubscriber["ENTITY_CB"] == "N" && $arSubscriber["EVENT_ID"] != "all" && (in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_Y_N_all", $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_N_N_all", $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_Y_N_" . $arLogComment["EVENT_ID"], $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_N_N_" . $arLogComment["EVENT_ID"], $arUnSubscribers))) {
             continue;
         }
         $arSentUserID[$arSubscriber["TRANSPORT"]][] = $arSubscriber["USER_ID"];
         if (!$bHasAccessAll) {
             $bHasAccess = CSocNetLogRights::CheckForUserOnly($arLog["ID"] ? $arLog["ID"] : $arLogComment["LOG_ID"], $arSubscriber["USER_ID"]);
             if (!$bHasAccess) {
                 continue;
             }
         }
         if ($arLogComment["ENTITY_TYPE"] == SONET_ENTITY_GROUP && is_array($arIntranetUsers) && CModule::IncludeModule("extranet")) {
             $server_name = $arSites[!in_array($arSubscriber["USER_ID"], $arIntranetUsers) && $extranet_site_id ? $extranet_site_id : $intranet_site_id]["SERVER_NAME"];
             $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"] = str_replace(array("#SERVER_NAME#", "#GROUPS_PATH#"), array($server_name, COption::GetOptionString("socialnetwork", "workgroups_page", false, !in_array($arSubscriber["USER_ID"], $arIntranetUsers) && $extranet_site_id ? $extranet_site_id : $intranet_site_id)), $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL"]);
         } else {
             $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"] = $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL"];
         }
         switch ($arSubscriber["TRANSPORT"]) {
             case "X":
                 if (array_key_exists("URL_TO_SEND", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && strlen($arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"]) > 0) {
                     $link = GetMessage("SONET_GLC_SEND_EVENT_LINK") . $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"];
                 } else {
                     $link = "";
                 }
                 $arMessageFields = array("FROM_USER_ID" => intval($arLogComment["USER_ID"]) > 0 ? $arLogComment["USER_ID"] : 1, "TO_USER_ID" => $arSubscriber["USER_ID"], "MESSAGE" => $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["TITLE"] . " #BR# " . $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"] . (strlen($link) > 0 ? "#BR# " . $link : ""), "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE_TYPE" => SONET_MESSAGE_SYSTEM, "IS_LOG" => "Y");
                 CSocNetMessages::Add($arMessageFields);
                 break;
             case "M":
                 $arFields["SUBSCRIBER_ID"] = $arSubscriber["USER_ID"];
                 $arFields["SUBSCRIBER_NAME"] = $arSubscriber["USER_NAME"];
                 $arFields["SUBSCRIBER_LAST_NAME"] = $arSubscriber["USER_LAST_NAME"];
                 $arFields["SUBSCRIBER_LOGIN"] = $arSubscriber["USER_LOGIN"];
                 $arFields["SUBSCRIBER_EMAIL"] = $arSubscriber["USER_EMAIL"];
                 $arFields["EMAIL_TO"] = $arSubscriber["USER_EMAIL"];
                 $arFields["TITLE"] = str_replace("#BR#", "\n", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["TITLE"]);
                 $arFields["MESSAGE"] = str_replace("#BR#", "\n", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"]);
                 $arFields["ENTITY"] = $arLogComment["FIELDS_FORMATTED"]["ENTITY"]["FORMATTED"];
                 $arFields["ENTITY_TYPE"] = $arLogComment["FIELDS_FORMATTED"]["ENTITY"]["TYPE_MAIL"];
                 if (array_key_exists("URL_TO_SEND", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && strlen($arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"]) > 0) {
                     $arFields["URL"] = $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"];
                 } else {
                     $arFields["URL"] = $arLogComment["URL"];
                 }
                 if (CModule::IncludeModule("extranet")) {
                     $arUserGroup = CUser::GetUserGroup($arSubscriber["USER_ID"]);
                 }
                 foreach ($arLogSites as $site_id_tmp) {
                     if (IsModuleInstalled("extranet")) {
                         if (CExtranet::IsExtranetSite($site_id_tmp) && in_array(CExtranet::GetExtranetUserGroupID(), $arUserGroup) || !CExtranet::IsExtranetSite($site_id_tmp) && !in_array(CExtranet::GetExtranetUserGroupID(), $arUserGroup)) {
                             $siteID = $site_id_tmp;
                             break;
                         } else {
                             continue;
                         }
                     } else {
                         $siteID = $site_id_tmp;
                         break;
                     }
                 }
                 if (!$siteID) {
                     $siteID = defined("SITE_ID") ? SITE_ID : $arSubscriber["SITE_ID"];
                 }
                 if (StrLen($siteID) <= 0) {
                     $siteID = $arSubscriber["USER_LID"];
                 }
                 if (StrLen($siteID) <= 0) {
                     continue;
                 }
                 $event = new CEvent();
                 $event->Send($mailTemplate, $siteID, $arFields, "N");
                 break;
             default:
         }
     }
     CUserCounter::IncrementWithSelect(CSocNetLogCounter::GetSubSelect($arLog["ID"], $arLog["ENTITY_TYPE"], $arLog["ENTITY_ID"], $arLogComment["EVENT_ID"], $arLogComment["USER_ID"], $arOfEntities, false, false, "Y", "LC"));
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:log_comments.php

示例3: MessageUpdate

 public static function MessageUpdate($REPORT_ID, $arReport = array(), $arFields = array())
 {
     global $DB, $USER;
     $curUser = $USER->GetID();
     if (CModule::IncludeModule("socialnetwork")) {
         $dbLog = CSocNetLog::GetList(array(), array("SOURCE_ID" => $REPORT_ID, "EVENT_ID" => "report"));
         if (!($arLog = $dbLog->Fetch())) {
             $LOG_ID = CReportNotifications::SendMessage($REPORT_ID, false);
         } else {
             $LOG_ID = $arLog["ID"];
             CSocNetLog::Update($LOG_ID, array("USER_ID" => $curUser, "=LOG_DATE" => $DB->CurrentTimeFunction(), "=LOG_UPDATE" => $DB->CurrentTimeFunction()));
             CUserCounter::IncrementWithSelect(CSocNetLogCounter::GetSubSelect($LOG_ID, $arLog["ENTITY_TYPE"], $arLog["ENTITY_ID"], $arLog["EVENT_ID"], $arLog["USER_ID"]));
         }
         if (CModule::IncludeModule("im") && is_array($arFields) && is_array($arReport) && intval($arReport["USER_ID"]) > 0 && $arReport["USER_ID"] != $curUser) {
             $date_text = "";
             $date_from = FormatDate("j F", MakeTimeStamp($arReport["DATE_FROM"], CSite::GetDateFormat("FULL", SITE_ID)));
             $date_to = FormatDate("j F", MakeTimeStamp($arReport["DATE_TO"], CSite::GetDateFormat("FULL", SITE_ID)));
             if ($date_from == $date_to) {
                 $date_text = $date_to;
             } else {
                 $date_text = $date_from . " - " . $date_to;
             }
             $arMessageFields = array("MESSAGE_TYPE" => IM_MESSAGE_SYSTEM, "TO_USER_ID" => $arReport["USER_ID"], "FROM_USER_ID" => $curUser, "NOTIFY_TYPE" => IM_NOTIFY_FROM, "NOTIFY_MODULE" => "timeman", "NOTIFY_EVENT" => "report_approve", "NOTIFY_TAG" => "TIMEMAN|REPORT|" . $arReport["ID"] . "_" . $arFields["MARK"]);
             $gender_suffix = "";
             $dbUser = CUser::GetByID($curUser);
             if ($arUser = $dbUser->Fetch()) {
                 switch ($arUser["PERSONAL_GENDER"]) {
                     case "M":
                         $gender_suffix = "_M";
                         break;
                     case "F":
                         $gender_suffix = "_F";
                         break;
                     default:
                         $gender_suffix = "";
                 }
             }
             $reports_page = COption::GetOptionString("timeman", "WORK_REPORT_PATH", "/company/work_report.php");
             $arTmp = CSocNetLogTools::ProcessPath(array("REPORTS_PAGE" => $reports_page), $arReport["USER_ID"]);
             switch ($arFields["MARK"]) {
                 case "G":
                     $mark = "G";
                     break;
                 case "B":
                     $mark = "B";
                     break;
                 case "X":
                     $mark = "X";
                     break;
                 default:
                     $mark = "N";
             }
             $arMessageFields["NOTIFY_MESSAGE"] = GetMessage("REPORT_FULL_IM_APPROVE" . $gender_suffix . "_" . $mark, array("#period#" => "<a href=\"" . $arTmp["URLS"]["REPORTS_PAGE"] . "#user_id=" . $arReport["USER_ID"] . "&report=" . $REPORT_ID . "\" class=\"bx-notifier-item-action\">" . htmlspecialcharsbx($date_text) . "</a>"));
             $arMessageFields["NOTIFY_MESSAGE_OUT"] = GetMessage("REPORT_FULL_IM_APPROVE" . $gender_suffix . "_" . $mark, array("#period#" => htmlspecialcharsbx($date_text))) . " ( " . $arTmp["SERVER_NAME"] . $arTmp["URLS"]["REPORTS_PAGE"] . "#user_id=" . $arReport["USER_ID"] . "&report=" . $REPORT_ID . " )";
             CIMNotify::Add($arMessageFields);
         }
         $dbLogRights = CSocNetLogRights::GetList(array(), array("LOG_ID" => $LOG_ID));
         while ($arRight = $dbLogRights->Fetch()) {
             $arRights[] = $arRight["GROUP_CODE"];
         }
         if (!in_array("U" . $curUser, $arRights)) {
             CSocNetLogRights::Add($LOG_ID, "U" . $curUser);
         }
         return $LOG_ID;
     } else {
         return false;
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:68,代码来源:timeman_report_full.php

示例4: CounterIncrement

 public static function CounterIncrement($arLogFields)
 {
     CUserCounter::IncrementWithSelect(CCrmLiveFeed::GetSubSelect($arLogFields));
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:livefeed.php

示例5: CounterDecrement

 public static function CounterDecrement($log_id, $event_id = false, $type = "L", $bForAllAccess = false)
 {
     if (intval($log_id) <= 0) {
         return false;
     }
     CUserCounter::IncrementWithSelect(CSocNetLogCounter::GetSubSelect2($log_id, array("TYPE" => $type, "DECREMENT" => true, "FOR_ALL_ACCESS" => $bForAllAccess)));
     if ($event_id == "blog_post_important") {
         CUserCounter::IncrementWithSelect(CSocNetLogCounter::GetSubSelect2($log_id, array("TYPE" => "L", "CODE" => "'BLOG_POST_IMPORTANT'", "DECREMENT" => true, "FOR_ALL_ACCESS" => $bForAllAccess)));
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:10,代码来源:log.php

示例6: IncrementWithSelect

 public static function IncrementWithSelect($sub_select, $sendPull = true, $arParams = array())
 {
     return CUserCounter::IncrementWithSelect($sub_select, $sendPull, $arParams);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:4,代码来源:global_counter.php


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