function getForums($fIds = array()) { if ($fIds) { $where = ' AND fid IN (' . implode(',', $fIds) . ')'; } $result = array(); $sql = sprintf("SELECT COUNT(*) FROM %s\n\t\t\t\tWHERE 1 %s", DB::table('forum_forum'), $where); $result['totalNum'] = DB::result_first($sql); $sql = sprintf("SELECT * FROM %s\n\t\t\t\tWHERE 1 %s\n\t\t\t\tORDER BY fid", DB::table('forum_forum'), $where); $query = DB::query($sql); while ($forum = DB::fetch($query)) { $result['data'][$forum['fid']] = SearchHelper::_convertForum($forum); } if (!$fIds) { $result['sign'] = md5(serialize($result['data'])); } return $result; }