View Full Version : how to modify $navbar
larryd
10-26-2002, 11:06 PM
Ok Im creating a new set of templates to make an addition to my forums but make it look completely seperate from my forums. Its a parts review database which uses the same database as the forums but its a hidden forum and the entire look of it is different so Im changing almost everything from forumdisplay.php to partsreview.php and making ALOT of new templates. Im having a problem though in that Im caught up on the navigation bar at the top of the screen.
Somehow someway the template $navbar which creates the navigation bar at the top defaults to use the file forumdisplay.php , I need to change that file to partsreview.php or actually need to create another template called partsreview_navbar and have it use the other file. Simple youd think but there is no mention of the file name forumdisplay.php in the $navbar template. The only thing is mentions is $navbits which I cant figure out for the life of me what that is or where its made up.
Can someone please shed some light over here and let me know..
larryd
10-26-2002, 11:17 PM
ok now I feel like an idiot.. I did a search and found a bunch of info.. appears navbits is made up in the functions.php file which you will find forumdisplay.php.. I would just change the file name their but I still use forumdisplay.php so what I need to do is make a new function which does the same thing as
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);
}
//MOVED DOWN
// if (strlen($code)>0) {
// $code.=gettemplate("nav_joiner",0);
// }
//MOVED DOWN
$nav_url="forumdisplay.php?s=$session[sessionhash]&forumid=$id";
$nav_title=$foruminfo[title];
}
and title it something different ie) partsreview_makenav and then change where it calls that function in partsreview to the new name.. i think it makes sense.. do i got it right?
Erwin
10-27-2002, 02:21 AM
If you are making a whole new template for this, just remove the $navbar variable from the template, and hardcode it in that template using HTML.
For example, replace $navbar with this:
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%"><br>
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a>
> <a href="partsreview.php?s=$session[sessionhash]">Parts Review</a></b></normalfont></td>
</tr>
</table>
I'm not sure if that's what you're looking for.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.