diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-02-24 22:06:49 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-02-24 22:06:49 +0000 |
commit | b250bba47db5731462a2d752b6026c3d0620e255 (patch) | |
tree | 957a108810ec050e251bae456df1e3b6d0a11acb /phpBB/functions | |
parent | cc74b3559dcccb64666b299946e479e406e705d3 (diff) | |
download | forums-b250bba47db5731462a2d752b6026c3d0620e255.tar forums-b250bba47db5731462a2d752b6026c3d0620e255.tar.gz forums-b250bba47db5731462a2d752b6026c3d0620e255.tar.bz2 forums-b250bba47db5731462a2d752b6026c3d0620e255.tar.xz forums-b250bba47db5731462a2d752b6026c3d0620e255.zip |
Minor layout and jumpbox changes
git-svn-id: file:///svn/phpbb/trunk@49 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/functions')
-rw-r--r-- | phpBB/functions/functions.php | 95 |
1 files changed, 47 insertions, 48 deletions
diff --git a/phpBB/functions/functions.php b/phpBB/functions/functions.php index b9daefd91e..24f69ad180 100644 --- a/phpBB/functions/functions.php +++ b/phpBB/functions/functions.php @@ -74,57 +74,56 @@ function get_newest_user($db) } } -function make_jumpbox($db, $phpEx) +function make_jumpbox($db) { - $boxstring = " - <FORM ACTION=\"viewforum.$phpEx\" METHOD=\"GET\"> - Jump to: - <SELECT NAME=\"forum_id\"><OPTION VALUE=\"-1\">Select Forum</OPTION> - "; - $sql = "SELECT cat_id, cat_title FROM ".CATEGORIES_TABLE." ORDER BY cat_order"; - if($result = $db->sql_query($sql)) - { - if($total_cats = $db->sql_numrows($result)) - { - $cat_rows = $db->sql_fetchrowset($result); - for($x = 0; $x < $total_cats; $x++) - { - $boxstring .= "<OPTION VALUE=\"-1\"> </OPTION>\n"; - $boxstring .= "<OPTION VALUE=\"-1\">".stripslashes($cat_rows[$x]["cat_title"])."</OPTION>\n"; - $boxstring .= "<OPTION VALUE=\"-1\">----------------</OPTION>\n"; + $sql = "SELECT cat_id, cat_title FROM ".CATEGORIES_TABLE." ORDER BY cat_order"; + + $boxstring = ""; + if($result = $db->sql_query($sql)) + { + if($total_cats = $db->sql_numrows($result)) + { + $cat_rows = $db->sql_fetchrowset($result); + for($x = 0; $x < $total_cats; $x++) + { + $boxstring .= "<option value=\"-1\"> </option>\n"; + $boxstring .= "<option value=\"-1\">".stripslashes($cat_rows[$x]["cat_title"])."</OPTION>\n"; + $boxstring .= "<option value=\"-1\">----------------</OPTION>\n"; - $f_sql = "SELECT forum_name, forum_id FROM ".FORUMS_TABLE." - WHERE cat_id = ". $cat_rows[$x]["cat_id"] . " ORDER BY forum_id"; - if($f_result = $db->sql_query($f_sql)) - { - if($total_forums = $db->sql_numrows($f_result)) - { - $f_rows = $db->sql_fetchrowset($f_result); - for($y = 0; $y < $total_forums; $y++) - { - $name = stripslashes($f_rows[$y]["forum_name"]); - $boxstring .= "<OPTION VALUE=\"".$f_rows[$y]["forum_id"]."\">$name</OPTION>\n"; - } - } - } - else - { - $boxstring .= "<option value=\"-1\">Error!</option>\n"; - } - } - } + $f_sql = "SELECT forum_name, forum_id FROM ".FORUMS_TABLE." + WHERE cat_id = ". $cat_rows[$x]["cat_id"] . " ORDER BY forum_id"; + + if($f_result = $db->sql_query($f_sql)) + { + if($total_forums = $db->sql_numrows($f_result)) + { + $f_rows = $db->sql_fetchrowset($f_result); + + for($y = 0; $y < $total_forums; $y++) + { + $name = stripslashes($f_rows[$y]["forum_name"]); + $boxstring .= "<option value=\"".$f_rows[$y]["forum_id"]."\">$name</OPTION>\n"; + } + } + } + else + { + $boxstring .= "<option value=\"-1\">Error!</option>\n"; + } + + } + } + else + { + $boxstring .= "<option value=\"-1\">No Forums to Jump to</option>\n"; + } + } else - { - $boxstring .= "<option value=\"-1\">No Forums to Jump to</option>\n"; - } - } - else - { - $boxstring .= "<option value=\"-1\">Cat Error</option>\n"; - } - $boxstring .= "</SELECT>\n<br><INPUT TYPE=\"SUBMIT\" VALUE=\"Jump\"></FORM>"; - - return($boxstring); + { + $boxstring .= "<option value=\"-1\">Cat Error</option>\n"; + } + + return($boxstring); } function get_moderators($db, $forum_id) |