当前位置: 首页>>代码示例>>PHP>>正文


PHP CForumUser::GetUserRank方法代码示例

本文整理汇总了PHP中CForumUser::GetUserRank方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumUser::GetUserRank方法的具体用法?PHP CForumUser::GetUserRank怎么用?PHP CForumUser::GetUserRank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CForumUser的用法示例。


在下文中一共展示了CForumUser::GetUserRank方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 // attach
 $res["ATTACH_IMG"] = "";
 $res["FILES"] = array();
 $res["~ATTACH_FILE"] = array();
 $res["ATTACH_FILE"] = array();
 /************** Message info/***************************************/
 /************** Author info ****************************************/
 $res["AUTHOR_ID"] = intVal($res["AUTHOR_ID"]);
 $res["AUTHOR_NAME"] = $parser->wrap_long_words($res["AUTHOR_NAME"]);
 if ($res["AUTHOR_ID"] <= 0) {
     // Status
     list($res["AUTHOR_STATUS_CODE"], $res["AUTHOR_STATUS"]) = ForumGetUserForumStatus(0);
 } else {
     if (!array_key_exists($res["AUTHOR_ID"], $UserInfo)) {
         $perm = CForumNew::GetUserPermission($res["FORUM_ID"], CUser::GetUserGroup($res["AUTHOR_ID"]));
         $arUser = array("Perms" => $perm, "Rank" => $perm <= "Q" ? CForumUser::GetUserRank($res["AUTHOR_ID"], LANGUAGE_ID) : "", "Points" => !empty($res["POINTS"]) ? array("POINTS" => $res["POINTS"], "DATE_UPDATE" => $res["DATE_UPDATE"]) : false);
         $arUData = array();
         // Status
         list($arUData["AUTHOR_STATUS_CODE"], $arUData["AUTHOR_STATUS"]) = ForumGetUserForumStatus($res["AUTHOR_ID"], $arUser["Perms"], $arUser);
         // Avatar
         if (!empty($res["AVATAR"])) {
             $arUData["AVATAR"] = array("ID" => $res["~AVATAR"], "FILE" => CFile::GetFileArray($res["~AVATAR"]));
             $arUData["AVATAR"]["HTML"] = CFile::ShowImage($arUData["AVATAR"]["FILE"], COption::GetOptionString("forum", "avatar_max_width", 90), COption::GetOptionString("forum", "avatar_max_height", 90), "border=\"0\"", "", true);
         }
         // Voting
         $arUData["VOTING"] = "N";
         if (COption::GetOptionString("forum", "SHOW_VOTES", "Y") == "Y" && $USER->IsAuthorized() && ($GLOBALS["APPLICATION"]->GetGroupRight("forum") >= "W" || $USER->GetID() != $res["AUTHOR_ID"])) {
             $bUnVote = $arUser["Points"];
             $bVote = !$arUser["Points"] ? $arResult["USER"]["RANK"]["VOTES"] : intval($arUser["Points"]["POINTS"]) < intval($arResult["USER"]["RANK"]["VOTES"]);
             $bVote = $bVote ? $bVote : $GLOBALS["APPLICATION"]->GetGroupRight("forum") >= "W";
             $arUData["VOTING"] = $bVote ? "VOTE" : ($bUnVote ? "UNVOTE" : "N");
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例2: array

$arResult["FORUMS_ALL"] = $arForums;
/********************************************************************
				Default params
********************************************************************/
$arResult["user_list"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_USER_LIST"], array());
$arResult["SHOW_RESULT"] = "N";
$arResult["GROUPS"] = CForumGroup::GetByLang(LANGUAGE_ID);
$arResult["USER"]["URL"] = array("PROFILE" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $arParams["UID"])), "~PROFILE" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $arParams["UID"])));
if (!empty($arResult["USER"]["AVATAR"])) {
    $arResult["USER"]["~AVATAR"] = array("ID" => $arResult["USER"]["AVATAR"], "FILE" => CFile::GetFileArray($arResult["USER"]["AVATAR"]));
    $arResult["USER"]["~AVATAR"]["HTML"] = CFile::ShowImage($arResult["USER"]["~AVATAR"]["FILE"], COption::GetOptionString("forum", "avatar_max_width", 90), COption::GetOptionString("forum", "avatar_max_height", 90), "border=\"0\"", "", true);
    $arResult["USER"]["AVATAR"] = $arResult["USER"]["~AVATAR"]["HTML"];
}
$arResult["USER"]["DATE_REG"] = !empty($arResult["USER"]["DATE_REG"]) ? CForumFormat::DateFormat($arParams["DATE_FORMAT"], MakeTimeStamp($arResult["USER"]["DATE_REG"], CSite::GetDateFormat())) : $arResult["USER"]["DATE_REG"];
$arResult["USER"]["GROUPS"] = CUser::GetUserGroup($arParams["UID"]);
$arResult["USER"]["RANK"] = CForumUser::GetUserRank($arParams["UID"], LANGUAGE_ID);
$arResult["PARSER"] = new forumTextParser(LANGUAGE_ID, $arParams["PATH_TO_SMILE"]);
$arResult["PARSER"]->MaxStringLen = $arParams["WORD_LENGTH"];
$arResult["PARSER"]->image_params["width"] = $arResult["PARSER"]->image_params["height"] = $arParams["IMAGE_SIZE"];
$arResult["PARSER"]->userPath = $arParams["URL_TEMPLATES_PROFILE_VIEW"];
$arResult["PARSER"]->userNameTemplate = $arParams["NAME_TEMPLATE"];
$arTopics = array();
$arTopicNeeded = array();
$forums = array();
$topics = array();
$arFilterFromForm = array();
$FilterMess = array();
$FilterMessLast = array();
$arForum_posts = array();
$arResult["MESSAGE_LIST"] = array();
$arResult["FORUMS"] = array();
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:component.php

