vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Alt nav bar hack (https://vborg.vbsupport.ru/showthread.php?t=33913)

Moonwolf 01-07-2002 10:00 PM

Hi all

Well, here goes my first v2 hack :)

This hack will replace the linear nav bar (Board Title > Category > Forum > sub forum) nav bar with a cascading one, where the categories drop down and indent.

Unfortunately, this hack will only change the navbar that is generated by vB, it won't change the hard coded nav bars in pages like the member list/profile. I still have to figure out how to do that.

The hack is clunky, probably could be done in 4 lines of code instead of what I've done it in, and be cleaner, but I've tested it down to a depth of 6 and it seems to work clean, and that's all that matters right now :)

I'm working on changing the hard coded sections to use the CP flag, so that this can work on the site and change if the CP changes.

Kathi

File: Post #41
Demo: http://www.underlight.com/VBB

Installer file for latest version now at Post #41. If you have installed this before the timestamp of that post, you should be fine.

fonzerelli_79 01-08-2002 01:22 PM

have you got a demo?

Moonwolf 01-08-2002 01:25 PM

Quote:

Originally posted by fonzerelli_79
have you got a demo?
Funny you should mention it, I came here to post an update because I forgot to put one in :)

There's a version of it at www.underlight.com/VBB

Kathi

fonzerelli_79 01-08-2002 01:28 PM

i think ill give it a bash
it looks good

cheers

fonzerelli_79 01-08-2002 01:42 PM

i did it word for word and nothing happened

do you think this is because i run vbportal?

Moonwolf 01-08-2002 01:47 PM

Quote:

Originally posted by fonzerelli_79
i did it word for word and nothing happened

do you think this is because i run vbportal?

It could be, I don't run it so I don't know how it calls the navbar. You might want to go to your admin CP -> Options and set alt nav bar "Yes", even if it's currently set to "Yes". For some reason I had to submit options even with it already set to yes for it to work on mine.

Kathi

fonzerelli_79 01-08-2002 02:29 PM

i got it working

heres what i done

*set the nav bar settings to yes like you said
*wrapped the $altnavbits round a smallfont like this <smallfont>$altnavbits</smallfont>, to make the text to appear smaller (obviously)
* removed the spaces before the imagefolders in functions.php

the casvertline.gif doesnt look right though, see how its yellow instead of white

look at my attached image

Moonwolf 01-08-2002 02:58 PM

Quote:

Originally posted by fonzerelli_79

the casvertline.gif doesnt look right though, see how its yellow instead of white

That's wierd. Maybe I did something wrong in photoshop. I'll check it out and see.

Kathi

fonzerelli_79 01-08-2002 03:03 PM

thanks - appreciate it

also, i didnt like the big white space which this new bar left at the right so i added a banner in this space using this code

Code:

<table border=0>
<tr>
<td align=left>
<smallfont>$altnavbits</smallfont>
</td>
<td align=right>
banner ad
</td>
</tr>
</table>

you can see what it looks like in the image attached

Moonwolf 01-08-2002 03:08 PM

Nice use. Underlight's nav buttons will be taking up the space on that site, but I don't know what anyone else is using, so I just leave it up to them.

Now if only you could see the light and admit that Albion rules :)

Kathi

fonzerelli_79 01-08-2002 03:11 PM

are you talking about albion rovers or stirling albion

Moonwolf 01-08-2002 03:17 PM

Plymouth Albion :P

Although I doubt they're in the FA anymore, they were kind of borderline a decade ago when I lived in Plymouth :)

Kathi

fonzerelli_79 01-08-2002 03:25 PM

down the old south west coast

dont know much about Plymouth (ive been to torquay though)

would i have to change that image in photoshop or would psp do

Moonwolf 01-08-2002 03:49 PM

It's a .gif, anything should do it. If you get it fixed, could you stick it up here? I only included the custom ones from when that site migrated from UBB to vB years ago, so they're probably not right for everyone anyways.

Kathi

fonzerelli_79 01-08-2002 03:52 PM

i probably wont get a chance to do it today but when i do, ill post them here

:)

Horizon 01-08-2002 04:00 PM

How do you add something to the setting field in the database, per your first set of directions???

