vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Navbar Mini-Hack (https://vborg.vbsupport.ru/showthread.php?t=49194)

N!ck 02-21-2003 10:00 PM

Navbar Mini-Hack
 
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:
PHP Code:

    $navbits=makenav($id,$idtype,$highlightlast);

    if (
$altnavbar) {
        
$navbits explode(gettemplate("nav_joiner"),$navbits);
        while (list(
$key,$val)=each($navbits)) { 

Replace it with:
PHP Code:

    $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.

marcel-ea 02-22-2003 03:03 AM

Work! Great

but on my 2.2.9

This line

navbits.=makenav($id,$idtype,$highlightlast);

is withount the point after navbits :)

N!ck 02-22-2003 03:15 AM

ah, you're right...i need to modify my instructions a little bit. make sure you put that dot in or it won't work right.

Overgrow 02-22-2003 02:34 PM

Excellent Nick! I always find myself frustrated on other people's vBs that don't have a clear link back to the home page. (vBulletin.com being one obvious example!) It's poor UI since most people enter through the home page and expect that to be the top level of breadcrumb navigation.

Dean C 02-22-2003 02:49 PM

Awesome idea :)

- miSt

JulianD 02-22-2003 03:42 PM

Remember that you should change other templates that don't use the makenavbar function to make the breadcrumb. But it's a really good idea! thanks!

N!ck 02-23-2003 02:59 AM

Quote:

Originally posted by JulianD
Remember that you should change other templates that don't use the makenavbar function to make the breadcrumb. But it's a really good idea! thanks!
Actually, I thought of that, but I don't agree. Things like the calendar or user control panel should be just under the top level in my opinion. It's just a matter of template editing if you want them to be below your forums.

N!ck 02-23-2003 03:03 AM

Quote:

Originally posted by Overgrow
Excellent Nick! I always find myself frustrated on other people's vBs that don't have a clear link back to the home page. (vBulletin.com being one obvious example!) It's poor UI since most people enter through the home page and expect that to be the top level of breadcrumb navigation.
wow, haven't seen anything from you in a long time...glad to see you're still around :)

thanks

Lacrosse Boy 02-23-2003 07:38 PM

There only seems to be one problem with my hac of this: it shows it in the worng order. What do I do? Here's the example : http://www.metrodancecenter.com/vb/f...p?s=&forumid=2

Thanks!! :classic:

FleaBag 02-25-2003 12:55 AM

Shouldn't I get a little credit for this idea?

I posted it here days ago!

As far as I know www.dragonninja.co.uk was the first site to do this.


All times are GMT. The time now is 04:42 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01177 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete