本文整理汇总了PHP中CRatings::GetRatingResult方法的典型用法代码示例。如果您正苦于以下问题:PHP CRatings::GetRatingResult方法的具体用法?PHP CRatings::GetRatingResult怎么用?PHP CRatings::GetRatingResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRatings
的用法示例。
在下文中一共展示了CRatings::GetRatingResult方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arRatingResult = array();
$arRatingVote = array();
if ($arParams["SHOW_RATING"] == 'Y') {
$tmp = !empty($arResult["MESSAGE_FIRST"]) ? $arResult["MESSAGE_FIRST"] + $arResult["MESSAGE_LIST"] : $arResult["MESSAGE_LIST"];
foreach ($tmp as $res) {
$arAuthorId[] = $res['AUTHOR_ID'];
if ($res['NEW_TOPIC'] == "Y") {
$arTopicId[] = $res['TOPIC_ID'];
} else {
$arPostId[] = $res['ID'];
}
}
if (!empty($arAuthorId)) {
foreach ($arParams["RATING_ID"] as $key => $ratingId) {
$arParams["RATING_ID"][$key] = intval($ratingId);
$arRatingResult[$arParams["RATING_ID"][$key]] = CRatings::GetRatingResult($arParams["RATING_ID"][$key], array_unique($arAuthorId));
}
}
if (!empty($arPostId)) {
$arRatingVote['FORUM_POST'] = CRatings::GetRatingVoteResult('FORUM_POST', $arPostId);
}
if (!empty($arTopicId)) {
$arRatingVote['FORUM_TOPIC'] = CRatings::GetRatingVoteResult('FORUM_TOPIC', $arTopicId);
}
}
/*************** Default data **************************************/
if (!empty($arResult["ERROR_MESSAGE"])) {
?>
<div class="forum-note-box forum-note-error">
<div class="forum-note-box-text"><?php
echo ShowError($arResult["ERROR_MESSAGE"], "forum-note-error");
示例2: array
$arComment["urlToBind"] = $APPLICATION->GetCurPageParam("bind_comment_id=" . $arComment["ID"], $arRemoveUriParams);
}
if ($arResult["IDEA_MODERATOR"] && $arResult["Perm"] >= BLOG_PERMS_FULL) {
$arComment["urlToUnBind"] = $APPLICATION->GetCurPageParam("unbind_comment_id=" . $arComment["ID"], $arRemoveUriParams);
}
}
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y");
if (COption::GetOptionString("blog", "allow_video", "Y") != "Y" || $arParams["ALLOW_VIDEO"] != "Y") {
$arAllow["VIDEO"] = "N";
}
if ($arParams["NO_URL_IN_COMMENTS"] == "L" || IntVal($arComment["AUTHOR_ID"]) <= 0 && $arParams["NO_URL_IN_COMMENTS"] == "A") {
$arAllow["CUT_ANCHOR"] = "Y";
}
if ($arParams["NO_URL_IN_COMMENTS_AUTHORITY_CHECK"] == "Y" && $arAllow["CUT_ANCHOR"] != "Y" && IntVal($arComment["AUTHOR_ID"]) > 0) {
$authorityRatingId = CRatings::GetAuthorityRating();
$arRatingResult = CRatings::GetRatingResult($authorityRatingId, $arComment["AUTHOR_ID"]);
if ($arRatingResult["CURRENT_VALUE"] < $arParams["NO_URL_IN_COMMENTS_AUTHORITY"]) {
$arAllow["CUT_ANCHOR"] = "Y";
}
}
$arComment["TextFormated"] = $p->convert($arComment["~POST_TEXT"], false, array(), $arAllow, $arParserParams);
$arComment["DateFormated"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arComment["DATE_CREATE"], CSite::GetDateFormat("FULL")));
if ($bUseTitle) {
if (strlen($arComment["TITLE"]) > 0) {
$arComment["TitleFormated"] = $p->convert($arComment["TITLE"], false);
}
if (strpos($arComment["TITLE"], "RE") === false) {
$subj = "RE: " . $arComment["TITLE"];
} else {
if (strpos($arComment["TITLE"], "RE") == 0) {
if (strpos($arComment["TITLE"], "RE:") !== false) {
示例3: BuildRSS
//.........这里部分代码省略.........
$dbImages = CBlogImage::GetList(Array(), Array("BLOG_ID" => $blogID, "POST_ID" => $postID, "IS_COMMENT" => "Y", "!COMMENT_ID" => false));
while($arI = $dbImages->Fetch())
$arImages[$arI["ID"]] = $arI["FILE_ID"];
while ($arComments = $dbComments->Fetch())
{
$arDate = ParseDateTime($arComments["DATE_CREATE"], CSite::GetDateFormat("FULL", $arGroup["SITE_ID"]));
$date = date("r", mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
if(strpos($url, "?") !== false)
$url1 = $url."&";
else
$url1 = $url."?";
$url1 .= "commentId=".$arComments["ID"]."#".$arComments["ID"];
$authorURL = "";
if(IntVal($arComments["AUTHOR_ID"]) > 0)
{
$author = CBlogUser::GetUserName($arComments["BLOG_USER_ALIAS"], $arComments["USER_NAME"], $arComments["USER_LAST_NAME"], $arComments["USER_LOGIN"], $arComments["USER_SECOND_NAME"]);
if(strLen($arPathTemplate["PATH_TO_USER"])>0)
$authorURL = htmlspecialcharsbx("http://".$serverName.CComponentEngine::MakePathFromTemplate($arPathTemplate["PATH_TO_USER"], array("user_id"=>$arComments["AUTHOR_ID"])));
else
$authorURL = htmlspecialcharsbx("http://".$serverName.CBlogUser::PreparePath($arComments["AUTHOR_ID"], $arGroup["SITE_ID"]));
}
else
$author = $arComments["AUTHOR_NAME"];
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "TABLE" => "Y", "CUT_ANCHOR" => "N");
if($arPathTemplate["NO_URL_IN_COMMENTS"] == "L" || (IntVal($arComments["AUTHOR_ID"]) <= 0 && $arPathTemplate["NO_URL_IN_COMMENTS"] == "A"))
$arAllow["CUT_ANCHOR"] = "Y";
if($arPathTemplate["NO_URL_IN_COMMENTS_AUTHORITY_CHECK"] == "Y" && $arAllow["CUT_ANCHOR"] != "Y" && IntVal($arComments["AUTHOR_ID"]) > 0)
{
$authorityRatingId = CRatings::GetAuthorityRating();
$arRatingResult = CRatings::GetRatingResult($authorityRatingId, $arComments["AUTHOR_ID"]);
if($arRatingResult["CURRENT_VALUE"] < $arPathTemplate["NO_URL_IN_COMMENTS_AUTHORITY"])
$arAllow["CUT_ANCHOR"] = "Y";
}
$text = $parser->convert_to_rss($arComments["POST_TEXT"], $arImages, $arAllow, false, $arParserParams);
$title = GetMessage("BLG_GCM_COMMENT_TITLE", Array("#POST_TITLE#" => htmlspecialcharsEx($arPost["TITLE"]), "#COMMENT_AUTHOR#" => htmlspecialcharsEx($author)));
/*$title = str_replace(
array("&", "<", ">", "\""),
array("&", "<", ">", """),
$title);
*/
//$text1 = HTMLToTxt($text, "", Array("\ "), 60);
$text = "<![CDATA[".$text."]]>";
if ($type == "rss.92")
{
$rssText .= " <item>\n";
$rssText .= " <title>".$title."</title>\n";
$rssText .= " <description>".$text."</description>\n";
$rssText .= " <link>".$url1."</link>\n";
$rssText .= " </item>\n";
$rssText .= "\n";
}
elseif ($type == "rss2.0")
{
$rssText .= " <item>\n";
$rssText .= " <title>".$title."</title>\n";
$rssText .= " <description>".$text."</description>\n";
$rssText .= " <link>".$url1."</link>\n";
$rssText .= " <guid>".$url1."</guid>\n";
示例4: elseif
} elseif ($arResult['PROGRESS_POSITION'] < 0) {
$arResult['PROGRESS_POSITION'] = $arResult['CURRENT_POSITION'] - $arResult['PREVIOUS_POSITION'];
$arResult['PROGRESS_POSITION_DIRECT'] = 'down';
} else {
$arResult['PROGRESS_POSITION_DIRECT'] = 'unchanged';
}
} else {
$arResult['RESULT_TYPE'] = 'VALUE';
if (isset($arParams['CURRENT_VALUE'])) {
$arResult["CURRENT_VALUE"] = floatval($arParams["CURRENT_VALUE"]);
}
if (isset($arParams['PREVIOUS_VALUE'])) {
$arResult["PREVIOUS_VALUE"] = floatval($arParams["PREVIOUS_VALUE"]);
}
if (!isset($arParams['CURRENT_VALUE']) || !isset($arParams['PREVIOUS_VALUE'])) {
$arComponentRatingResult = CRatings::GetRatingResult($arParams["RATING_ID"], $arParams['ENTITY_ID']);
$arResult['CURRENT_VALUE'] = array_key_exists('CURRENT_VALUE', $arComponentRatingResult) ? $arComponentRatingResult['CURRENT_VALUE'] : 0;
$arResult['PREVIOUS_VALUE'] = array_key_exists('PREVIOUS_VALUE', $arComponentRatingResult) ? $arComponentRatingResult['PREVIOUS_VALUE'] : 0;
}
if (isset($arParams['PROGRESS_VALUE'])) {
$arResult['PROGRESS_VALUE'] = $arParams['PROGRESS_VALUE'];
} else {
$arResult['PROGRESS_VALUE'] = $arResult['CURRENT_VALUE'] - $arResult['PREVIOUS_VALUE'];
$arResult['PROGRESS_VALUE'] = round($arResult['PROGRESS_VALUE'], 2);
$arResult['PROGRESS_VALUE'] = $arResult['PROGRESS_VALUE'] > 0 ? "+" . $arResult['PROGRESS_VALUE'] : $arResult['PROGRESS_VALUE'];
}
if (isset($arParams['ROUND_CURRENT_VALUE'])) {
$arResult['ROUND_CURRENT_VALUE'] = $arParams['ROUND_CURRENT_VALUE'];
} else {
$arResult['ROUND_CURRENT_VALUE'] = round($arResult['CURRENT_VALUE']) == 0 ? 0 : round($arResult['CURRENT_VALUE']);
}
示例5: in_array
$bUpdate = true;
elseif ($_REQUEST["value"] != "hide" && in_array($_REQUEST["option"], $arUserOptions["hide"])):
$key = intVal(array_search($_REQUEST["option"], $arUserOptions["hide"]));
unset($arUserOptions["hide"][$key]);
$bUpdate = true;
endif;
if ($bUpdate):
CUserOptions::SetOption("forum", "profile", serialize($arUserOptions), false, $arParams["UID"]);
endif;
$arResult["USER"]["SHOW_PANELS"][$_REQUEST["option"]] = ($_REQUEST["value"] == "hide" ? "N" : "Y");
endif;
if ($arParams["SHOW_RATING"] == 'Y')
{
$authorId = intval($arParams["UID"]);
$arRatingResult = CRatings::GetRatingResult($arParams["RATING_ID"], $authorId);
$arRatingVote = CRatings::GetRatingVoteResult('USER', $authorId);
}
$bShowedInfo = false;
?><script type="text/javascript">
function forumAddSessid(el)
{
if (!!el || !!el.href) { el.href += (el.href.indexOf("?") > 0 ? "&" : "?") + 'sessid=' + BX.bitrix_sessid(); }
return true;
}
</script>
<?
/*******************************************************************/
if (!empty($arResult["ERROR_MESSAGE"])):
?>
示例6: GetUserRank
public static function GetUserRank($USER_ID, $strLang = false)
{
$USER_ID = intval($USER_ID);
$arUser = false;
if ($USER_ID <= 0) {
return false;
}
if (COption::GetOptionString("forum", "SHOW_VOTES", "Y") == "Y") {
$arUser = CForumUser::GetByUSER_ID($USER_ID);
} else {
$authorityRatingId = CRatings::GetAuthorityRating();
$arRatingResult = CRatings::GetRatingResult($authorityRatingId, $USER_ID);
if (isset($arRatingResult['CURRENT_VALUE'])) {
$arUser = array('POINTS' => round(floatval($arRatingResult['CURRENT_VALUE']) / COption::GetOptionString("main", "rating_vote_weight", 1)));
}
}
if ($arUser) {
if ($strLang === false || strLen($strLang) != 2) {
$db_res = CForumPoints::GetList(array("MIN_POINTS" => "DESC"), array("<=MIN_POINTS" => $arUser["POINTS"]));
} else {
$db_res = CForumPoints::GetListEx(array("MIN_POINTS" => "DESC"), array("<=MIN_POINTS" => $arUser["POINTS"], "LID" => $strLang));
}
if ($db_res && ($ar_res = $db_res->Fetch())) {
return $ar_res;
}
}
return false;
}
示例7: __forum_default_template_show_message
function __forum_default_template_show_message($arMessages, $message, $arResult, $arParams, $component = false)
{
$message = is_array($message) ? $message : array();
$arMessages = is_array($arMessages) ? $arMessages : array($arMessages);
$arResult = is_array($arResult) ? $arResult : array($arResult);
if ($arParams["SHOW_RATING"] == 'Y') {
$arAuthorId = array();
$arPostId = array();
$arTopicId = array();
foreach ($arMessages as $res) {
$arAuthorId[] = $res['AUTHOR_ID'];
if ($res['NEW_TOPIC'] == "Y") {
$arTopicId[] = $res['TOPIC_ID'];
} else {
$arPostId[] = $res['ID'];
}
}
if (!empty($arAuthorId)) {
$arRatingResult = CRatings::GetRatingResult($arParams["RATING_ID"], $arAuthorId);
}
if (!empty($arPostId)) {
$arRatingVote['FORUM_POST'] = CRatings::GetRatingVoteResult('FORUM_POST', $arPostId);
}
if (!empty($arTopicId)) {
$arRatingVote['FORUM_TOPIC'] = CRatings::GetRatingVoteResult('FORUM_TOPIC', $arTopicId);
}
}
$iCount = count($arMessages);
// messages count
$iNumber = 0;
// message number in list
foreach ($arMessages as $res) {
$iNumber++;
if ($arParams["SHOW_VOTE"] == "Y" && $res["PARAM1"] == "VT" && intVal($res["PARAM2"]) > 0 && IsModuleInstalled("vote")) {
?>
<div class="forum-info-box forum-post-vote">
<div class="forum-info-box-inner">
<a name="message<?php
echo $res["ID"];
?>
"></a><?php
$GLOBALS["APPLICATION"]->IncludeComponent("bitrix:voting.current", $arParams["VOTE_TEMPLATE"], array("VOTE_ID" => $res["PARAM2"], "VOTE_CHANNEL_ID" => $arParams["VOTE_CHANNEL_ID"], "PERMISSION" => $arResult["VOTE_PERMISSION"], "VOTE_RESULT_TEMPLATE" => POST_FORM_ACTION_URI, "CACHE_TIME" => $arParams["CACHE_TIME"], "NEED_SORT" => "N", "SHOW_RESULTS" => "Y"), $component && $component->__component && $component->__component->__parent ? $component->__component->__parent : null, array("HIDE_ICONS" => "Y"));
?>
</div>
</div>
<?php
}
?>
<!--MSG_<?php
echo $res["ID"];
?>
--><?php
?>
<table cellspacing="0" border="0" class="forum-post-table <?php
echo $iNumber == 1 ? "forum-post-first " : "";
echo $iNumber == $iCount ? "forum-post-last " : "";
echo $iNumber % 2 == 1 ? "forum-post-odd " : "forum-post-even ";
echo $res["APPROVED"] == "Y" ? "" : " forum-post-hidden ";
echo in_array($res["ID"], $message) ? " forum-post-selected " : "";
?>
" <?php
?>
id="message_block_<?php
echo $res["ID"];
?>
" bx-author-name="<?php
echo htmlspecialcharsbx($res["~AUTHOR_NAME"]);
?>
" bx-author-id="<?php
echo $res["AUTHOR_ID"];
?>
">
<tbody>
<tr>
<td class="forum-cell-user">
<div class="forum-user-info">
<?php
if ($res["AUTHOR_ID"] > 0) {
?>
<div class="forum-user-name"><a href="<?php
echo $res["URL"]["AUTHOR"];
?>
"><span><?php
echo $res["AUTHOR_NAME"];
?>
</span></a></div>
<?php
if (is_array($res["AVATAR"]) && !empty($res["AVATAR"]["HTML"])) {
?>
<div class="forum-user-avatar"><?php
?>
<a href="<?php
echo $res["URL"]["AUTHOR"];
?>
" title="<?php
echo GetMessage("F_AUTHOR_PROFILE");
?>
"><?php
echo $res["AVATAR"]["HTML"];
?>
//.........这里部分代码省略.........
示例8: CAdminViewTabControl
$arRatings[$arRatingsTmp['ID']] = $arRatingsTmp;
$i++;
}
if (is_array($arRatings) && !empty($arRatings))
{
$ratingWeightType = COption::GetOptionString("main", "rating_weight_type", "auto");
$authorityRatingId = CRatings::GetAuthorityRating();
$arAuthorityUserProp = CRatings::GetRatingUserPropEx($authorityRatingId, $ID);
$viewTabControl = new CAdminViewTabControl("tabControlRating", $aTabs2);
$viewTabControl->Begin();
foreach($arRatings as $ratingId => $arRating)
{
$arRatingResult = CRatings::GetRatingResult($ratingId, $ID);
$arRatingUserProp = CRatings::GetRatingUserPropEx($ratingId, $ID);
if ($ratingId == $authorityRatingId && $arRatingUserProp['BONUS'] == 0)
$arRatingUserProp['BONUS'] = COption::GetOptionString("main", "rating_start_authority", 3);
$viewTabControl->BeginNextTab();
?>
<table cellspacing="7" cellpadding="0" border="0" width="100%" class="edit-table">
<? if ($USER->CanDoOperation('edit_ratings') && ($selfEdit || $ID!=$uid)): ?>
<tr>
<td class="field-name" width="40%"><?php
echo GetMessage('RATING_BONUS');
?>
:<sup><span class="required">2</span></sup></td>
<td><?php