本文整理汇总了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);
示例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),