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


PHP CForumTopic::GetListEx方法代码示例

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


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

示例1: array

    }
    $arResult["ERROR_MESSAGE"] = $strErrorMessage;
    $arResult["OK_MESSAGE"] = $strOKMessage;
}
/********************************************************************
				/Action
********************************************************************/
/********************************************************************
				Data
********************************************************************/
/************** Topic for move *************************************/
$arFilter = array("@ID" => implode(",", $topics), "FORUM_ID" => $arParams["FID"]);
if (!CForumUser::IsAdmin()) {
    $arFilter["PERMISSION_STRONG"] = true;
}
$db_res = CForumTopic::GetListEx(array(), $arFilter);
if ($db_res && ($res = $db_res->GetNext())) {
    do {
        $res["read"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s"));
        $res["read_last_message"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))) . "#message" . $res["LAST_MESSAGE_ID"];
        $res["USER_START_HREF"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => intVal($res["USER_START_ID"])));
        $res["LAST_POSTER_HREF"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => intVal($res["LAST_POSTER_ID"])));
        $arResult["TOPICS"][$res["ID"]] = $res;
    } while ($res = $db_res->GetNext());
}
$arParams["TID"] = implode(",", array_keys($arResult["TOPICS"]));
/************** Forums *********************************************/
$arFilter = array();
if ($arParams["SHOW_FORUM_ANOTHER_SITE"] == "N" || !CForumUser::IsAdmin()) {
    $arFilter["LID"] = SITE_ID;
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例2: array

 $db_res = CForumNew::GetListEx(array(), $arFilter);
 if ($db_res && ($res = $db_res->GetNext())) {
     do {
         $res["URL"] = array("LIST" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $res["ID"])), "~LIST" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $res["ID"])));
         $res["list"] = $res["URL"]["list"];
         // for custom
         $arForums[$res["ID"]] = $res;
     } while ($res = $db_res->GetNext());
 }
 if (!empty($arForums)) {
     // it need for custom components
     foreach (array("TITLE", "USER_START_NAME", "POSTS", "VIEWS", "LAST_POST_DATE") as $res) {
         $arResult["SortingEx"][$res] = SortingEx($res, false, "by" . $orderIndex, "order" . $orderIndex);
     }
     // /it need for custom components
     $db_res = CForumTopic::GetListEx($arSort, array("@FORUM_ID" => array_keys($arForums), "APPROVED" => "Y"), false, false, $arNavParams);
     if ($db_res) {
         $db_res->NavStart($arParams["TOPICS_PER_PAGE"], false);
         $arResult["NAV_STRING"] = $db_res->GetPageNavStringEx($navComponentObject, $arParams["PAGER_TITLE"], $arParams["PAGER_TEMPLATE"], $arParams["PAGER_SHOW_ALWAYS"]);
         //$arResult["NAV_CACHED_DATA"] = $navComponentObject->GetTemplateCachedData();
         $arResult["NAV_RESULT"] = $db_res;
         while ($res = $db_res->GetNext()) {
             if (strLen(trim($res["LAST_POST_DATE"])) > 0) {
                 $res["LAST_POST_DATE"] = CForumFormat::DateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($res["LAST_POST_DATE"], CSite::GetDateFormat()));
             }
             $res["URL"] = array("AUTHOR" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_START_ID"])), "~AUTHOR" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_START_ID"])), "READ" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "MID" => intVal($res["LAST_MESSAGE_ID"]))) . "#message" . intVal($res["LAST_MESSAGE_ID"]), "~READ" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "MID" => intVal($res["LAST_MESSAGE_ID"]))) . "#message" . intVal($res["LAST_MESSAGE_ID"]));
             $res["user_start_id_profile"] = $res["URL"]["AUTHOR"];
             // For custom
             $res["read"] = $res["URL"]["READ"];
             // For custom
             $arTopics[] = $res;
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例3: MakeTimeStamp

     $res["USER_START_NAME"] = $parser->wrap_long_words($res["USER_START_NAME"]);
     $res["LAST_POSTER_NAME"] = $parser->wrap_long_words($res["LAST_POSTER_NAME"]);
     $res["LAST_POST_DATE"] = CForumFormat::DateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($res["LAST_POST_DATE"], CSite::GetDateFormat()));
     $res["START_DATE"] = CForumFormat::DateFormat($arParams["DATE_FORMAT"], MakeTimeStamp($res["START_DATE"], CSite::GetDateFormat()));
     /************** For custom template ********************************/
     $res["read"] = $res["URL"]["TOPIC"];
     $res["read_last_unread"] = $res["URL"]["MESSAGE_UNREAD"];
     $res["read_last_message"] = $res["URL"]["LAST_MESSAGE"];
     $res["USER_START_HREF"] = $res["URL"]["USER_START"];
     $res["LAST_POSTER_HREF"] = $res["URL"]["LAST_POSTER_HREF"];
     $res["author_profile"] = $res["URL"]["LAST_POSTER_HREF"];
     /************** For custom template/********************************/
     $arResult["Topics"][] = $res;
 }
 if (count($topicLinks) > 0) {
     $db_res1 = CForumTopic::GetListEx(array("SORT" => "ASC"), array("@ID" => $topicLinks));
     $topicLinks1 = array();
     while ($res = $db_res1->GetNext()) {
         $key = array_search($res["ID"], $topicLinks);
         if (array_key_exists($key, $arResult["Topics"])) {
             $arResult["Topics"][$key]["URL"] = array_merge($arResult["Topics"][$key]["URL"], array("TOPIC" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s")), "~TOPIC" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s")), "LAST_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))), "~LAST_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))), "MESSAGE_UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "unread_mid")), "~MESSAGE_UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "unread_mid"))));
         }
     }
 }
 /*******************************************************************
 				CACHE
 *******************************************************************/
 if ($PAGEN == null && $arParams["CACHE_TIME"] > 0 && defined("BX_COMP_MANAGED_CACHE")) {
     $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
     CForumCacheManager::SetTag($cache_path, "forum_msg_count" . $arParams['FID']);
     CForumCacheManager::SetTag($cache_path, "forum_" . $arParams['FID']);
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例4: array

				/Action
********************************************************************/
/*******************************************************************/
CPageOption::SetOptionString("main", "nav_page_in_session", "N");
if (!$USER->IsAuthorized()) {
    $rsTopics = CForumTopic::GetListEx(array($by => $order, "POSTS" => "DESC"), $arFilter, false, 500, array("sNameTemplate" => $arParams["NAME_TEMPLATE"]));
    while ($arTopic = $rsTopics->Fetch()) {
        if (!NewMessageTopic($arTopic["FORUM_ID"], $arTopic["ID"], $arTopic["LAST_POST_DATE"], false)) {
            continue;
        }
        $arrTOPICS[] = $arTopic;
    }
    $rsTopics = new CDBResult();
    $rsTopics->InitFromArray($arrTOPICS);
} else {
    $rsTopics = CForumTopic::GetListEx(array($by => $order, "POSTS" => "DESC"), $arFilter, false, 0, array("bDescPageNumbering" => false, "nPageSize" => $arParams["TOPICS_PER_PAGE"], "bShowAll" => false, "sNameTemplate" => $arParams["NAME_TEMPLATE"]));
}
$rsTopics->nPageWindow = $arParams["PAGE_NAVIGATION_WINDOW"];
$rsTopics->NavStart($arParams["TOPICS_PER_PAGE"], false);
$arResult["NAV_RESULT"] = $rsTopics;
$arResult["NAV_STRING"] = $rsTopics->GetPageNavStringEx($navComponentObject, GetMessage("FL_TOPIC_LIST"), $arParams["PAGE_NAVIGATION_TEMPLATE"]);
while ($res = $rsTopics->GetNext()) {
    if (!$USER->IsAuthorized()) {
        $res["PERMISSION"] = ForumCurrUserPermissions($res["FORUM_ID"]);
        //	elseif ($res["PERMISSION"] >= "Q"):
    }
    /*******************************************************************/
    $res["URL"] = array("TOPIC" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s")), "~TOPIC" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s")), "LAST_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))), "~LAST_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))), "MESSAGE_UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "unread_mid")), "~MESSAGE_UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "unread_mid")), "USER_START" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_START_ID"])), "~USER_START" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_START_ID"])), "LAST_POSTER" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["LAST_POSTER_ID"])), "~LAST_POSTER" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["LAST_POSTER_ID"])));
    $res["TopicStatus"] = "NEW";
    /*******************************************************************/
    if ($res["PERMISSION"] >= "Q") {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例5: array

                        $ex = $APPLICATION->GetException();
                        if ($ex && ($err = $ex->GetString())) {
                            $lAdmin->AddUpdateError($err, $ID);
                        } else {
                            $lAdmin->AddUpdateError(GetMessage("FM_WRONG_UPDATE"), $ID);
                        }
                    }
                    break;
            }
        }
    }
    if (!empty($sError)) {
        $lAdmin->AddFilterError($sError);
    }
}
$rsData = CForumTopic::GetListEx(array($by => $order), $arFilter, false, 0, array("NoFilter" => true));
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("FM_TOPICS")));
/*******************************************************************/
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "TITLE", "content" => GetMessage("FM_TITLE_NAME"), "sort" => "TITLE", "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("FM_TITLE_DESCRIPTION"), "sort" => "DESCRIPTION", "default" => false), array("id" => "STATE", "content" => GetMessage("FM_TITLE_STATE"), "sort" => "STATE", "default" => true), array("id" => "APPROVED", "content" => GetMessage("FM_TITLE_APPROVED"), "sort" => "APPROVED", "default" => true), array("id" => "SORT", "content" => GetMessage("FM_TITLE_SORT"), "sort" => "SORT", "default" => true), array("id" => "USER_START_NAME", "content" => GetMessage("FM_TITLE_AUTHOR"), "sort" => "USER_START_NAME", "default" => true), array("id" => "START_DATE", "content" => GetMessage("FM_TITLE_DATE_CREATE"), "sort" => "START_DATE", "default" => true), array("id" => "POSTS", "content" => GetMessage("FM_TITLE_MESSAGES"), "sort" => "POSTS", "default" => false), array("id" => "VIEWS", "content" => GetMessage("FM_TITLE_VIEWS"), "sort" => "VIEWS", "default" => false), array("id" => "FORUM_ID", "content" => GetMessage("FM_TITLE_FORUM"), "sort" => "FORUM_NAME", "default" => true), array("id" => "LAST_POST_DATE", "content" => GetMessage("FM_TITLE_LAST_MESSAGE"), "sort" => "LAST_POST_DATE", "default" => false)));
/*******************************************************************/
while ($res = $rsData->NavNext(true, "t_")) {
    $row =& $lAdmin->AddRow($t_ID, $res);
    $bCanUpdateForum = CForumTopic::CanUserUpdateTopic($t_ID, $USER->GetUserGroupArray(), $USER->GetID());
    $bCanDeleteForum = CForumTopic::CanUserDeleteTopic($t_ID, $USER->GetUserGroupArray(), $USER->GetID());
    $row->bReadOnly = !$bCanUpdateForum || !$bCanDeleteForum ? true : false;
    $row->AddField("ID", $t_ID);
    $row->AddInputField("TITLE", array("size" => "35"));
    $row->AddInputField("DESCRIPTION", array("size" => "35"));
    if ($t_STATE != "L") {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:forum_topics.php

示例6: array

        $res["URL"] = array("TOPIC" => $res["read"], "FORUM" => $res["list"], "LAST_MESSAGE" => $res["read_last_send"], "DELETE" => $res["subscr_delete"]);
        $arResult["SUBSCRIBE_LIST"][] = $res;
    } while ($res = $db_res->GetNext());
}
if (!empty($arResult["~FORUMS"])) {
    $arResult["~FORUMS"] = array_unique($arResult["~FORUMS"]);
    $db_res = CForumNew::GetListEx(array("SORT" => "ASC"), array("@ID" => $arResult["~FORUMS"]));
    if ($db_res && ($res = $db_res->GetNext())) {
        do {
            $arResult["FORUMS"][$res["ID"]] = $res;
        } while ($res = $db_res->GetNext());
    }
}
if (!empty($arResult["~TOPICS"])) {
    $arResult["~TOPICS"] = array_unique(array_diff($arResult["~TOPICS"], array(0, "")));
    $db_res = CForumTopic::GetListEx(array("SORT" => "ASC"), array("@ID" => $arResult["~TOPICS"]));
    if ($db_res && ($res = $db_res->GetNext())) {
        do {
            $arResult["TOPICS"][$res["ID"]] = $res;
        } while ($res = $db_res->GetNext());
    }
}
foreach ($arResult["SUBSCRIBE_LIST"] as $key => $res) {
    $arResult["SUBSCRIBE_LIST"][$key]["FORUM_INFO"] = $arResult["FORUMS"][$res["FORUM_ID"]];
    $arResult["SUBSCRIBE_LIST"][$key]["TOPIC_INFO"] = $arResult["TOPICS"][$res["TOPIC_ID"]];
}
/********************************************************************
				/Data
********************************************************************/
/*******************************************************************/
$this->IncludeComponentTemplate();
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例7: array

				Data
