コード例 #1
0
$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
0
         $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
0
ファイル: blog_comment.php プロジェクト: ASDAFF/bxApiDocs
	public static function BuildRSS($postID, $blogID, $type = "RSS2.0", $numPosts = 10, $arPathTemplate = Array())
	{
		$blogID = IntVal($blogID);
		$postID = IntVal($postID);
		if($blogID <= 0)
			return false;
		if($postID <= 0)
			return false;
		$numPosts = IntVal($numPosts);
		$type = strtolower(preg_replace("/[^a-zA-Z0-9.]/is", "", $type));
		if ($type != "rss.92" && $type != "atom.03")
			$type = "rss2.0";

		$rssText = False;

		$arBlog = CBlog::GetByID($blogID);
		if ($arBlog && $arBlog["ACTIVE"] == "Y" && $arBlog["ENABLE_RSS"] == "Y")
		{
			$arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
			if($arGroup["SITE_ID"] == SITE_ID)
			{
				$arPost = CBlogPost::GetByID($postID);
				if(!empty($arPost) && $arPost["BLOG_ID"] == $arBlog["ID"] && $arPost["ENABLE_COMMENTS"] == "Y")
				{
					$now = date("r");
					$nowISO = date("Y-m-d\TH:i:s").substr(date("O"), 0, 3).":".substr(date("O"), -2, 2);

					$serverName = "";
					$charset = "";
					$language = "";
					$dbSite = CSite::GetList(($b = "sort"), ($o = "asc"), array("LID" => SITE_ID));
					if ($arSite = $dbSite->Fetch())
					{
						$serverName = $arSite["SERVER_NAME"];
						$charset = $arSite["CHARSET"];
						$language = $arSite["LANGUAGE_ID"];
					}

					if (strlen($serverName) <= 0)
					{
						if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0)
							$serverName = SITE_SERVER_NAME;
						else
							$serverName = COption::GetOptionString("main", "server_name", "");
					}

					if (strlen($charset) <= 0)
					{
						if (defined("SITE_CHARSET") && strlen(SITE_CHARSET) > 0)
							$charset = SITE_CHARSET;
						else
							$charset = "windows-1251";
					}

					if(strlen($arPathTemplate["PATH_TO_BLOG"])>0)
						$blogURL = htmlspecialcharsbx("http://".$serverName.CComponentEngine::MakePathFromTemplate($arPathTemplate["PATH_TO_BLOG"], array("blog" => $arBlog["URL"], "user_id" => $arBlog["OWNER_ID"], "group_id" => $arBlog["SOCNET_GROUP_ID"])));
					else
						$blogURL = htmlspecialcharsbx("http://".$serverName.CBlog::PreparePath($arBlog["URL"], $arGroup["SITE_ID"]));

					if(strlen($arPathTemplate["PATH_TO_POST"])>0)
						$url = htmlspecialcharsbx("http://".$serverName.CComponentEngine::MakePathFromTemplate($arPathTemplate["PATH_TO_POST"], array("blog" => $arBlog["URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arPathTemplate["ALLOW_POST_CODE"]), "user_id" => $arBlog["OWNER_ID"], "group_id" => $arBlog["SOCNET_GROUP_ID"])));
					else
						$url = htmlspecialcharsbx("http://".$serverName.CBlogPost::PreparePath($arBlog["URL"], $arPost["ID"], $arGroup["SITE_ID"]));

					$dbUser = CUser::GetByID($arPost["AUTHOR_ID"]);
					$arUser = $dbUser->Fetch();

					if($arPathTemplate["USE_SOCNET"] == "Y")
					{
						$blogName = GetMessage("BLG_GCM_RSS_TITLE_SOCNET", Array("#AUTHOR_NAME#" => htmlspecialcharsEx($arUser["NAME"]." ".$arUser["LAST_NAME"]), "#POST_TITLE#" => htmlspecialcharsEx($arPost["TITLE"])));
					}
					else
					{
						$blogName = GetMessage("BLG_GCM_RSS_TITLE", Array("#BLOG_NAME#" => htmlspecialcharsEx($arBlog["NAME"]), "#POST_TITLE#" => htmlspecialcharsEx($arPost["TITLE"])));
					}

					$rssText = "";
					if ($type == "rss.92")
					{
						$rssText .= "<"."?xml version=\"1.0\" encoding=\"".$charset."\"?".">\n\n";
						$rssText .= "<rss version=\".92\">\n";
						$rssText .= " <channel>\n";
						$rssText .= "	<title>".$blogName."</title>\n";
						$rssText .= "	<description>".$blogName."</description>\n";
						$rssText .= "	<link>".$url."</link>\n";
						$rssText .= "	<language>".$language."</language>\n";
						$rssText .= "	<docs>http://backend.userland.com/rss092</docs>\n";
						$rssText .= "\n";
					}
					elseif ($type == "rss2.0")
					{
						$rssText .= "<"."?xml version=\"1.0\" encoding=\"".$charset."\"?".">\n\n";
						$rssText .= "<rss version=\"2.0\">\n";
						$rssText .= " <channel>\n";
						$rssText .= "	<title>".$blogName."</title>\n";
						$rssText .= "	<description>".$blogName."</description>\n";
						//$rssText .= "	<guid>".$url."</guid>\n";
						$rssText .= "	<link>".$url."</link>\n";
						$rssText .= "	<language>".$language."</language>\n";
						$rssText .= "	<docs>http://backend.userland.com/rss2</docs>\n";
						$rssText .= "	<pubDate>".$now."</pubDate>\n";
						$rssText .= "\n";
					}
					elseif ($type == "atom.03")
					{
						$atomID = "tag:".htmlspecialcharsbx($serverName).",".date("Y-m-d").":".$postID;

						$rssText .= "<"."?xml version=\"1.0\" encoding=\"".$charset."\"?".">\n\n";
						$rssText .= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\" xml:lang=\"".$language."\">\n";
						$rssText .= "  <title>".$blogName."</title>\n";
						$rssText .= "  <tagline>".$url."</tagline>\n";
						$rssText .= "  <id>".$atomID."</id>\n";
						$rssText .= "  <link rel=\"alternate\" type=\"text/html\" href=\"".$url."\" />\n";
						$rssText .= "  <modified>".$nowISO."</modified>\n";

						$BlogUser = CBlogUser::GetByID($arPost["AUTHOR_ID"], BLOG_BY_USER_ID);
						$authorP = htmlspecialcharsex(CBlogUser::GetUserName($BlogUser["ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"], $arUser["SECOND_NAME"]));
						if(strLen($arPathTemplate["PATH_TO_USER"])>0)
							$authorURLP = htmlspecialcharsbx("http://".$serverName.CComponentEngine::MakePathFromTemplate($arPathTemplate["PATH_TO_USER"], array("user_id"=>$arPost["AUTHOR_ID"])));
						else
							$authorURLP = "http://".$serverName.CBlogUser::PreparePath($arPost["AUTHOR_ID"], $arGroup["SITE_ID"]);

						$rssText .= "  <author>\n";
						$rssText .= "  		<name>".$authorP."</name>\n";
						$rssText .= "  		<uri>".$authorURLP."</uri>\n";
						$rssText .= "  </author>\n";

						$rssText .= "\n";
					}

					$user_id = $GLOBALS["USER"]->GetID();
					if($arPathTemplate["USE_SOCNET"] == "Y")
					{
						$postPerm = CBlogPost::GetSocNetPostPerms($postID);
						if($postPerm > BLOG_PERMS_DENY)
							$postPerm = CBlogComment::GetSocNetUserPerms($postID, $arPost["AUTHOR_ID"]);
					}
					else
						$postPerm = CBlogPost::GetBlogUserCommentPerms($postID, IntVal($user_id));

					if($postPerm >= BLOG_PERMS_READ)
					{
						$parser = new blogTextParser();
						$arParserParams = Array(
							"imageWidth" => $arPathTemplate["IMAGE_MAX_WIDTH"],
							"imageHeight" => $arPathTemplate["IMAGE_MAX_HEIGHT"],
						);

						CTimeZone::Disable();
						$dbComments = CBlogComment::GetList(
							array("DATE_CREATE" => "DESC"),
							array(
								//"BLOG_ID" => $blogID,
								"POST_ID" => $postID,
								"PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH,
							),
							false,
							array("nTopCount" => $numPosts),
							array("ID", "TITLE", "DATE_CREATE", "POST_TEXT", "AUTHOR_EMAIL", "AUTHOR_ID", "AUTHOR_NAME", "USER_LOGIN", "USER_LAST_NAME", "USER_SECOND_NAME", "USER_NAME", "BLOG_USER_ALIAS")
						);
						CTimeZone::Enable();
						$arImages = Array();
						$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."&amp;";
							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("&amp;", "&lt;", "&gt;", "&quot;"),
								$title);
							*/
							//$text1 = HTMLToTxt($text, "", Array("\&nbsp;"), 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";
								$rssText .= "      <pubDate>".$date."</pubDate>\n";
								$rssText .= "    </item>\n";
								$rssText .= "\n";
							}
							elseif ($type == "atom.03")
							{
								$atomID = "tag:".htmlspecialcharsbx($serverName).":".$arBlog["URL"]."/".$arPost["ID"];

								$timeISO = mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]);
								$dateISO = date("Y-m-d\TH:i:s", $timeISO).substr(date("O", $timeISO), 0, 3).":".substr(date("O", $timeISO), -2, 2);

								$rssText .= "<entry>\n";
								$rssText .= "  <title type=\"text/html\">".$title."</title>\n";
								$rssText .= "  <link rel=\"alternate\" type=\"text/html\" href=\"".$url1."\"/>\n";
								$rssText .= "  <issued>".$dateISO."</issued>\n";
								$rssText .= "  <modified>".$nowISO."</modified>\n";
								$rssText .= "  <id>".$atomID."</id>\n";
								$rssText .= "  <content type=\"text/html\" mode=\"escaped\" xml:lang=\"".$language."\" xml:base=\"".$blogURL."\">\n";
								$rssText .= $text."\n";
								$rssText .= "  </content>\n";
								$rssText .= "  <author>\n";
								$rssText .= "    <name>".htmlspecialcharsex($author)."</name>\n";
								if(strlen($authorURL) > 0)
									$rssText .= "    <uri>".$authorURL."</uri>\n";
								$rssText .= "  </author>\n";
								$rssText .= "</entry>\n";
								$rssText .= "\n";
							}
						}
					}

					if ($type == "rss.92")
						$rssText .= "  </channel>\n</rss>";
					elseif ($type == "rss2.0")
						$rssText .= "  </channel>\n</rss>";
					elseif ($type == "atom.03")
						$rssText .= "\n\n</feed>";
				}
			}
		}

		return $rssText;
	}
