PDA

View Full Version : How to make the vB navbar look like the links navbar?


Rob Locke
01-09-2006, 03:48 PM
Hi Brian,

I wonder if you can help me. I would like to make my regular, unhacked, vBulletin navbar look like the links navbar. Naturally, creating the table and the table cells is no problem. In fact it's all very straight forward apart from one thing...equally spacing the columns.

I notice that there is a variable called "$lnavbarwidth" which auto spaces the cells with the code from links_global.php.

My question is this - given all the <if> statements in the regular vB navbar, such as show('member'), show('popups') and show('searchbuttons'), what is the code that I'll need to add to global.php to make everything space equally, regardless of whether the user is logged in/not logged in, the search button is visible/hidden and popups are enabled/disabled?

I have no clue how to write it so it works correctly with all the vB navbar variables. Being the php guru you most certainly are, can you clue me in with the right code please?

Your help will be HUGELY appreciated.

Many thanks,

Brian
01-09-2006, 08:57 PM
If you're just using the standard navbar links and such then the number of links displayed should really only depend on whether the user is a guest or not. What I would do is count the number of links that are displayed for a guest and then the number that are displayed for a logged in user, and then divide that by 100. Then you could add a plugin to your global_start hook location that would look something like this:

if ($show['guest'])
{
$forumnavbarwidth = '15%';
}
else
{
$forumnavbarwidth = '12%';
}

Then just use $forumnavbarwidth in the width="" column for those table cells.

Our Sponsors
 

Rob Locke
01-09-2006, 09:47 PM
Thanks Brian,

Great idea, I'll look into that. I also discovered that style="table-layout:fixed" renders the table cells with equal widths, although I am not sure how browser compatible that is.

At least I have a couple of options now. Thanks so much for all your help.

Happy New Year to you and I'm really looking forward to Links 2.0!