aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/functions/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/functions/functions.php')
-rw-r--r--phpBB/functions/functions.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/phpBB/functions/functions.php b/phpBB/functions/functions.php
index 30356ff148..941ccd0e22 100644
--- a/phpBB/functions/functions.php
+++ b/phpBB/functions/functions.php
@@ -73,4 +73,46 @@ function get_newest_user($db)
return($return_data);
}
}
+
+function make_jumpbox($db, $phpEx)
+{
+
+ $boxstring = "
+ <FORM ACTION=\"viewforum.$phpEx\" METHOD=\"GET\">
+ <SELECT NAME=\"forum_id\"><OPTION VALUE=\"-1\">Select Forum</OPTION>
+ ";
+ $sql = "SELECT cat_id, cat_title FROM ".CATEGORIES_TABLE." ORDER BY cat_order";
+ $result = $db->sql_query($sql);
+ if($total_cats = $db->sql_numrows($result))
+ {
+ for($x = 0; $x < $total_cats; $x++)
+ {
+ $boxstring .= "<OPTION VALUE=\"-1\">&nbsp;</OPTION>\n";
+ $boxstring .= "<OPTION VALUE=\"-1\">".stripslashes($cat_rows[$x]["cat_title"])."</OPTION>\n";
+ $boxstring .= "<OPTION VALUE=\"-1\">----------------</OPTION>\n";
+ $cat_rows = $db->sql_fetchrowset($result);
+ $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\">No Forums to Jump to</option>\n";
+ }
+ $boxstring .= "</SELECT>\n<br><INPUT TYPE=\"SUBMIT\" VALUE=\"Jump\"></FORM>";
+
+ return($boxstring);
+}
+
?>