コード例 #4
0
ファイル: component.php プロジェクト: Satariall/izurit
    } 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
0
ファイル: template.php プロジェクト: ASDAFF/bitrix-5
		$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
0
ファイル: user.php プロジェクト: rasuldev/torino
 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
0
ファイル: template_message.php プロジェクト: Satariall/izurit
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"];
                ?>
</a></div>
								<?php 
            } else {
                ?>
								<div class="forum-user-register-avatar"><?php 
                ?>
<a href="<?php 
                echo $res["URL"]["AUTHOR"];
                ?>
" title="<?php 
                echo GetMessage("F_AUTHOR_PROFILE");
                ?>
"><span><!-- ie --></span></a></div>
								<?php 
            }
        } else {
            ?>
							<div class="forum-user-name"><span><?php 
            echo $res["AUTHOR_NAME"];
            ?>
</span></div>
							<div class="forum-user-guest-avatar"><!-- ie --></div>
							<?php 
        }
        if (!empty($res["AUTHOR_STATUS"])) {
            ?>
							<div class="forum-user-status <?php 
            echo !empty($res["AUTHOR_STATUS_CODE"]) ? "forum-user-" . $res["AUTHOR_STATUS_CODE"] . "-status" : "";
            ?>
"><?php 
            ?>
<span><?php 
            echo $res["AUTHOR_STATUS"];
            ?>
</span></div>
							<?php 
        }
        ?>
						<div class="forum-user-additional">
							<?php 
        if (intVal($res["NUM_POSTS"]) > 0) {
            ?>
								<span><?php 
            echo GetMessage("F_NUM_MESS");
            ?>
 <span><?php 
            echo $res["NUM_POSTS"];
            ?>
</span></span>
								<?php 
        }
        if (COption::GetOptionString("forum", "SHOW_VOTES", "Y") == "Y" && $res["AUTHOR_ID"] > 0 && ($res["NUM_POINTS"] > 0 || $res["VOTES"]["ACTION"] == "VOTE" || $res["VOTES"]["ACTION"] == "UNVOTE")) {
            ?>
								<span><?php 
            echo GetMessage("F_POINTS");
            ?>
 <span><?php 
            echo $res["NUM_POINTS"];
            ?>
</span><?php 
            if ($res["VOTING"] == "VOTE" || $res["VOTING"] == "UNVOTE") {
                ?>
&nbsp;(<span class="forum-vote-user"><?php 
                ?>
<a onclick="return fasessid(this);" href="<?php 
                echo $res["URL"]["AUTHOR_VOTE"];
                ?>
" title="<?php 
                echo $res["VOTING"] == "VOTE" ? GetMessage("F_NO_VOTE_DO") : GetMessage("F_NO_VOTE_UNDO");
                ?>
"><?php 
                echo $res["VOTING"] == "VOTE" ? "+" : "-";
                ?>
</a></span>)<?php 
            }
            ?>
</span>
								<?php 
        }
        if ($arParams["SHOW_RATING"] == 'Y' && $res["AUTHOR_ID"] > 0) {
            ?>
								<span>
				<?php 
            $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:rating.result", "", array("RATING_ID" => $arParams["RATING_ID"], "ENTITY_ID" => $arRatingResult[$res['AUTHOR_ID']]['ENTITY_ID'], "CURRENT_VALUE" => $arRatingResult[$res['AUTHOR_ID']]['CURRENT_VALUE'], "PREVIOUS_VALUE" => $arRatingResult[$res['AUTHOR_ID']]['PREVIOUS_VALUE']), null, array("HIDE_ICONS" => "Y"));
            ?>
				</span>
								<?php 
        }
        if (!empty($res["~DATE_REG"])) {
            ?>
								<span><?php 
            echo GetMessage("F_DATE_REGISTER");
            ?>
 <span><?php 
            echo $res["DATE_REG"];
            ?>
</span></span>
								<?php 
        }
        ?>
						</div>
						<?php 
        if (!empty($res["DESCRIPTION"])) {
            ?>
							<div class="forum-user-description"><span><?php 
            echo $res["DESCRIPTION"];
            ?>
</span></div>
							<?php 
        }
        ?>
					</div>
				</td>
				<td class="forum-cell-post">
					<span style='position:absolute;'><a id="message<?php 
        echo $res["ID"];
        ?>
