CForumNew::GetListEx
CDBResult GetListEx( [array arOrder [, array arFilter]] );
The method GetListEx returns an optionally filtered and sorted list of forums including all bound data.
Parameters
Parameter | Description |
---|---|
arOrder |
An array in the format Array(by1=>order1[, by2=>order2 [, ..]]), where: by - the field by which the list is to be sorted. The following values are possible:
|
arFilter |
An array of the format array("filtered field"=>"filter value" [, ...]). This parameter is detailed in CForumNew::GetList. |
Return Values
Returns an instance of the CDBResult class.See Also
Example
<? // Display a list of forums the current user can at least read. // Group the list by forum groups. // First sort the list by sort index, then by the forum name $arFilter = array(); if (!$USER->IsAdmin()) { $arFilter["PERMS"] = array($USER->GetGroups(), 'A'); $arFilter["ACTIVE"] = "Y"; } $arOrder = array("SORT"=>"ASC", "NAME"=>"ASC"); $db_Forum = CForumNew::GetListEx($arOrder, $arFilter); $currentGroupID = -1; while ($db_Forum->NavNext(true, "f_", false)): if ($currentGroupID != IntVal($f_FORUM_GROUP_ID)) { if (IntVal($f_FORUM_GROUP_ID)>0) { $arCurForumGroup = CForumGroup::GetLangByID($f_FORUM_GROUP_ID, LANG); echo "<b>"; echo htmlspecialcharsex($arCurForumGroup["NAME"]); echo "<b><br>"; } $currentGroupID = IntVal($f_FORUM_GROUP_ID); } echo $f_NAME."<br>"; endwhile; ?>
© «Bitrix24», 2001-2024