Exemplo n.º 1
0
    $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();
Exemplo n.º 2
0
        $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 {
Exemplo n.º 3
0
    // show list of users, who have a birthday today
    ?>
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumborder"><tr><td>
	<table border="0" cellpadding="1" cellspacing="1" width="100%">
		<tr class="forumhead">
			<td valign="top" class="forumtitletext">
				<?php 
    echo GetMessage("FI_TODAY_BIRTHDAY");
    ?>
			</td>
		</tr>
		<tr class="forumbody">
			<td valign="top" class="forumbodytext">
			<?php 
    $boundary_date = Date("m-d");
    $db_cur_users = CForumUser::GetList(array(), array("PERSONAL_BIRTHDAY_DATE" => $boundary_date, ">=USER_ID" => 1));
    $b_need_comma = False;
    while ($ar_cur_users = $db_cur_users->Fetch()) {
        if ($b_need_comma) {
            echo ", ";
        }
        $str_cur_name = "";
        if ($ar_cur_users["SHOW_NAME"] == "Y") {
            $str_cur_name = Trim($ar_cur_users["NAME"]);
            if (strlen($ar_cur_users["LAST_NAME"]) > 0) {
                if (strlen($str_cur_name) > 0) {
                    $str_cur_name .= " ";
                }
                $str_cur_name .= Trim($ar_cur_users["LAST_NAME"]);
            }
        }
Exemplo n.º 4
0
<?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");
        ?>
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
    $arResult["INCLUDE_BLOG"] = "Y";
    $arResult["arBlogUser"] = array();
    $arBlg = CBlogUser::GetByID($arResult["ID"], BLOG_BY_USER_ID);
    if (is_array($arBlg)) {
        foreach ($arBlg as $key => $val) {
            $arResult["arBlogUser"]["~" . $key] = $val;
            $arResult["arBlogUser"][$key] = htmlspecialcharsbx($val);
        }
    }
    if (!isset($arResult["arBlogUser"]["ALLOW_POST"]) || $arResult["arBlogUser"]["ALLOW_POST"] != "Y" && $arResult["arBlogUser"]["ALLOW_POST"] != "N") {
        $arResult["arBlogUser"]["ALLOW_POST"] = "Y";
    }
}
if (CModule::IncludeModule("forum")) {
    $arResult["INCLUDE_FORUM"] = "Y";
    $rsForumUser = CForumUser::GetList(array(), array("USER_ID" => $arResult["ID"]));
    $arResult["arForumUser"] = $rsForumUser->GetNext(false);
    if (!isset($arResult["arForumUser"]["ALLOW_POST"]) || $arResult["arForumUser"]["ALLOW_POST"] != "Y" && $arResult["arForumUser"]["ALLOW_POST"] != "N") {
        $arResult["arForumUser"]["ALLOW_POST"] = "Y";
    }
}
if (CModule::IncludeModule("learning")) {
    $arResult["INCLUDE_LEARNING"] = "Y";
    $dbStudent = CStudent::GetList(array(), array("USER_ID" => $arResult["ID"]));
    $arResult["arStudent"] = $dbStudent->GetNext();
    if (!isset($arResult["arStudent"]["PUBLIC_PROFILE"]) || $arResult["arStudent"]["PUBLIC_PROFILE"] != "Y" && $arResult["arStudent"]["PUBLIC_PROFILE"] != "N") {
        $arResult["arStudent"]["PUBLIC_PROFILE"] = "N";
    }
}
if ($strError != '') {
    static $skip = array("PERSONAL_PHOTO" => 1, "WORK_LOGO" => 1, "forum_AVATAR" => 1, "blog_AVATAR" => 1);
Exemplo n.º 7
0
}
/************** 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));
        }
Exemplo n.º 8
0
                if ($dbMessage) {
                    $dbMessage->NavPrint(GetMessage("LU_TITLE_POSTS"));
                }
                PrintMessages($main, $arUser);
                if ($dbMessage) {
                    $dbMessage->NavPrint(GetMessage("LU_TITLE_POSTS"));
                }
                break;
            default:
                InitSorting();
                global $by, $order;
                if (!$by) {
                    $by = "NUM_POSTS";
                    $order = "DESC";
                }
                $db_res = CForumUser::GetList(array($by => $order), array("!USER_ID" => "0", "SHOW_ABC" => ""));
                if ($db_res) {
                    $db_res->NavStart($PAGE_ELEMENTS, false);
                    if ($res = $db_res->GetNext()) {
                        $db_Forums = CForumNew::GetList();
                        $Forums = array();
                        while ($res_forum = $db_Forums->Fetch()) {
                            $Forums[] = $res_forum;
                        }
                        $db_res->NavPrint(GetMessage("LU_TITLE_USER"));
                        ?>
<br><br>
					<table border="0" cellspacing="1" cellpadding="0" class="forumborder" width="100%">
					  <tr>
						<td>
						  <table width="100%" border="0" cellspacing="1" cellpadding="4">
Exemplo n.º 9
0
    }
}
$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"));
Exemplo n.º 10
0
    }
}
$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"]);
Exemplo n.º 11
0
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)) {