//copyright MiniMins.com
function construct_jump2($parentid = -1, $addbox = true, $prependchars = '', $permission = '')
{
global $vbulletin, $optionselected, $usecategories, $jumpforumid, $jumpforumtitle, $jumpforumbits, $curforumid, $daysprune, $jumpforumbits2;
global $stylevar, $vbphrase, $defaultselected, $forumjump, $selectedone;
global $frmjmpsel; // allows context sensitivity for non-forum areas
global $gobutton;
static $complete = false;
if ($complete OR !$vbulletin->options['useforumjump'] OR !($vbulletin->userinfo['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']))
{
return;
}
if (empty($vbulletin->iforumcache))
{
// get the vbulletin->iforumcache, as we use it all over the place, not just for forumjump
cache_ordered_forums(0, 1);
}
if (empty($vbulletin->iforumcache["$parentid"]) OR !is_array($vbulletin->iforumcache["$parentid"]))
{
return;
}
foreach($vbulletin->iforumcache["$parentid"] AS $forumid)
{
$forumperms = $vbulletin->userinfo['forumpermissions']["$forumid"];
#if ((!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['showonforumjump']) OR !$vbulletin->forumcache["$forumid"]['displayorder'] OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['active']))
if ((!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND ($vbulletin->forumcache["$forumid"]['showprivate'] == 1 OR (!$vbulletin->forumcache["$forumid"]['showprivate'] AND !$vbulletin->options['showprivateforums']))) OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['showonforumjump']) OR !$vbulletin->forumcache["$forumid"]['displayorder'] OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['active']))
{
continue;
}
else
{
// set $forum from the $vbulletin->forumcache
$forum = $vbulletin->forumcache["$forumid"];
$optionvalue = $forumid;
$optiontitle = $prependchars . " $forum[title_clean]";
$optionclass = 'fjdpth' . iif($forum['depth'] > 4, 4, $forum['depth']);
if ($curforumid == $optionvalue)
{
$optionselected = 'selected="selected"';
$optionclass = 'fjsel';
$selectedone = 1;
}
else
{
$optionselected = '';
}
//eval('$jumpforumbits2 .= "' . fetch_template('option') . '";');
//$jumpforumbits2 .=
$jumpforumbits2[$optionvalue] .= "<a href=\"forumdisplay.php?f=".$forumid."\">".$optiontitle."</a>";
construct_jump2($optionvalue, 0, $prependchars . FORUM_PREPEND, $forumperms);
} // if can view
} // end foreach ($vbulletin->iforumcache[$parentid] AS $forumid)
}
function jumpforumbits2html()
{
global $jumpforumbits2;
$forumNavJumpMenu = "<div class=\"vbmenu_popup\" id=\"navbar_forumjump_menu\" style=\"display:none; position:absolute; padding: 0px;\">\n";
$forumNavJumpMenu .= "\t<table cellpadding=\"4\" cellspacing=\"1\" border=\"0\">\n";
$forumNavJumpMenu .= "\t\t<tr><td class=\"tcat\" colspan=\"6\" style=\"padding: 4px\">Forums</td></tr>\n";
$forumNavJumpMenu .= "\t\t<tr class=\"fjump\">\n";
$forumNavJumpMenu .= "\t\t\t<td valign=\"top\">\n";
$start = true;
foreach($jumpforumbits2 AS $bit)
{
$canArray = explode(" ",$bit);
if($canArray[1] != " ")
{
//this is the table heading!
//end previous table
if(!$start)
{
//uncomment if you want multiple columns
//$forumNavJumpMenu .= "\t\t\t\t</table>\n";
//$forumNavJumpMenu .= "\t\t\t</td>\n";
//$forumNavJumpMenu .= "\t\t\t<td valign=\"top\">\n";
}
//start table - uncomment the next 2 lines if you want.. multiple columns rather than 1 solid column
//$forumNavJumpMenu .= "\t\t\t\t<table cellpadding=\"2\" style=\"border-bottom:1px solid #fff; border-collapse: collapse; padding:1px;\">\n";
//$forumNavJumpMenu .= "\t\t\t\t<table cellpadding=\"0\" cellspacing=\"1\" border=\"0\">";
//start header
$forumNavJumpMenu .= "\t\t\t\t\t<tr><td class=\"thead\">".$bit."</td></tr>\n";
}
else
{
//just a normal heading
$forumNavJumpMenu .= "\t\t\t\t\t<tr><td class=\"vbmenu_option\">".$bit."</td></tr>\n";
}
$start = false;
}
//end tables
$forumNavJumpMenu .= "\t\t\t\t</table>\n";
$forumNavJumpMenu .= "\t\t\t</td>\n";
$forumNavJumpMenu .= "\t\t</tr>\n";
$forumNavJumpMenu .= "\t</table>\n";
$forumNavJumpMenu .= "</div>";
return $forumNavJumpMenu;
}
$forumNavJumpList = construct_jump2();
$forumNavJumpMenu= jumpforumbits2html();