">&nbsp;</a></span><?php 
        /* IE9 */
        ?>
					<div class="forum-post-date">
						<div class="forum-post-number"><noindex><a href="<?php 
        echo $res["URL"]["MESSAGE"];
        ?>
#message<?php 
        echo $res["ID"];
        ?>
" <?php 
        ?>
onclick="prompt(oText['ml'], (location.protocol + '//' + location.host + this.getAttribute('href'))); return false;" title="<?php 
        echo GetMessage("F_ANCHOR");
        ?>
" rel="nofollow">#<?php 
        echo $res["NUMBER"];
        ?>
</a></noindex><?php 
        if ($arResult["USER"]["PERMISSION"] >= "Q" && $res["SHOW_CONTROL"] != "N") {
            ?>
&nbsp;<input type="checkbox" name="message_id[]" value="<?php 
            echo $res["ID"];
            ?>
" id="message_id_<?php 
            echo $res["ID"];
            ?>
_" <?php 
            if (in_array($res["ID"], $message)) {
                ?>
 checked="checked" <?php 
            }
            if (isset($arParams['iIndex'])) {
                ?>
 onclick="SelectPost(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, <?php 
                echo $arParams['iIndex'];
                ?>
, this.value)" /><?php 
            } else {
                ?>
 onclick="SelectPost(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode)" /><?php 
            }
        }
        ?>
</div>
						<?php 
        if ($arParams["SHOW_RATING"] == 'Y') {
            ?>
						<div class="forum-post-rating" style="float: right;padding-right: 10px; padding-top: 2px;">
							<?php 
            $voteEntityType = $res['NEW_TOPIC'] == "Y" ? "FORUM_TOPIC" : "FORUM_POST";
            $voteEntityId = $res['NEW_TOPIC'] == "Y" ? $res['TOPIC_ID'] : $res['ID'];
            $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:rating.vote", $arParams["RATING_TYPE"], array("ENTITY_TYPE_ID" => $voteEntityType, "ENTITY_ID" => $voteEntityId, "OWNER_ID" => $res['AUTHOR_ID'], "USER_VOTE" => $arRatingVote[$voteEntityType][$voteEntityId]['USER_VOTE'], "USER_HAS_VOTED" => $arRatingVote[$voteEntityType][$voteEntityId]['USER_HAS_VOTED'], "TOTAL_VOTES" => $arRatingVote[$voteEntityType][$voteEntityId]['TOTAL_VOTES'], "TOTAL_POSITIVE_VOTES" => $arRatingVote[$voteEntityType][$voteEntityId]['TOTAL_POSITIVE_VOTES'], "TOTAL_NEGATIVE_VOTES" => $arRatingVote[$voteEntityType][$voteEntityId]['TOTAL_NEGATIVE_VOTES'], "TOTAL_VALUE" => $arRatingVote[$voteEntityType][$voteEntityId]['TOTAL_VALUE'], "PATH_TO_USER_PROFILE" => $arParams["~URL_TEMPLATES_PROFILE_VIEW"]), $arParams["component"], array("HIDE_ICONS" => "Y"));
            ?>
						</div>
						<?php 
        }
        ?>
						<span><?php 
        echo $res["POST_DATE"];
        ?>
</span>
					</div>
					<div class="forum-post-entry">
						<div class="forum-post-text" id="message_text_<?php 
        echo $res["ID"];
        ?>
"><?php 
        echo $res["POST_MESSAGE_TEXT"];
        ?>
</div>
						<?php 
        if (!empty($res["FILES"])) {
            $arFilesHTML = array("thumb" => array(), "files" => array());
            foreach ($res["FILES"] as $arFile) {
                if (!in_array($arFile["FILE_ID"], $res["FILES_PARSED"])) {
                    $arFileTemplate = $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:forum.interface", "show_file", array("FILE" => $arFile, "SHOW_MODE" => $arParams["ATTACH_MODE"], "WIDTH" => $arParams["ATTACH_SIZE"], "HEIGHT" => $arParams["ATTACH_SIZE"], "CONVERT" => "N", "FAMILY" => "FORUM", "SINGLE" => "Y", "RETURN" => "ARRAY", "SHOW_LINK" => "Y"), null, array("HIDE_ICONS" => "Y"));
                    if (!empty($arFileTemplate["DATA"])) {
                        $arFilesHTML["thumb"][] = $arFileTemplate["RETURN_DATA"];
                    } else {
                        $arFilesHTML["files"][] = $arFileTemplate["RETURN_DATA"];
                    }
                }
            }
            if (!empty($arFilesHTML["thumb"]) || !empty($arFilesHTML["files"])) {
                ?>
								<div class="forum-post-attachments">
									<label><?php 
                echo GetMessage("F_ATTACH_FILES");
                ?>
</label>
									<?php 
                if (!empty($arFilesHTML["thumb"])) {
                    ?>
<div class="forum-post-attachment forum-post-attachment-thumb"><fieldset><?php 
                    echo implode("", $arFilesHTML["thumb"]);
                    ?>
</fieldset></div><?php 
                }
                if (!empty($arFilesHTML["files"])) {
                    ?>
<div class="forum-post-attachment forum-post-attachment-files"><ul><li><?php 
                    echo implode("</li><li>", $arFilesHTML["files"]);
                    ?>
</li></ul></div><?php 
                }
                ?>
								</div>
								<?php 
            }
        }
        if (is_array($res["PROPS"])) {
            foreach ($res["PROPS"] as $arPostField) {
                if (!empty($arPostField["VALUE"])) {
                    if (!empty($arPostField["EDIT_FORM_LABEL"])) {
                        $arPostField["EDIT_FORM_LABEL"] = "<span>" . $arPostField["EDIT_FORM_LABEL"] . ": </span>";
                    }
                    ?>
<div class="forum-post-userfield"><?php 
                    echo $arPostField["EDIT_FORM_LABEL"];
                    $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:system.field.view", $arPostField["USER_TYPE"]["USER_TYPE_ID"], array("arUserField" => $arPostField), null, array("HIDE_ICONS" => "Y"));
                    ?>
</div><?php 
                }
            }
        }
        if (!empty($res["EDITOR_NAME"])) {
            ?>
<div class="forum-post-lastedit">
								<span class="forum-post-lastedit"><?php 
            echo GetMessage("F_EDIT_HEAD");
            ?>
									<span class="forum-post-lastedit-user"><?php 
            if (!empty($res["URL"]["EDITOR"])) {
                ?>
<a href="<?php 
                echo $res["URL"]["EDITOR"];
                ?>
"><?php 
                echo $res["EDITOR_NAME"];
                ?>
</a><?php 
            } else {
                echo $res["EDITOR_NAME"];
            }
            ?>
</span> - <span class="forum-post-lastedit-date"><?php 
            echo $res["EDIT_DATE"];
            ?>
</span>
									<?php 
            if (!empty($res["EDIT_REASON"])) {
                ?>
										<span class="forum-post-lastedit-reason">(<span><?php 
                echo $res["EDIT_REASON"];
                ?>
</span>)</span>
										<?php 
            }
            ?>
							</span></div><?php 
        }
        if (strLen($res["SIGNATURE"]) > 0) {
            ?>
							<div class="forum-user-signature">
								<div class="forum-signature-line"></div>
								<span><?php 
            echo $res["SIGNATURE"];
            ?>
</span>
							</div>
							<?php 
        }
        ?>
					</div>
					<?php 
        if ($arParams["PERMISSION_ORIGINAL"] >= "Q") {
            ?>
						<div class="forum-post-entry forum-user-additional forum-user-moderate-info">
							<?php 
            if ($res["SOURCE_ID"] == "EMAIL") {
                ?>
								<span><?php 
                echo GetMessage("F_SOURCE_ID");
                ?>
: <?php 
                if (!empty($res["MAIL_HEADER"])) {
                    if ($res["PANELS"]["MAIL"] == "Y" && !empty($res["XML_ID"])) {
                        $res["MAIL_HEADER"] .= "<br /><a href=\"/bitrix/admin/mail_message_view.php?MSG_ID=" . $res["XML_ID"] . "\">" . GetMessage("F_ORIGINAL_MESSAGE") . "</a>";
                    }
                    ?>
<a href="#" onclick="this.nextSibling.style.display=(this.nextSibling.style.display=='none'?'':'none'); return false;" title="<?php 
                    echo GetMessage("F_EMAIL_ADD_INFO");
                    ?>
">e-mail</a><?php 
                    ?>
<div>
										<div class="forum-note-box forum-note-success">
											<div class="forum-note-box-text">
												<?php 
                    echo preg_replace("/\r\n/", "<br />", $res["MAIL_HEADER"]);
                    ?>
											</div>
										</div>
									</div><?php 
                } else {
                    ?>
<span>e-mail</span> <?php 
                }
                ?>
</span>
								<?php 
            }
            if ($res["IP_IS_DIFFER"] == "Y") {
                ?>
								<span>IP<?php 
                echo GetMessage("F_REAL_IP");
                ?>
: <span><?php 
                echo $res["AUTHOR_IP"];
                ?>
 / <?php 
                echo $res["AUTHOR_REAL_IP"];
                ?>
</span></span>
								<?php 
            } else {
                ?>
								<span>IP: <span><?php 
                echo $res["AUTHOR_IP"];
                ?>
</span></span>
								<?php 
            }
            if ($res["PANELS"]["STATISTIC"] == "Y") {
                ?>
								<span><?php 
                echo GetMessage("F_USER_ID");
                ?>
: <span><a href="/bitrix/admin/guest_list.php?lang=<?php 
                echo LANG_ADMIN_LID;
                ?>
&amp;find_id=<?php 
                echo $res["GUEST_ID"];
                ?>
&amp;set_filter=Y"><?php 
                echo $res["GUEST_ID"];
                ?>
</a></span></span>
								<?php 
            }
            if ($res["PANELS"]["MAIN"] == "Y") {
                ?>
								<span><?php 
                echo GetMessage("F_USER_ID_USER");
                ?>
: <span><?php 
                ?>
<a href="/bitrix/admin/user_edit.php?lang=<?php 
                echo LANG_ADMIN_LID;
                ?>
&amp;ID=<?php 
                echo $res["AUTHOR_ID"];
                ?>
"><?php 
                echo $res["AUTHOR_ID"];
                ?>
</a></span></span>
								<?php 
            }
            ?>
						</div>
						<?php 
        } elseif ($res["SOURCE_ID"] == "EMAIL") {
            ?>
						<div class="forum-post-entry forum-user-additional forum-user-moderate-info">
							<span><?php 
            echo GetMessage("F_SOURCE_ID");
            ?>
: <span>e-mail</span></span>
						</div>
						<?php 
        }
        ?>
				</td>
				</tr>
				<tr>
					<td class="forum-cell-contact">
						<div class="forum-contact-links">
							<?php 
        if ($arParams["SHOW_MAIL"] == "Y" && strlen($res["EMAIL"]) > 0) {
            ?>
								<span class="forum-contact-email"><a href="<?php 
            echo $res["URL"]["AUTHOR_EMAIL"];
            ?>
" title="<?php 
            echo GetMessage("F_EMAIL_TITLE");
            ?>
">E-mail</a></span>
								<?php 
        } else {
            ?>
								&nbsp;
								<?php 
        }
        ?>
						</div>
					</td>
					<td class="forum-cell-actions">
						<div class="forum-action-links">
							<?php 
        if ($res["NUMBER"] == 1) {
            if ($res["PANELS"]["MODERATE"] == "Y") {
                if ($arResult["TOPIC"]["APPROVED"] != "Y") {
                    ?>
										<span class="forum-action-show"><a onclick="return fasessid(this);" href="<?php 
                    echo $GLOBALS["APPLICATION"]->GetCurPageParam("ACTION=SHOW_TOPIC", array("ACTION", "sessid"));
                    ?>
"><?php 
                    echo GetMessage("F_SHOW_TOPIC");
                    ?>
</a></span>
										<?php 
                } elseif (false) {
                    ?>
										<span class="forum-action-hide"><a onclick="return fasessid(this);" href="<?php 
                    echo $GLOBALS["APPLICATION"]->GetCurPageParam("ACTION=HIDE_TOPIC", array("ACTION", "sessid"));
                    ?>
"><?php 
                    echo GetMessage("F_HIDE_TOPIC");
                    ?>
</a></span>
										<?php 
                }
            }
            if ($res["PANELS"]["DELETE"] == "Y") {
                ?>
									&nbsp;&nbsp;<span class="forum-action-delete"><a onclick="if(confirm(oText['cdt'])){return fasessid(this);}return false;" href="<?php 
                echo $GLOBALS["APPLICATION"]->GetCurPageParam("ACTION=DEL_TOPIC", array("ACTION", "sessid"));
                ?>
"><?php 
                echo GetMessage("F_DELETE_TOPIC");
                ?>
</a></span>
									<?php 
                if ($res["SOURCE_ID"] == "EMAIL") {
                    ?>
										&nbsp;&nbsp;<span class="forum-action-spam"><a onclick="if(confirm(oText['cdt'])){return fasessid(this);}return false;" href="<?php 
                    echo $GLOBALS["APPLICATION"]->GetCurPageParam("ACTION=SPAM_TOPIC", array("ACTION", "sessid"));
                    ?>
"><?php 
                    echo GetMessage("F_SPAM");
                    ?>
</a></span>
										<?php 
                }
            }
            if ($res["PANELS"]["EDIT"] == "Y" && $arResult["USER"]["PERMISSION"] >= "U") {
                ?>
									&nbsp;&nbsp;<span class="forum-action-edit"><a href="<?php 
                echo $res["URL"]["MESSAGE_EDIT"];
                ?>
"><?php 
                echo GetMessage("F_EDIT_TOPIC");
                ?>
</a></span>
									<?php 
            } elseif ($res["PANELS"]["EDIT"] == "Y") {
                ?>
									&nbsp;&nbsp;<span class="forum-action-edit"><a href="<?php 
                echo $res["URL"]["MESSAGE_EDIT"];
                ?>
"><?php 
                echo GetMessage("F_EDIT");
                ?>
</a></span>
									<?php 
            }
        } else {
            if ($res["PANELS"]["MODERATE"] == "Y") {
                if ($res["APPROVED"] == "Y") {
                    ?>
										<span class="forum-action-hide"><a <?php 
                    if ($arParams['AJAX_POST'] == 'Y') {
                        ?>
onclick="return forumActionComment(this, 'MODERATE');"<?php 
                    } else {
                        ?>
onclick="return fasessid(this);"<?php 
                    }
                    ?>
 href="<?php 
                    echo $res["URL"]["MESSAGE_SHOW"];
                    ?>
"><?php 
                    echo GetMessage("F_HIDE");
                    ?>
</a></span>&nbsp;&nbsp;
										<?php 
                } else {
                    ?>
										<span class="forum-action-show"><a <?php 
                    if ($arParams['AJAX_POST'] == 'Y') {
                        ?>
onclick="return forumActionComment(this, 'MODERATE');"<?php 
                    } else {
                        ?>
onclick="return fasessid(this);"<?php 
                    }
                    ?>
 href="<?php 
                    echo $res["URL"]["MESSAGE_SHOW"];
                    ?>
"><?php 
                    echo GetMessage("F_SHOW");
                    ?>
</a></span>&nbsp;&nbsp;
										<?php 
                }
            }
            if ($res["PANELS"]["DELETE"] == "Y") {
                ?>
									<span class="forum-action-delete"><noindex><a rel="nofollow" <?php 
                if ($arParams['AJAX_POST'] == 'Y') {
                    ?>
onclick="return forumActionComment(this, 'DEL');"<?php 
                } else {
                    ?>
onclick="if(confirm(oText['cdm'])){return fasessid(this);}return false;"<?php 
                }
                ?>
 href="<?php 
                echo $res["URL"]["MESSAGE_DELETE"];
                ?>
" <?php 
                ?>
><?php 
                echo GetMessage("F_DELETE");
                ?>
</a></noindex></span>&nbsp;&nbsp;
									<?php 
                if ($res["SOURCE_ID"] == "EMAIL") {
                    ?>
										<span class="forum-action-spam"><a href="<?php 
                    echo $res["URL"]["MESSAGE_SPAM"];
                    ?>
" <?php 
                    ?>
onclick="if (confirm(oText['cdm'])){return fasessid(this);}return false;"><?php 
                    echo GetMessage("F_SPAM");
                    ?>
</a></span>&nbsp;&nbsp;
										<?php 
                }
            }
            if ($res["PANELS"]["EDIT"] == "Y") {
                ?>
									<span class="forum-action-edit"><a href="<?php 
                echo $res["URL"]["MESSAGE_EDIT"];
                ?>
"><?php 
                echo GetMessage("F_EDIT");
                ?>
</a></span>&nbsp;&nbsp;
									<?php 
            }
        }
        if ($arResult["USER"]["RIGHTS"]["ADD_MESSAGE"] == "Y") {
            if ($res["NUMBER"] == 1) {
                ?>
&nbsp;&nbsp;<?php 
            }
            if ($arResult["FORUM"]["ALLOW_QUOTE"] == "Y") {
                ?>
									<span class="forum-action-quote"><a title="<?php 
                echo GetMessage("F_QUOTE_HINT");
                ?>
" href="#postform" <?php 
                ?>
 onmousedown="if (window['quoteMessageEx']){quoteMessageEx(<?php 
                echo $res["ID"];
                ?>
);}"><?php 
                echo GetMessage("F_QUOTE");
                ?>
</a></span>
									<?php 
                if ($arParams["SHOW_NAME_LINK"] == "Y") {
                    ?>
										&nbsp;&nbsp;<span class="forum-action-reply"><a href="#postform" title="<?php 
                    echo GetMessage("F_INSERT_NAME");
                    ?>
" <?php 
                    ?>
 onmousedown="reply2author(<?php 
                    echo $res["ID"];
                    ?>
)"><?php 
                    echo GetMessage("F_NAME");
                    ?>
</a></span>
										<?php 
                }
            } elseif ($arParams["SHOW_NAME_LINK"] != "Y") {
                ?>
									<span class="forum-action-reply"><a href="#postform" <?php 
                ?>
 onmousedown="reply2author(<?php 
                echo $res["ID"];
                ?>
)"><?php 
                echo GetMessage("F_REPLY");
                ?>
</a></span>
									<?php 
            }
        } else {
            ?>
								&nbsp;
								<?php 
        }
        ?>
						</div>
					</td>
				</tr>
				</tbody>
		<?php 
        if ($iNumber < $iCount || $arParams["FIRST_MESSAGE_ID"] == $res["ID"]) {
            ?>
			</table><!--MSG_END_<?php 
            echo $res["ID"];
            ?>
-->
		<?php 
        }
    }
}
コード例 #8
0
ファイル: user_edit.php プロジェクト: ASDAFF/bitrix-5
			$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