There are a couple errors in your code involving extra and missing brackets so I wonder how you are running it. Here is a "fixed" version as in it seems to work
Code:
// ###################### Start makeforumjump #######################
function makeforumjump ()
{
// this generates the jump to box
global $DB_site, $forumid, $optionselected, $usecategories, $jumpforumid, $jumpforumtitle, $jumpforumbits, $curforumid;
global $hideprivateforums, $defaultselected, $forumjump, $bbuserid, $bbusergroupid;
if ($forumid != "")
{ $curforumid = $forumid; }
else
{ if ($threadid != "")
{
$getforumid = $DB_site->query_first ("SELECT forumid FROM thread WHERE threadid=$threadid");
$curforumid = $getforumid["forumid"];
}
}
$categorys = $DB_site->query ("SELECT category.categoryid, category.title as ctitle, category.displayorder , forum.forumid, forum.title as ftitle, forum.displayorder FROM category,forum WHERE forum.categoryid=category.categoryid AND forum.displayorder <>0 and category.displayorder<>0 and forum.active=1 order by category.displayorder, forum.displayorder");
$this_cat=0;
$old_categoryid=0;
$old_ctitle="";
while ($category = $DB_site->fetch_array ($categorys))
{
$forum=$category;
if ( $this_cat != $category["categoryid"] )
{
if ($this_cat >0)
{
if ($usecategories == 1 and $forumshown == 1)
{
$jumpforumid = "";
$jumpforumtitle = "";
eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";");
if ($curforumid == "cat$old_categoryid")
{ $optionselected = "selected"; }
$jumpforumid = "cat$old_categoryid";
$jumpforumtitle = "Category: $old_ctitle";
eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";");
$optionselected = "";
$jumpforumid = "";
$jumpforumtitle = "--------------------";
eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";");
}
// add forum bits
$jumpforumbits.= $tempjumpforumbits;
}
$optionselected = "";
$forumshown = 0;
$tempjumpforumbits = "";
$this_cat = $category["categoryid"];
$old_categoryid = $this_cat;
$old_ctitle=$category["ctitle"];
}
if ($hideprivateforums == 1)
{ $getperms = getpermissions ($bbuserid, $bbusergroupid, $forum["forumid"]); }
else
{ $getperms["canview"] = 1; }
if ($getperms["canview"] == 1)
{
$forumshown = 1;
$jumpforumid = $forum["forumid"];
$jumpforumtitle = " " . $forum["ftitle"];
}
else
{ $optionselected = ""; }
eval ("\$tempjumpforumbits .= \"".gettemplate ("jumpforumbit")."\";");
} // end if $getperms...
if ($usecategories == 1 and $forumshown == 1)
{
$jumpforumid = "";
$jumpforumtitle = "";
eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";");
//if ($curforumid == "cat".$category["categoryid"])
if ($curforumid == "cat$old_categoryid")
{ $optionselected = "selected"; }
// $jumpforumid = "cat" . $category["categoryid"];
$jumpforumid = "cat$old_categoryid";
// $jumpforumtitle = "Category: " . $category["ctitle"];
$jumpforumtitle = "Category: $old_ctitle";
eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";");
$optionselected = "";
$jumpforumid = "";
$jumpforumtitle = "--------------------";
eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";");
}
// add forum bits
$jumpforumbits.= $tempjumpforumbits;
if ($selectedone != 1)
{ $defaultselected = "selected"; }
eval ("\$forumjump = \"".gettemplate ("forumjump")."\";");
if ($curforumid == $jumpforumid)
{
$optionselected = "selected";
$selectedone = 1;
}
}