Through MySQLAdmin?

Moonwolf 01-08-2002 04:07 PM

I used phpMyAdmin, select the database to modify (vbulletin or whatever you called it at install time).

A textarea box is there letting you manually run queries on the database. Just add the line to that and hit go and it'll update the database.

I'm going to try and get this out using the install_ script that tubedogg et al use, when I figure out how to add it to one of them :p

Kathi

Horizon 01-08-2002 04:12 PM

I have admin v 1 and I dont see a go button, I select the forum db and then the setting on the right side, but then dont see where to add it.....

Horizon 01-08-2002 06:13 PM

This has changed since the last version
In admin/functions.php:

Find:

code:--------------------------------------------------------------------------------
$altnavbits .= "<br>$altnavprefix<img src=\"{ imagesfolder}/cascade/casendline.gif\"><img src=\"{ imagesfolder}/cascade/casicon.gif\"> $val\n";
$altnavprefix .= "<img src=\"{ imagesfolder}/cascade/casvertline.gif\">";
}
--------------------------------------------------------------------------------

That is not in my functions.php cause I never did the intial release.....so where does it go?

I finally did the query using MySQLGUI of www.mysql.com worked great.

bokhalifa 01-08-2002 08:28 PM

good hack :)

Moonwolf 01-08-2002 09:49 PM

In my 2.2.1 functions.php file, it's in

function makenavbar

Look for

Code:

if ($altnavbar) {
which should be in that function declaration. My code replaces the string you can't find.

If you don't have that in your functions.php, then I don't think you have v2.2.1, unless your vBPortal over-wrote functions.php, in which case I have no idea, sorry. I'm fairly sure the forums rules say I can't post the entire function to look for here.

Kathi

Quote:

Originally posted by Horizon
This has changed since the last version
In admin/functions.php:

Find:

code:--------------------------------------------------------------------------------
$altnavbits .= "<br>$altnavprefix<img src=\"{ imagesfolder}/cascade/casendline.gif\"><img src=\"{ imagesfolder}/cascade/casicon.gif\"> $val\n";
$altnavprefix .= "<img src=\"{ imagesfolder}/cascade/casvertline.gif\">";
}
--------------------------------------------------------------------------------

That is not in my functions.php cause I never did the intial release.....so where does it go?

I finally did the query using MySQLGUI of www.mysql.com worked great.


Horizon 01-08-2002 10:38 PM

I have 2.2.1 which is hte latest.....I will try this when I get back to work tomorrow.

Horizon 01-09-2002 05:58 PM

Ok I found it, but it did not work.

Quote:

if ($altnavbar) {
$navbits = explode(gettemplate("nav_joiner"),$navbits);
while (list($key,$val)=each($navbits)) {if($key == 0) {$altnavbits = "<br><img src=\"{ imagesfolder}/cascade/casendline.gif\"><img src=\"{ imagesfolder}/cascade/casicon.gif\"> $val\n";
} elseif ($key == 1) {$altnavprefix = "<img src=\"{ imagesfolder}/cascade/casvertline.gif\"><img src=\"{ imagesfolder}/cascade/casendline.gif\">";
$altnavbits .= "<br>$altnavprefix<img src=\"{ imagesfolder}/cascade/casicon.gif\"> $val\n";
} else {$space_count = (13 * ($key - 1));
$altnavprefix = "<img src=\"{ imagesfolder}/cascade/casvertline.gif\"><img src=\"{ imagesfolder}/space.gif\" width=\"".$space_count."\" height=\"1\"><img src=\"{ imagesfolder}/cascade/casendline.gif\">";
$altnavbits .= "<br>$altnavprefix<img src=\"{ imagesfolder}/cascade/casicon.gif\"> $val\n";
}
}
eval("\$navbar = \"".gettemplate("navbaralt")."\";");
} else {
eval("\$navbar = \"".gettemplate("navbar")."\";");
}
IS this spaced right?

Moonwolf 01-09-2002 06:06 PM

