N!ck
02-21-2003, 10:00 PM
This mini-hack will add Forums to your navbar in folders and threads. This is useful if your forums are not the highest level of hierarchy on your site.
For example, if you have a thread title "Thread" in a forum "Folder", your navbar shows:
MySite.com Forums > Folder > Thread
But what if MySite.com is a thing of its own, and you want MySite.com to be the highest level in the hierarchy. This hack (combined with changing $bbtitle to your site title), will change that to:
MySite.com > Forums > Folder > Thread
It will only work in threads and forums, however, because I feel that the calendar, user cp, etc. are their own things and don't really need to be on a lower level than the forums. Also, these things can be edited in your templates if you really care.
If you don't understand what this does, feel free to ask.
Anyway, to do this little hack, open functions.php in your admin folder.
In functions.php, find:
$navbits=makenav($id,$idtype,$highlightlast);
if ($altnavbar) {
$navbits = explode(gettemplate("nav_joiner"),$navbits);
while (list($key,$val)=each($navbits)) {
Replace it with:
$nav_title="Forums";
$nav_url="forums.php?s=".$session[sessionhash];
eval("\$navbits = \"".gettemplate("nav_linkon")."\";");
eval("\$navbits .= \"".gettemplate("nav_joiner")."\";");
$navbits.=makenav($id,$idtype,$highlightlast);
if ($altnavbar) {
$navbits = explode(gettemplate("nav_joiner"),$navbits);
while (list($key,$val)=each($navbits)) {
Make sure you change forums.php to the name of whatever file your index.php was renamed to.
For example, if you have a thread title "Thread" in a forum "Folder", your navbar shows:
MySite.com Forums > Folder > Thread
But what if MySite.com is a thing of its own, and you want MySite.com to be the highest level in the hierarchy. This hack (combined with changing $bbtitle to your site title), will change that to:
MySite.com > Forums > Folder > Thread
It will only work in threads and forums, however, because I feel that the calendar, user cp, etc. are their own things and don't really need to be on a lower level than the forums. Also, these things can be edited in your templates if you really care.
If you don't understand what this does, feel free to ask.
Anyway, to do this little hack, open functions.php in your admin folder.
In functions.php, find:
$navbits=makenav($id,$idtype,$highlightlast);
if ($altnavbar) {
$navbits = explode(gettemplate("nav_joiner"),$navbits);
while (list($key,$val)=each($navbits)) {
Replace it with:
$nav_title="Forums";
$nav_url="forums.php?s=".$session[sessionhash];
eval("\$navbits = \"".gettemplate("nav_linkon")."\";");
eval("\$navbits .= \"".gettemplate("nav_joiner")."\";");
$navbits.=makenav($id,$idtype,$highlightlast);
if ($altnavbar) {
$navbits = explode(gettemplate("nav_joiner"),$navbits);
while (list($key,$val)=each($navbits)) {
Make sure you change forums.php to the name of whatever file your index.php was renamed to.