當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRatings::Delete方法代碼示例

本文整理匯總了PHP中CRatings::Delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRatings::Delete方法的具體用法?PHP CRatings::Delete怎麽用?PHP CRatings::Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRatings的用法示例。


在下文中一共展示了CRatings::Delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

         $ratingId = $arRes['ID'];
     }
 }
 if ($ratingId == false) {
     $arConfig = array();
     $arConfig['MAIN'] = array('RATING' => array('BONUS' => array('ACTIVE' => 'Y', 'COEFFICIENT' => '1')));
     $arConfig['FORUM'] = array('VOTE' => array('TOPIC' => array('ACTIVE' => 'Y', 'COEFFICIENT' => '0.5', 'LIMIT' => '30'), 'POST' => array('ACTIVE' => 'Y', 'COEFFICIENT' => '0.1', 'LIMIT' => '30')), 'RATING' => array('ACTIVITY' => array('ACTIVE' => 'Y', 'TODAY_TOPIC_COEF' => '0.4', 'WEEK_TOPIC_COEF' => '0.2', 'MONTH_TOPIC_COEF' => '0.1', 'ALL_TOPIC_COEF' => '0', 'TODAY_POST_COEF' => '0.2', 'WEEK_POST_COEF' => '0.1', 'MONTH_POST_COEF' => '0.05', 'ALL_POST_COEF' => '0')));
     $arConfig['BLOG'] = array('VOTE' => array('POST' => array('ACTIVE' => 'Y', 'COEFFICIENT' => '1', 'LIMIT' => '30'), 'COMMENT' => array('ACTIVE' => 'Y', 'COEFFICIENT' => '1', 'LIMIT' => '30')), 'RATING' => array('ACTIVITY' => array('ACTIVE' => 'Y', 'TODAY_POST_COEF' => '0.4', 'WEEK_POST_COEF' => '0.2', 'MONTH_POST_COEF' => '0.1', 'ALL_POST_COEF' => '0', 'TODAY_COMMENT_COEF' => '0.2', 'WEEK_COMMENT_COEF' => '0.1', 'MONTH_COMMENT_COEF' => '0.05', 'ALL_COMMENT_COEF' => '0')));
     $arAddRating = array('ACTIVE' => 'Y', 'NAME' => GetMessage('MAIN_RATING_NAME'), 'ENTITY_ID' => 'USER', 'CALCULATION_METHOD' => 'SUM', 'POSITION' => 'Y', 'AUTHORITY' => 'N', 'CONFIGS' => $arConfig);
     $ratingId = CRatings::Add($arAddRating);
 }
 $authorityId = false;
 $rsData = CRatings::GetList(array('ID' => 'ASC'), array('AUTHORITY' => 'Y'));
 if ($arRes = $rsData->Fetch()) {
     if ($arRes['ACTIVE'] == 'N') {
         CRatings::Delete($arRes['ID']);
     } else {
         $authorityId = $arRes['ID'];
     }
 }
 if ($authorityId == false) {
     $arConfig = array();
     $arConfig['MAIN'] = array('VOTE' => array('USER' => array('ACTIVE' => 'Y', 'COEFFICIENT' => '1', 'LIMIT' => '30')), 'RATING' => array('BONUS' => array('ACTIVE' => 'Y', 'COEFFICIENT' => '1')));
     $arAddRating = array('ACTIVE' => 'Y', 'NAME' => GetMessage('MAIN_RATING_AUTHORITY'), 'ENTITY_ID' => 'USER', 'CALCULATION_METHOD' => 'SUM', 'POSITION' => 'Y', 'AUTHORITY' => 'Y', 'CONFIGS' => $arConfig);
     $authorityId = CRatings::Add($arAddRating);
 }
 $strSql = "\n\t\t\tINSERT INTO b_rating_user (ENTITY_ID, RATING_ID)\n\t\t\tSELECT \n\t\t\t\tu.ID, '{$authorityId}'\n\t\t\tFROM \n\t\t\t\tb_user u \n\t\t\t\tLEFT JOIN b_rating_user ru ON ru.RATING_ID = {$authorityId} AND ru.ENTITY_ID = u.ID \n\t\t\tWHERE \n\t\t\t\tru.ENTITY_ID IS NULL";
 $DB->Query($strSql, false, $err_mess . __LINE__);
 $arParams = array();
 $arParams['DEFAULT_CONFIG_NEW_USER'] = 'Y';
 CRatings::SetAuthorityDefaultValue($arParams);
開發者ID:webgksupport,項目名稱:alpina,代碼行數:31,代碼來源:rating.php

示例2: IntVal

			$arID[] = $arRes['ID'];
	}

	foreach($arID as $ID)
	{
		$ID = IntVal($ID);
		if($ID <= 0)
			continue;
		switch($_REQUEST['action'])
		{
			case "recalculate":
				if(!CRatings::Calculate($ID, true))
					$lAdmin->AddGroupError(GetMessage("RATING_LIST_ERR_CAL"), $ID);
			break;
			case "delete":
				if(!CRatings::Delete($ID))
					$lAdmin->AddGroupError(GetMessage("RATING_LIST_ERR_DEL"), $ID);
			break;
		}
	}
}

$rsData = CRatings::GetList(array($by=>$order), $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("RATING_LIST_NAV")));

$aHeaders = array(
	array("id"=>"ID", "content"=>"ID", "sort"=>"id", "default"=>true),
	array("id"=>"NAME", "content"=>GetMessage("RATING_NAME"), "sort"=>"name", "default"=>true),
	array("id"=>"ACTIVE", "content"=>GetMessage("RATING_ACTIVE"), "sort"=>"active", "default"=>true),	
開發者ID:ASDAFF,項目名稱:open_bx,代碼行數:31,代碼來源:rating_list.php


注:本文中的CRatings::Delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。