heretic
02-13-2003, 01:33 PM
I'm working on making a UBB 5 style navbar. They look similiar to this:
-Home
|--Forum
|----Thread
There's a few problems, the main being how vB includes the categories hard-coded into the navbar. This is where I'm having trouble. I want to either eliminate the category from the navbar, (as shown above) or seperate it to look like this (shown as waaay expanded)
-Home
|---Category
|-----Forum
|--------Subforum
|-----------Thread
all I've been able to find so far is this code in functions:
$altnavbar = 0;
function makenavbar($id,$idtype="forum",$highlightlast=1) {
global $header,$footer,$headinclude,$toplinks,$forumjump, $timezone,$bbtitle,
$hometitle,$bburl,$homeurl,$copyrighttext,$privacy url,$contactuslink,
$webmasteremail,$technicalemail,$faxnumber,$addres s,$companyname,$titleimage,
$replyimage,$newthreadimage,$closedthreadimage,$la stvisitdate,$timenow,$navbits,
$templateversion,$session,$altnavbar;
$navbits=makenav($id,$idtype,$highlightlast);
if ($altnavbar) {
$navbits = explode(gettemplate("nav_joiner"),$navbits);
while (list($key,$val)=each($navbits)) {
$altnavbits .= "<br>$altnavprefix<img src=\"https://vborg.vbsupport.ru/images/cascade/casendline.gif\"><img src=\"https://vborg.vbsupport.ru/images/cascade/casicon.gif\"> $val\n";
$altnavprefix .= "<img src=\"https://vborg.vbsupport.ru/images/cascade/casvertline.gif\">";
}
eval("\$navbar = \"".gettemplate("navbaralt")."\";");
} else {
eval("\$navbar = \"".gettemplate("navbar")."\";");
}
return $navbar;
}
function makenav($id,$idtype="forum",$highlightlast=1) {
global $DB_site,$nav_url,$nav_title,$session,$threadcache ;
$code = "";
if ($id!=-1) {
if ($idtype=="thread") {
if ( !isset($threadcache["$id"]) ) {
$getforumid=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$id");
} else {
$getforumid['forumid'] = $threadcache["$id"]['forumid'];
}
$code=makenav($getforumid['forumid'],"forum",1);
if ($highlightlast) {
$templatename="nav_linkon";
} else {
$templatename="nav_linkoff";
}
if (strlen($code)>0) {
$code.=gettemplate("nav_joiner",0);
}
$threadinfo=getthreadinfo($id);
$nav_url="showthread.php?s=$session[sessionhash]&threadid=$id";
$nav_title=$threadinfo[title];
eval("\$code .= \"".gettemplate("$templatename")."\";");
} else {
$foruminfo=getforuminfo($id);
if ($foruminfo[parentid]!=-1) {
$code=makenav($foruminfo[parentid],$idtype,1);
}
if (strlen($code)>0) {
$code.=gettemplate("nav_joiner",0);
}
$nav_url="forumdisplay.php?s=$session[sessionhash]&forumid=$id";
$nav_title=$foruminfo[title];
if ($highlightlast) {
eval("\$code .= \"".gettemplate('nav_linkon')."\";");
} else {
eval("\$code .= \"".gettemplate('nav_linkoff')."\";");
}
}
}
return $code;
}
I wouldn't have thought somethign so easy could be made so difficult :(
-Home
|--Forum
|----Thread
There's a few problems, the main being how vB includes the categories hard-coded into the navbar. This is where I'm having trouble. I want to either eliminate the category from the navbar, (as shown above) or seperate it to look like this (shown as waaay expanded)
-Home
|---Category
|-----Forum
|--------Subforum
|-----------Thread
all I've been able to find so far is this code in functions:
$altnavbar = 0;
function makenavbar($id,$idtype="forum",$highlightlast=1) {
global $header,$footer,$headinclude,$toplinks,$forumjump, $timezone,$bbtitle,
$hometitle,$bburl,$homeurl,$copyrighttext,$privacy url,$contactuslink,
$webmasteremail,$technicalemail,$faxnumber,$addres s,$companyname,$titleimage,
$replyimage,$newthreadimage,$closedthreadimage,$la stvisitdate,$timenow,$navbits,
$templateversion,$session,$altnavbar;
$navbits=makenav($id,$idtype,$highlightlast);
if ($altnavbar) {
$navbits = explode(gettemplate("nav_joiner"),$navbits);
while (list($key,$val)=each($navbits)) {
$altnavbits .= "<br>$altnavprefix<img src=\"https://vborg.vbsupport.ru/images/cascade/casendline.gif\"><img src=\"https://vborg.vbsupport.ru/images/cascade/casicon.gif\"> $val\n";
$altnavprefix .= "<img src=\"https://vborg.vbsupport.ru/images/cascade/casvertline.gif\">";
}
eval("\$navbar = \"".gettemplate("navbaralt")."\";");
} else {
eval("\$navbar = \"".gettemplate("navbar")."\";");
}
return $navbar;
}
function makenav($id,$idtype="forum",$highlightlast=1) {
global $DB_site,$nav_url,$nav_title,$session,$threadcache ;
$code = "";
if ($id!=-1) {
if ($idtype=="thread") {
if ( !isset($threadcache["$id"]) ) {
$getforumid=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$id");
} else {
$getforumid['forumid'] = $threadcache["$id"]['forumid'];
}
$code=makenav($getforumid['forumid'],"forum",1);
if ($highlightlast) {
$templatename="nav_linkon";
} else {
$templatename="nav_linkoff";
}
if (strlen($code)>0) {
$code.=gettemplate("nav_joiner",0);
}
$threadinfo=getthreadinfo($id);
$nav_url="showthread.php?s=$session[sessionhash]&threadid=$id";
$nav_title=$threadinfo[title];
eval("\$code .= \"".gettemplate("$templatename")."\";");
} else {
$foruminfo=getforuminfo($id);
if ($foruminfo[parentid]!=-1) {
$code=makenav($foruminfo[parentid],$idtype,1);
}
if (strlen($code)>0) {
$code.=gettemplate("nav_joiner",0);
}
$nav_url="forumdisplay.php?s=$session[sessionhash]&forumid=$id";
$nav_title=$foruminfo[title];
if ($highlightlast) {
eval("\$code .= \"".gettemplate('nav_linkon')."\";");
} else {
eval("\$code .= \"".gettemplate('nav_linkoff')."\";");
}
}
}
return $code;
}
I wouldn't have thought somethign so easy could be made so difficult :(