********************************************************************/
$arFilter = array("SOCNET_GROUP_ID" => false);
if ($arParams["PERMISSION"] < "Q") {
    $arFilter["APPROVED"] = "Y";
}
if ($USER->IsAuthorized()) {
    $arFilter["USER_ID"] = $USER->GetID();
}
if ($arParams["MODE"] == "GROUP") {
    $arFilter["SOCNET_GROUP_ID"] = $arParams["SOCNET_GROUP_ID"];
} else {
    $arFilter["OWNER_ID"] = $arParams["USER_ID"];
    $arFilter["FORUM_ID"] = $arParams["FID"];
}
$db_res = CForumTopic::GetListEx(array("SORT" => "ASC", $by => $order), $arFilter, false, false, array("bDescPageNumbering" => $arParams["USE_DESC_PAGE"] == "Y" ? true : false, "nPageSize" => $arParams["TOPICS_PER_PAGE"], "bShowAll" => false, "sNameTemplate" => $arParams["NAME_TEMPLATE"]));
$db_res->NavStart($arParams["TOPICS_PER_PAGE"], false);
//******************************************************************/
$arResult["NAV_RESULT"] = $db_res;
$arResult["NAV_STRING"] = $db_res->GetPageNavStringEx($navComponentObject, GetMessage("F_TOPIC_LIST"), $arParams["PAGE_NAVIGATION_TEMPLATE"]);
while ($res = $db_res->GetNext()) {
    $res["STATUS"] = "OLD";
    if ($res["APPROVED"] != "Y") {
        $res["STATUS"] = "NA";
    } elseif ($res["STATE"] == "L") {
        $res["STATUS"] = "MOVED";
        $res["URL"]["READ"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_TOPIC"], array("FID" => $res["FORUM_ID"], "TID" => $res["TOPIC_ID"], "MID" => "s"));
    } elseif (NewMessageTopic($res["FORUM_ID"], $res["ID"], $arParams["PERMISSION"] < "Q" ? $res["LAST_POST_DATE"] : $res["ABS_LAST_POST_DATE"], $res["LAST_VISIT"])) {
        $res["STATUS"] = "NEW";
    }
    $res["TopicStatus"] = $res["STATUS"];
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例8: NewMessageForum

function NewMessageForum($FID, $LAST_POST_DATE = false)
{
    if (intVal($_SESSION["FORUM"]["LAST_VISIT_FORUM_0"]) <= 0) {
        ForumInitParams();
    }
    $FID = intVal($FID);
    $LAST_VISIT = max($_SESSION["FORUM"]["LAST_VISIT_FORUM_0"], $_SESSION["FORUM"]["LAST_VISIT_FORUM_" . $FID]);
    $LAST_POST_DATE = MakeTimeStamp($LAST_POST_DATE);
    if (intVal($LAST_POST_DATE) > 0 && $LAST_POST_DATE < $LAST_VISIT) {
        "";
    } elseif ($GLOBALS["USER"]->IsAuthorized()) {
        $arFilter = array("FORUM_ID" => $FID, "RENEW" => $GLOBALS["USER"]->GetID());
        if (ForumCurrUserPermissions($FID) < "Q") {
            $arFilter["APPROVED"] = "Y";
        }
        $db_res = CForumTopic::GetListEx(array("ID" => "DESC"), $arFilter, false, 1);
        if ($db_res && ($res = $db_res->Fetch())) {
            return true;
        }
    } else {
        $arFilter = array("FORUM_ID" => $FID);
        if (is_array($_SESSION["FORUM"]["GUEST_TID"]) && !empty($_SESSION["FORUM"]["GUEST_TID"])) {
            $arFilter["RENEW_TOPIC"][0] = ConvertTimeStamp($LAST_VISIT, "FULL");
            foreach ($_SESSION["FORUM"]["GUEST_TID"] as $key => $val) {
                $arFilter["RENEW_TOPIC"][intVal($key)] = ConvertTimeStamp($val, "FULL");
            }
        } else {
            $arFilter[">LAST_POST_DATE"] = ConvertTimeStamp($LAST_VISIT, "FULL");
        }
        if (ForumCurrUserPermissions($FID) < "Q") {
            $arFilter["APPROVED"] = "Y";
        }
        $db_res = CForumTopic::GetList(array(), $arFilter, false, 1);
        if ($db_res && ($res = $db_res->Fetch())) {
            return true;
        }
    }
    ForumInitParams();
    return false;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:40,代码来源:include.php

示例9: array

        }
        if ($NUM <= 0 || $NUM > 100) {
            $NUM = 100;
        }
        if ($ORDER_BY != "TITLE" && $ORDER_BY != "POSTS" && $ORDER_BY != "USER_START_NAME" && $ORDER_BY != "VIEWS" && $ORDER_BY != "START_DATE") {
            $ORDER_BY = "LAST_POST_DATE";
        }
        if ($ORDER_DIRECTION != "ASC") {
            $ORDER_DIRECTION = "DESC";
        }
        $arOrder = array($ORDER_BY => $ORDER_DIRECTION);
        $arFilter = array("APPROVED" => "Y");
        if ($FID > 0) {
            $arFilter["FORUM_ID"] = $FID;
        }
        $db_Topic = CForumTopic::GetListEx($arOrder, $arFilter, false, $NUM > 0 ? $NUM : false);
        $ind = 0;
        while ($ar_Topic = $db_Topic->Fetch()) {
            $ind++;
            if ($NUM > 0 && $ind > $NUM) {
                break;
            }
            ?>
		<font class="text">
		<img src="/bitrix/templates/.default/forum/forum_pieces/images/news_bullet.gif" width="3" height="5" border="0">&nbsp;<a href="<?php 
            echo $PATH2MESSAGES . (strpos($PATH2MESSAGES, "?") !== false ? "&amp;" : "?") . "FID=" . $ar_Topic["FORUM_ID"] . "&amp;TID=" . $ar_Topic["ID"];
            ?>
"><?php 
            echo htmlspecialcharsEx($ar_Topic["TITLE"]);
            ?>
</a>
开发者ID:,项目名称:,代码行数:31,代码来源:

示例10: elseif

    } elseif ($ORDER_BY == "D") {
        $strOrderBy = "START_DATE";
    } else {
        $strOrderBy = "LAST_POST_DATE";
    }
    if (strtoupper($ORDER_DIRECTION) == "ASC") {
        $strOrderDir = "ASC";
    } else {
        $strOrderDir = "DESC";
    }
    $arOrder = array("SORT" => "ASC", $strOrderBy => $strOrderDir);
    $arFilter = array("FORUM_ID" => $FID);
    if (ForumCurrUserPermissions($FID) < "Q") {
        $arFilter["APPROVED"] = "Y";
    }
    $db_Topic = CForumTopic::GetListEx($arOrder, $arFilter);
    $db_Topic->NavStart($GLOBALS["FORUM_TOPICS_PER_PAGE"]);
    ?>
<table width="100%" border="0">
	<tr>
		<td align="left">
			<?php 
    echo $db_Topic->NavPrint("Темы");
    ?>
		</td>
		<td align="right">
			<?php 
    if (CForumTopic::CanUserAddTopic($FID, $USER->GetUserGroupArray(), $USER->GetID())) {
        ?>
				<a href="new_topic.php?FID=<?php 
        echo $FID;
开发者ID:,项目名称:,代码行数:31,代码来源:


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