Find
Code:

        if ($altnavbar) {
Delete everything after that to:
Code:

                eval("\$navbar = \"".gettemplate("navbaralt")."\";");
Then insert after the
Code:

        if ($altnavbar) {
the following:
Code:

                $navbits = explode(gettemplate("nav_joiner"),$navbits);
                while (list($key,$val)=each($navbits)) {
                        if($key == 0) {
                                $altnavbits = "<br><img src=\"vbimages/cascade/casendline.gif\"><img src=\"vbimages/cascade/casicon.gif\">&nbsp;&nbsp;$val\n";
              } elseif ($key == 1) {
                                $altnavprefix = "<img src=\"vbimages/cascade/casvertline.gif\"><img src=\"vbimages/cascade/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"vbimages/cascade/casicon.gif\">&nbsp;&nbsp;$val\n";
              } else {
                                $space_count = (13 * ($key - 1));
                                $altnavprefix = "<img src=\"vbimages/cascade/casvertline.gif\"><img src=\"vbimages/space.gif\" width=\"".$space_count."\" height=\"1\"><img src=\"vbimages/cascade/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"vbimages/cascade/casicon.gif\">&nbsp;&nbsp;$val\n";
              }
                }

You should end up with a section that reads:
Code:

        if ($altnavbar) {
                $navbits = explode(gettemplate("nav_joiner"),$navbits);
                while (list($key,$val)=each($navbits)) {
                        if($key == 0) {
                                $altnavbits = "<br><img src=\"vbimages/cascade/casendline.gif\"><img src=\"vbimages/cascade/casicon.gif\">&nbsp;&nbsp;$val\n";
              } elseif ($key == 1) {
                                $altnavprefix = "<img src=\"vbimages/cascade/casvertline.gif\"><img src=\"vbimages/cascade/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"vbimages/cascade/casicon.gif\">&nbsp;&nbsp;$val\n";
              } else {
                                $space_count = (13 * ($key - 1));
                                $altnavprefix = "<img src=\"vbimages/cascade/casvertline.gif\"><img src=\"vbimages/space.gif\" width=\"".$space_count."\" height=\"1\"><img src=\"vbimages/cascade/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"vbimages/cascade/casicon.gif\">&nbsp;&nbsp;$val\n";
              }
                }
                eval("\$navbar = \"".gettemplate("navbaralt")."\";");
        } else {
                eval("\$navbar = \"".gettemplate("navbar")."\";");
        }

        return $navbar;

It looks like you have the original version in there, which I changed

Kathi

Horizon 01-09-2002 06:10 PM

Its not doing anything in the forum, I must be an idiot, I added the template called navbaralt and it includes this

Code:

<a href="java script:window.location=window.location"><img src="{ imagesfolder}/cascade/casicon.gif" border="0" align="middle" alt="$bbtitle : Powered by vBulletin version $templateversion"></a>
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a></b></normalfont>
$altnavbits

Then I did the change to Functions.php in the admin folder and then saved those files....did I not do something right?

Moonwolf 01-09-2002 06:46 PM

I'm not sure, I know -I- did something -wrong- with the last set of instructions, I forgot to put a space after the {'s so it was giving you the wrong instructions. The block I say yo put after the if ($altnavbar) { part should read:
Code:

                $navbits = explode(gettemplate("nav_joiner"),$navbits);
                while (list($key,$val)=each($navbits)) {
                        if($key == 0) {
                                $altnavbits = "<br><img src=\"{ imagesfolder}/cascade/casendline.gif\"><img src=\"{ imagesfolder}/cascade/casicon.gif\">  $val\n";
              } elseif ($key == 1) {
                                $altnavprefix = "<img src=\"{ imagesfolder}/cascade/casvertline.gif\"><img src=\"{ imagesfolder}/cascade/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"{ imagesfolder}/cascade/casicon.gif\">  $val\n";
              } else {
                                $space_count = (13 * ($key - 1));
                                $altnavprefix = "<img src=\"{ imagesfolder}/cascade/casvertline.gif\"><img src=\"{ imagesfolder}/space.gif\" width=\"".$space_count."\" height=\"1\"><img src=\"{ imagesfolder}/cascade/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"{ imagesfolder}/cascade/casicon.gif\">  $val\n";
              }
                }

Take the space out after the {'s, and you should be set. Sorry about that.

Kathi

Lesane 01-09-2002 06:56 PM

Great hack! Thanks, i gonna install this one later.

Horizon 01-09-2002 07:10 PM

Still nothing....this sucks, I think I did not do somethign right.

Moonwolf 01-09-2002 07:17 PM

OK

Did you add the altnavbar variable to the database table setting?

Did you submit the control panel options page -twice- with the "Use Alternative Nav Bar" set yo "Yes"?

If you did and it's not working, and the instructions were followed, then it looks like the hack isn't compatible with vBPortal.

Kathi

Horizon 01-09-2002 07:18 PM

LOL I dont have portal, but I did not do the thing with the control panel, where is that?

Moonwolf 01-09-2002 07:24 PM

*whimper*

Guess who forgot a step in the instructions :(

When you ran the database query in the instructions, you set up a control panel flag to tell the system to use the alternative nav bar instead of the linear one ...

Go to your admin CP, in the 5th section down will be an entry "Alternative Nav Bar". Select "Yes" for that, then submit the chaanges, then click on control panel again and submit it again. For some reason, it didn't take for some people on the first submit.

Then you should be running :p

Kathi
post 1 updated to reflect my being blonde

Horizon 01-09-2002 07:26 PM

OK it works now, just the icons do not show up right.....any idea they are broken links

here is a broken link

http://rikernet/forum/{%20imagesfolder}/cascade/casicon.gif

Moonwolf 01-09-2002 07:36 PM

Did you download cascade.zip and put the 3 image files in it in your folder images/cascade?

Kathi

Horizon 01-09-2002 07:50 PM

ok I had to change your image links...one does not work still though....here is the code, am I missing something?

Code:

        if ($altnavbar) {
                $navbits = explode(gettemplate("nav_joiner"),$navbits);
                while (list($key,$val)=each($navbits)) {
                        if($key == 0) {
                                $altnavbits = "<br><img src=\"images/casendline.gif\"><img src=\"images/casicon.gif\">  $val\n";
              } elseif ($key == 1) {
                                $altnavprefix = "<img src=\"images/casvertline.gif\"><img src=\"images/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"images/casicon.gif\">  $val\n";
              } else {
                                $space_count = (13 * ($key - 1));
                                $altnavprefix = "<img src=\images/casvertline.gif\"><img src=\"images/space.gif\" width=\"".$space_count."\" height=\"1\"><img src=\"images/casendline.gif\">";
                                $altnavbits .= "<br>$altnavprefix<img src=\"images/casicon.gif\">  $val\n";
              }
                }
                eval("\$navbar = \"".gettemplate("navbaralt")."\";");
        } else {
                eval("\$navbar = \"".gettemplate("navbar")."\";");
        }

        return $navbar;


THE TOP IMAGE STILL COMES UP WITH THIS

Code:

http://rikernet/forum/{%20imagesfolder}/cascade/casicon.gif

Horizon 01-09-2002 07:55 PM

screenshot

Moonwolf 01-09-2002 08:03 PM

Ummmm, that %20 means you didn't take the space out after a {

Check your navaltbar template code.

Kathi

Horizon 01-09-2002 09:55 PM

Yes but where does that space come from?? I posted my exact code from the functions.php up there.....any ideas? It looks great so far.

Moonwolf 01-09-2002 10:52 PM

Check both the code to inout into the .php file and the code in your templastes. It looks a lot like you have a { imagesfolder} line instead of an {\imagesfolder} line (\ added to try and get around that being parsed)

Horizon 01-10-2002 12:09 PM

Code:

<a href="java script:window.location=window.location"><img src="images/casicon.gif" border="0" align="middle" alt="$bbtitle : Powered by vBulletin version $templateversion"></a>
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a></b></normalfont>
$altnavbits

I had to take out the space before imagesfolder, and the cascade after it.

Great hack, now that I got it to work....

Horizon 01-10-2002 12:15 PM

Here is an XP folder if you want to change the blue one.....

: ) Just thought I would add this for my troubles


All times are GMT. The time now is 03:51 AM.

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.02105 seconds
  • Memory Usage 1,849KB
  • 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
  • (12)bbcode_code_printable
  • (5)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
  • (40)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