function GetList($arOrder = array("ID" => "ASC"), $arFilter = array(), $bCount = false)
 {
     global $DB;
     $arSqlSearch = array();
     $strSqlSearch = "";
     $arSqlOrder = array();
     $strSqlOrder = "";
     $arFilter = is_array($arFilter) ? $arFilter : array();
     foreach ($arFilter as $key => $val) {
         $key_res = CFilterDictionary::GetFilterOperation($key);
         $key = strtoupper($key_res["FIELD"]);
         $strNegative = $key_res["NEGATIVE"];
         $strOperation = $key_res["OPERATION"];
         switch ($key) {
             case "LETTER":
             case "REPLACEMENT":
                 if (strlen($val) <= 0) {
                     $arSqlSearch[] = ($strNegative == "Y" ? "NOT" : "") . "(FL." . $key . " IS NULL OR LENGTH(FL." . $key . ")<=0)";
                 } else {
                     $arSqlSearch[] = ($strNegative == "Y" ? " FL." . $key . " IS NULL OR NOT " : "") . "(FL." . $key . " " . $strOperation . " '" . $DB->ForSql($val) . "' )";
                 }
                 break;
             case "DICTIONARY_ID":
             case "ID":
                 if ($strOperation != "IN") {
                     if (intVal($val) <= 0) {
                         $arSqlSearch[] = ($strNegative == "Y" ? "NOT" : "") . "(FL." . $key . " IS NULL OR FL." . $key . "<=0)";
                     } else {
                         $arSqlSearch[] = ($strNegative == "Y" ? " FL." . $key . " IS NULL OR NOT " : "") . "(FL." . $key . " " . $strOperation . " " . intVal($val) . " )";
                     }
                 } else {
                     if (!is_array($val)) {
                         $val = explode(',', $val);
                     }
                     $val_int = array();
                     foreach ($val as $v) {
                         $val_int[] = intval($v);
                     }
                     $val = implode(', ', $val_int);
                     $arSqlSearch[] = ($strNegative == "Y" ? " NOT " : "") . "(FL." . $key . " IN (" . $DB->ForSql($val) . ") )";
                 }
                 break;
         }
     }
     if (!empty($arSqlSearch)) {
         $strSqlSearch = " AND (" . implode(") AND (", $arSqlSearch) . ") ";
     }
     foreach ($arOrder as $by => $order) {
         $by = strtoupper($by);
         $order = strtoupper($order);
         if ($order != "ASC") {
             $order = "DESC";
         }
         if ($by == "ID") {
             $arSqlOrder[] = " FL.ID " . $order . " ";
         } elseif ($by == "TITLE") {
             $arSqlOrder[] = " FD.TITLE " . $order . " ";
         } elseif ($by == "LETTER") {
             $arSqlOrder[] = " FL.LETTER " . $order . " ";
         } elseif ($by == "REPLACEMENT") {
             $arSqlOrder[] = " FL.REPLACEMENT " . $order . " ";
         } else {
             $arSqlOrder[] = " FL.ID " . $order . " ";
             $by = "ID";
         }
     }
     DelDuplicateSort($arSqlOrder);
     if (!empty($arSqlOrder)) {
         $strSqlOrder = " ORDER BY " . implode(") AND (", $arSqlOrder);
     }
     if ($bCount) {
         $strSql = "SELECT COUNT(FD.ID) as CNT " . "FROM b_forum_letter FL, b_forum_dictionary FD " . "WHERE (FL.DICTIONARY_ID = FD.ID) " . $strSqlSearch;
         $db_res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         $iCnt = 0;
         if ($ar_res = $db_res->Fetch()) {
             $iCnt = intVal($ar_res["CNT"]);
         }
         return $iCnt;
     }
     $strSql = "SELECT FL.ID, FL.LETTER, FL.REPLACEMENT, FL.DICTIONARY_ID, FD.TITLE " . "FROM b_forum_letter FL, b_forum_dictionary FD " . "WHERE (FL.DICTIONARY_ID = FD.ID) " . $strSqlSearch . $strSqlOrder;
     $db_res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     return $db_res;
 }