本文整理汇总了PHP中CForumUser::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumUser::GetList方法的具体用法?PHP CForumUser::GetList怎么用?PHP CForumUser::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForumUser
的用法示例。
在下文中一共展示了CForumUser::GetList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arResult["filter"] = array();
$arResult["filter"]["date_last_visit"] = CalendarPeriod("date_last_visit1", "", "date_last_visit2", "", "form1", "Y", "", "");
/************** For custom/****************************************/
}
if (!$by && !is_set($_REQUEST, "sort")) {
$by = "NUM_POSTS";
$order = "DESC";
$_REQUEST["sort"] = "NUM_POSTS";
} elseif (!$by && is_set($_REQUEST, "sort")) {
$by = $_REQUEST["sort"];
$order = $_REQUEST["sort"] == "SHOW_ABC" ? "ASC" : "DESC";
}
/******************************************************************/
$arResult["ERROR_MESSAGE"] = $strError;
CPageOption::SetOptionString("main", "nav_page_in_session", "N");
$db_res = CForumUser::GetList(array($by => $order), $arFilter, array("bDescPageNumbering" => false, "nPageSize" => $arParams["USERS_PER_PAGE"], "bShowAll" => false, "sNameTemplate" => $arParams["NAME_TEMPLATE"]));
$arParams["SHOW_USER_STATUS"] = "Y";
if ($db_res) {
$db_res->NavStart($arParams["USERS_PER_PAGE"], false);
$arResult["NAV_STRING"] = $db_res->GetPageNavStringEx($navComponentObject, GetMessage("LU_TITLE_USER"), $arParams["PAGE_NAVIGATION_TEMPLATE"]);
$arResult["NAV_RESULT"] = $db_res;
$arResult["SHOW_RESULT"] = "Y";
$arResult["SortingEx"]["SHOW_ABC"] = SortingEx("SHOW_ABC", $APPLICATION->GetCurPageParam());
$arResult["SortingEx"]["NUM_POSTS"] = SortingEx("NUM_POSTS", $APPLICATION->GetCurPageParam());
$arResult["SortingEx"]["POINTS"] = SortingEx("POINTS", $APPLICATION->GetCurPageParam());
$arResult["SortingEx"]["DATE_REGISTER"] = SortingEx("DATE_REGISTER", $APPLICATION->GetCurPageParam());
$arResult["SortingEx"]["LAST_VISIT"] = SortingEx("LAST_VISIT", $APPLICATION->GetCurPageParam());
if ($res = $db_res->GetNext()) {
do {
$arUserGroup = array();
$UserPerm = array();
示例2: htmlspecialcharsEx
$arResult["POST_VALUES"]["~POST_MESSAGE"] = "[QUOTE]" . $arResult["POST_VALUES"]["~POST_MESSAGE"] . "[/QUOTE]";
$arResult["POST_VALUES"]["POST_MESSAGE"] = "[QUOTE]" . $arResult["POST_VALUES"]["POST_MESSAGE"] . "[/QUOTE]";
$arResult["POST_VALUES"]["USER_ID"] = $arResult["POST_VALUES"]["AUTHOR_ID"];
$arResult["POST_VALUES"]["USER_LOGIN"] = htmlspecialcharsEx(GetUserName($arResult["POST_VALUES"]["USER_ID"], $arParams["NAME_TEMPLATE"]));
}
} elseif ($bVarsFromForm) {
$arResult["POST_VALUES"]["POST_SUBJ"] = htmlspecialcharsEx($_REQUEST["POST_SUBJ"]);
$arResult["POST_VALUES"]["~POST_MESSAGE"] = $_REQUEST["POST_MESSAGE"];
$arResult["POST_VALUES"]["POST_MESSAGE"] = htmlspecialcharsEx($_REQUEST["POST_MESSAGE"]);
$arResult["POST_VALUES"]["USER_ID"] = htmlspecialcharsEx($_REQUEST["USER_ID"]);
$arResult["POST_VALUES"]["USE_SMILES"] = $_POST["USE_SMILES"] != "Y" ? "N" : "Y";
} elseif ($arParams["UID"] > 0) {
$arResult["POST_VALUES"]["USER_ID"] = intVal($arParams["UID"]);
}
if (intVal($arResult["POST_VALUES"]["USER_ID"]) > 0) {
$db_res = CForumUser::GetList(array(), array("USER_ID" => $arResult["POST_VALUES"]["USER_ID"], "SHOW_ABC" => ""), array("sNameTemplate" => $arParams["NAME_TEMPLATE"]));
if ($db_res && ($res = $db_res->GetNext())) {
$arResult["POST_VALUES"]["SHOW_NAME"] = array("link" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_ID"])), "text" => $res["SHOW_ABC"]);
}
}
/********************************************************************
/Data
********************************************************************/
if ($arParams["SET_NAVIGATION"] != "N") {
$APPLICATION->AddChainItem(GetMessage("PM_TITLE_NAV"), CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PM_FOLDER"], array()));
if ($mode != "new") {
$APPLICATION->AddChainItem($arResult["FolderName"], CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PM_LIST"], array("FID" => $arParams["FID"])));
}
if ($mode != "edit") {
$APPLICATION->AddChainItem(GetMessage("PM_TITLE_NEW"));
} else {
示例3: IncludeModuleLangFile
<?php
IncludeModuleLangFile(__FILE__);
ClearVars("str_forum_");
if (CModule::IncludeModule("forum")) {
$ID = IntVal($ID);
$db_res = CForumUser::GetList(array(), array("USER_ID" => $ID));
$db_res->ExtractFields("str_forum_", True);
if (!isset($str_forum_ALLOW_POST) || $str_forum_ALLOW_POST != "Y" && $str_forum_ALLOW_POST != "N") {
$str_forum_ALLOW_POST = "Y";
}
if (!isset($str_forum_SHOW_NAME) || $str_forum_SHOW_NAME != "Y" && $str_forum_SHOW_NAME != "N") {
$str_forum_SHOW_NAME = "Y";
}
$str_forum_SUBSC_GET_MY_MESSAGE = $str_forum_SUBSC_GET_MY_MESSAGE == "Y" ? "Y" : "N";
if ($COPY_ID > 0) {
$str_forum_AVATAR = "";
}
if (strlen($strError) > 0) {
$DB->InitTableVarsForEdit("b_forum_user", "forum_", "str_forum_");
$DB->InitTableVarsForEdit("b_user", "forum_", "str_forum_");
}
?>
<input type="hidden" name="profile_module_id[]" value="forum">
<?php
if ($USER->IsAdmin() || $GLOBALS["APPLICATION"]->GetGroupRight("forum") >= "W") {
?>
<tr>
<td width="40%"><?php
echo GetMessage("forum_ALLOW_POST");
?>
示例4: Delete
public static function Delete($ID)
{
global $DB;
$ID = intVal($ID);
$arUsers = array();
$db_res = CForumUser::GetList(array(), array("RANK_ID" => $ID));
while ($ar_res = $db_res->Fetch()) {
$arUsers[] = $ar_res["USER_ID"];
}
$DB->Query("DELETE FROM b_forum_rank_lang WHERE RANK_ID = " . $ID, True);
$DB->Query("DELETE FROM b_forum_rank WHERE ID = " . $ID, True);
foreach ($arUsers as $userId) {
CForumUser::SetStat($userId);
}
return true;
}
示例5: md5
}
/************** Birthday *******************************************/
if (in_array("BIRTHDAY", $arParams["SHOW"])) {
$arUserBirthday = false;
$cache_id = md5(serialize(array("forum_userbirthday_" . preg_replace("/\\s.,;:!?\\#\\-\\*\\|\\[\\]\\(\\)\\//is", "_", $arParams["URL_TEMPLATES_PROFILE_VIEW"]), date("m-d"), CTimeZone::GetOffset())));
$cache_path = $cache_path_main . "birthday/";
$BIRTHDAY_CACHE_TIME = 60 * 60 * 24;
if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($BIRTHDAY_CACHE_TIME, $cache_id, $cache_path)) {
$res = $cache->GetVars();
$arTTL = getdate();
$TTL = mktime(0, 0, 0, $arTTL['mon'], $arTTL['mday'], $arTTL['year']);
if (is_array($res["arUserBirthday"]) && isset($res['timestamp']) && $TTL < $res['timestamp'] + $BIRTHDAY_CACHE_TIME) {
$arUserBirthday = $res["arUserBirthday"];
}
} else {
$db_res = CForumUser::GetList(array(), array("ACTIVE" => "Y", "PERSONAL_BIRTHDAY_DATE" => Date("m-d"), ">=USER_ID" => 1, "SHOW_ABC" => ""), array("sNameTemplate" => $arParams["NAME_TEMPLATE"]));
if ($db_res && ($res = $db_res->GetNext())) {
do {
$res["SHOW_NAME"] = $parser->wrap_long_words($res["SHOW_ABC"]);
$date_birthday = ParseDateTime($res["PERSONAL_BIRTHDAY"]);
$res["AGE"] = intVal(date("Y")) - intVal($date_birthday["YYYY"]);
$res["profile_view"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_ID"]));
$arUserBirthday[] = $res;
} while ($res = $db_res->GetNext());
}
if ($arParams["CACHE_TIME"] > 0) {
$cache->StartDataCache($BIRTHDAY_CACHE_TIME, $cache_id, $cache_path);
$arTTL = getdate();
$TTL = mktime(0, 0, 0, $arTTL['mon'], $arTTL['mday'], $arTTL['year']);
$cache->EndDataCache(array("arUserBirthday" => $arUserBirthday, "timestamp" => $TTL));
}
示例6: foreach
}
}
$sort = 1;
foreach ($arGroupID as $xmlID => $groupID) {
if ($groupID > 0) {
continue;
}
$arNewGroup = array("SORT" => $sort++, "LANG" => array());
foreach ($arLanguages as $languageID) {
$arMessages = WizardServices::IncludeServiceLang("index.php", $languageID, $bReturnArray = true);
$arNewGroup["LANG"][] = array("LID" => $languageID, "NAME" => array_key_exists($xmlID . "_GROUP_NAME", $arMessages) ? $arMessages[$xmlID . "_GROUP_NAME"] : GetMessage($xmlID . "_GROUP_NAME"), "DESCRIPTION" => array_key_exists($xmlID . "_GROUP_DESCRIPTION", $arMessages) ? $arMessages[$xmlID . "_GROUP_DESCRIPTION"] : GetMessage($xmlID . "_GROUP_DESCRIPTION"));
}
$arGroupID[$xmlID] = CForumGroup::Add($arNewGroup);
}
$arUsers = array();
$db_user = CForumUser::GetList(array("USER_ID" => "ASC"), array("ACTIVE" => "Y", "SHOW_ABC" => "Y"), array("nTopCount" => 5));
if ($db_user && ($res = $db_user->Fetch())) {
do {
$arUsers[$res["USER_ID"]] = $res;
} while ($res = $db_user->Fetch());
}
if (empty($arUsers[1])) {
$arUsers[1] = array("USER_ID" => 1, "SHOW_ABC" => "admin");
}
$arAdmin = $arUsers[1];
unset($arUsers[1]);
$arUser = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST1"));
$arUser2 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST2"));
$arUser3 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST3"));
$arUser4 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST4"));
$arUser5 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST5"));
示例7: array
}
}
$arResult["SHOW_SELF_CLOSE"] = "N";
if ($_REQUEST["search_insert"] == "Y" && intval($UID) > 0 || !empty($_REQUEST["search_by_login"])) {
if (empty($_REQUEST["search_by_login"])) {
$db_res = CForumUser::GetList(array(), array("USER_ID" => $UID, "SHOW_ABC" => ""), array("sNameTemplate" => $arParams["NAME_TEMPLATE"]));
if ($db_res && ($res = $db_res->GetNext())) {
$arResult["SHOW_SELF_CLOSE"] = "Y";
$arResult["UID"] = $UID;
$arResult["SHOW_NAME"] = $res["SHOW_ABC"];
$arResult["profile_view"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $UID));
}
} else {
$arResult["SHOW_SELF_CLOSE"] = "Y";
$arResult["SHOW_MODE"] = "none";
$db_res = CForumUser::GetList(array("ID" => "DESC"), array("SHOW_ABC" => str_replace(array("*", "%"), "", $_REQUEST["search_by_login"])), array("sNameTemplate" => $arParams["NAME_TEMPLATE"]));
if ($db_res && ($res = $db_res->getNext())) {
$arResult["SHOW_MODE"] = "full";
$arResult["SHOW_NAME"] = $res["SHOW_ABC"];
$arResult["profile_view"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_ID"]));
$arResult["UID"] = $res["USER_ID"];
} else {
$db_res = CUser::GetByLogin($_REQUEST["search_by_login"]);
if ($db_res && ($res = $db_res->GetNext())) {
$arResult["SHOW_MODE"] = "light";
$arResult["SHOW_NAME"] = GetUserName($res["ID"], $arParams["NAME_TEMPLATE"]);
$arResult["UID"] = $res["ID"];
}
}
}
// $arResult["SHOW_NAME"] = htmlspecialcharsback($arResult["SHOW_NAME"]);
示例8: IntVal
if (!($arUser = $rsUser->GetNext(false))) {
$ID = 0;
$arUser["ACTIVE"] = "Y";
} else {
$arUser["GROUP_ID"] = CUser::GetUserGroup($ID);
}
//echo "arUser:<pre>"; print_r($arUser); echo "</pre>";
if (CModule::IncludeModule("blog")) {
$arBlogUser = CBlogUser::GetByID($ID, BLOG_BY_USER_ID);
if (!isset($arBlogUser["ALLOW_POST"]) || $arBlogUser["ALLOW_POST"] != "Y" && $arBlogUser["ALLOW_POST"] != "N") {
$arBlogUser["ALLOW_POST"] = "Y";
}
}
if (CModule::IncludeModule("forum")) {
$ID = IntVal($ID);
$rsForumUser = CForumUser::GetList(array(), array("USER_ID" => $ID));
$arForumUser = $rsForumUser->GetNext(false);
if (!isset($arForumUser["ALLOW_POST"]) || $arForumUser["ALLOW_POST"] != "Y" && $arForumUser["ALLOW_POST"] != "N") {
$arForumUser["ALLOW_POST"] = "Y";
}
}
if (CModule::IncludeModule("learning")) {
$dbStudent = CStudent::GetList(array(), array("USER_ID" => $ID));
$arStudent = $dbStudent->GetNext();
if (!isset($arStudent["PUBLIC_PROFILE"]) || $arStudent["PUBLIC_PROFILE"] != "Y" && $arStudent["PUBLIC_PROFILE"] != "N") {
$arStudent["PUBLIC_PROFILE"] = "N";
}
}
if (strlen($strError) > 0) {
foreach ($_POST as $k => $val) {
if (!is_array($val)) {