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