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


PHP CForumUser::UserAddInfo方法代碼示例

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


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

示例1: while

        $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()));
        $arResult["arTopic"] = array_merge($res, array("read" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["TOPIC_ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intval($res["LAST_POST"]))) . "#message" . intval($res["LAST_POST"])));
    }
}
/************** User properties ************************************/
$arResult["USER_PROPERTIES"] = array("SHOW" => "N");
if (!empty($arParams["USER_PROPERTY"])) {
    $arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER", $arParams["UID"], LANGUAGE_ID);
    if (count($arParams["USER_PROPERTY"]) > 0) {
        foreach ($arUserFields as $FIELD_NAME => $arUserField) {
            if (!in_array($FIELD_NAME, $arParams["USER_PROPERTY"])) {
                continue;
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:component.php

示例2: array_intersect_key

             $props = array_intersect_key($res, array_flip($arParams["USER_FIELDS"]));
             $arResult["MESSAGE_LIST"][$res["ID"]]["PROPS"] = $topics[$res["TOPIC_ID"]]["MESSAGES"][$res["ID"]]["PROPS"] = $props;
             $arResult["MESSAGE_LIST"][$res["ID"]]["ALLOW"] = array_merge($arResult["MESSAGE_LIST"][$res["ID"]]["ALLOW"], array("USERFIELDS" => $props));
         }
     }
     /************** Message info ***************************************/
     /* This is needed for parsing attachments in text such as [file=ID]*/
     /* And second loop whith messages array is more economy-way ********/
     $arResult["PARSER"]->arFiles = $arResult["FILES"];
     foreach ($arResult["MESSAGE_LIST"] as $iID => $res) {
         $topics[$res["TOPIC_ID"]]["MESSAGES"][$iID]["POST_MESSAGE_TEXT"] = $arResult["MESSAGE_LIST"][$iID]["POST_MESSAGE_TEXT"] = $arResult["PARSER"]->convert($res["~POST_MESSAGE_TEXT"], $res["ALLOW"]);
     }
 }
 /************** Message List/***************************************/
 if (!empty($arTopicNeeded)) {
     $db_res = CForumUser::UserAddInfo(array(), array("@TOPIC_ID" => implode(",", $arTopicNeeded), "AUTHOR_ID" => $arParams["UID"]), false, false, false);
     if ($db_res && ($res = $db_res->GetNext())) {
         do {
             $arTopics[$res["TOPIC_ID"]] = $res;
         } while ($res = $db_res->GetNext());
     }
 }
 foreach ($topics as $topic_id => $res) {
     $forum_id = intval($arTopics[$topic_id]["FORUM_ID"]);
     if (!array_key_exists($forum_id, $forums)) {
         $UserPermStr = "";
         $UserPermCode = "";
         $UserPerm = CForumNew::GetUserPermission($forum_id, $arResult["USER"]["GROUPS"]);
         list($UserPermCode, $UserPermStr) = ForumGetUserForumStatus($arParams["UID"], $UserPerm, $arResult["USER"]["RANK"]);
         $forums[$forum_id] = array_merge($arResult["FORUMS_ALL"][$forum_id], array("NUM_POSTS_ALL" => $arForum_posts[$forum_id], "PERMISSION" => $UserPerm, "USER_PERM" => $UserPerm, "AUTHOR_STATUS" => $UserPermStr, "USER_PERM_STR" => $UserPermStr, "AUTHOR_STATUS_CODE" => $UserPermCode, "TOPICS" => array()));
     }
開發者ID:spas-viktor,項目名稱:books,代碼行數:31,代碼來源:component.php


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