本文整理匯總了PHP中CUserCounter::addValueToPullMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP CUserCounter::addValueToPullMessage方法的具體用法?PHP CUserCounter::addValueToPullMessage怎麽用?PHP CUserCounter::addValueToPullMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CUserCounter
的用法示例。
在下文中一共展示了CUserCounter::addValueToPullMessage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DeleteByCode
public static function DeleteByCode($code)
{
global $DB, $APPLICATION, $CACHE_MANAGER;
if (strlen($code) <= 0) {
return false;
}
$pullMessage = array();
$bPullEnabled = false;
if (self::CheckLiveMode()) {
$db_lock = $DB->Query("SELECT GET_LOCK('" . $APPLICATION->GetServerUniqID() . "_pull', 0) as L");
$ar_lock = $db_lock->Fetch();
if ($ar_lock["L"] > 0) {
$bPullEnabled = true;
$arSites = array();
$res = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y"));
while ($row = $res->Fetch()) {
$arSites[] = $row['ID'];
}
$strSQL = "\n\t\t\t\t\tSELECT distinct pc.CHANNEL_ID, uc.USER_ID, uc.SITE_ID, uc.CODE, uc.CNT\n\t\t\t\t\tFROM b_user_counter uc\n\t\t\t\t\tINNER JOIN b_pull_channel pc ON pc.USER_ID = uc.USER_ID\n\t\t\t\t\tWHERE uc.CODE LIKE '**%'\n\t\t\t\t";
$res = $DB->Query($strSQL, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
while ($row = $res->Fetch()) {
if ($row["CODE"] == $code) {
continue;
}
CUserCounter::addValueToPullMessage($row, $arSites, $pullMessage);
}
}
}
$DB->Query("DELETE FROM b_user_counter WHERE CODE = '" . $code . "'", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
self::$counters = false;
$CACHE_MANAGER->CleanDir("user_counter");
if ($bPullEnabled) {
$DB->Query("SELECT RELEASE_LOCK('" . $APPLICATION->GetServerUniqID() . "_pull')");
}
foreach ($pullMessage as $channelId => $arMessage) {
CPullStack::AddByChannel($channelId, array('module_id' => 'main', 'command' => 'user_counter', 'params' => $arMessage));
}
}