示例3: array

}
if (!CForumUser::IsAdmin()) {
    $arFilter["PERMS"] = array($USER->GetGroups(), 'A');
    $arFilter["ACTIVE"] = "Y";
}
$arUserPerm = array();
$db_res = CForumNew::GetList(array(), $arFilter);
if ($db_res && ($res = $db_res->GetNext())) {
    $arUserGroup = CUser::GetUserGroup($arParams["UID"]);
    do {
        $arResult["FORUMS"][$res["ID"]] = $res;
        $arUserPerm[] = CForumNew::GetUserPermission($res["ID"], $arUserGroup);
    } while ($res = $db_res->GetNext());
}
rsort($arUserPerm);
$arRank = CForumUser::GetUserRank($arParams["UID"], LANGUAGE_ID);
list($arResult["USER_RANK_CODE"], $arResult["USER_RANK"]) = ForumGetUserForumStatus($arParams["UID"], $arUserPerm[0], array("Rank" => $arRank));
$arResult["SHOW_POINTS"] = "N";
$arResult["arRank"] = array_merge(is_array($arRank) ? $arRank : array(), array("NAME" => $arResult["USER_RANK"]));
if ($USER->IsAuthorized() && (CForumUser::IsAdmin() || intval($USER->GetID()) == $arParams["UID"])) {
    $arResult["SHOW_POINTS"] = "Y";
    $arResult["USER_POINTS"] = !empty($arRank["VOTES"]) ? intval($arRank["VOTES"]) : GetMessage("F_NO_VOTES");
}
/*******************************************************************/
$arResult["arTopic"] = "N";
if (!empty($arResult["FORUMS"])) {
    $db_res = CForumUser::UserAddInfo(array("LAST_POST" => "DESC"), array("AUTHOR_ID" => $arParams["UID"], "@FORUM_ID" => array_keys($arResult["FORUMS"])), "topics");
    if ($db_res && ($res = $db_res->GetNext())) {
        $res["TITLE"] = $parser->wrap_long_words($res["TITLE"]);
        $res["DESCRIPTION"] = $parser->wrap_long_words($res["DESCRIPTION"]);
        $res["LAST_POST_DATE"] = CForumFormat::DateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($res["LAST_POST_DATE"], CSite::GetDateFormat()));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例4: intVal

/************** Author info ****************************************/
	$res["AUTHOR_ID"] = intVal($res["AUTHOR_ID"]);
	$res["AUTHOR_NAME"] = $parser->wrap_long_words($res["AUTHOR_NAME"]);
	if ($res["AUTHOR_ID"] <= 0)
	{
		// Status
		list($res["AUTHOR_STATUS_CODE"], $res["AUTHOR_STATUS"]) = ForumGetUserForumStatus(0);
	}
	else
	{
		if (!array_key_exists($res["AUTHOR_ID"], $UserInfo))
		{
			$perm = CForumNew::GetUserPermission($res["FORUM_ID"], CUser::GetUserGroup($res["AUTHOR_ID"]));
			$arUser = array(
				"Perms" => $perm,
				"Rank" => ($perm <= "Q" ? CForumUser::GetUserRank($res["AUTHOR_ID"], LANGUAGE_ID) : ""),
				"Points" => (intVal($res["POINTS"]) > 0 ? array("POINTS" => $res["POINTS"], "DATE_UPDATE" => $res["DATE_UPDATE"]) : false));

			$arUData = array();

			// Status
			list($arUData["AUTHOR_STATUS_CODE"], $arUData["AUTHOR_STATUS"]) = ForumGetUserForumStatus($res["AUTHOR_ID"], $arUser["Perms"], $arUser);

			// Avatar
			if (!empty($res["AVATAR"])):
				$arUData["AVATAR"] = array("ID" => $res["~AVATAR"], "FILE" => CFile::GetFileArray($res["~AVATAR"]));
				$arUData["AVATAR"]["HTML"] = CFile::ShowImage($arUData["AVATAR"]["FILE"],
					COption::GetOptionString("forum", "avatar_max_width", 90),
					COption::GetOptionString("forum", "avatar_max_height", 90), "border=\"0\"", "", true);
			endif;
			// Voting
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:component.php

示例5: ForumGetUserForumStatus

function ForumGetUserForumStatus($userID = false, $perm = false, $arAdditionalParams = array())
{
    $arStatuses = array("guest" => array("guest", $GLOBALS["FORUM_STATUS_NAME"]["guest"]), "user" => array("user", $GLOBALS["FORUM_STATUS_NAME"]["user"]), "Q" => array("moderator", $GLOBALS["FORUM_STATUS_NAME"]["moderator"]), "U" => array("editor", $GLOBALS["FORUM_STATUS_NAME"]["editor"]), "Y" => array("administrator", $GLOBALS["FORUM_STATUS_NAME"]["administrator"]));
    $res = $userID === false ? $arStatuses : $arStatuses["guest"];
    if (!empty($userID)) {
        $res = $arStatuses["user"];
        if ($arStatuses[$perm]) {
            $res = $arStatuses[$perm];
        } else {
            $arRank = is_set($arAdditionalParams, "Rank") ? $arAdditionalParams["Rank"] : CForumUser::GetUserRank($userID, LANGUAGE_ID);
            if (is_array($arRank) && $arRank["NAME"]) {
                $res = array($arRank["CODE"], $arRank["NAME"]);
            }
        }
    }
    return $res;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:include.php


注:本文中的CForumUser::GetUserRank方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。