Moviendo tema de Foro š„ Foro Portal DragonFlyCMS, CPGNuke |
Quote:: |
// // Simple version of jumpbox, just lists authed forums // function make_forum_select($box_name, $ignore_forum = false, $select_forum = '') { global $db, $userdata; $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata); $forum_list = ''; $result = $db->sql_query("SELECT f.forum_id, f.forum_name, c.cat_title FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c WHERE c.cat_id = f.cat_id ORDER BY c.cat_order ASC, f.forum_order ASC"); $cat_title=""; while ($row = $db->sql_fetchrow($result)) { if ($is_auth_ary[$row['forum_id']]['auth_read'] && $ignore_forum != $row['forum_id']) { if($cat_title != $row['cat_title']){ $cat_title = $row['cat_title']; $forum_list .= '<optgroup label="'.$cat_title.'">'; } $selected = ($select_forum == $row['forum_id']) ? ' selected="selected"' : ''; $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected .'> ' . $row['forum_name'] . '</option>'; } } $forum_list = ( $forum_list == '' ) ? '<option value="-1">-- ! No Forums ! --</option>' : '<select name="' . $box_name . '">' . $forum_list . '</select>'; return $forum_list; } |
Todas las horas son GMT + 1 Hora