View Full Version : modding navbar/header template links, require assistance!
chrisisonfire
12-04-2005, 11:52 PM
Hi,
Basically, I'm creating a new header for my vB, where the navbar links (user cp, search, ect.) are rollover images inside the header template. I'm having a bit of a problem with the links, and I'd really appreciate some help here!
How does the navbar work concerning the links displayed depending on whether a user is logged in or not? Is there a call command for 2 different templates, or something else?
I'd really appreciate some help here guys, because I'm growing very fond of this new layout and I can't wait to use it! :classic:
Thanks in advance,
Chris
:pirate: (for the sake of Pirate smilies.)
Marco van Herwaarden
12-05-2005, 05:14 AM
This is just controlled by template conditionals i think.
chrisisonfire
12-05-2005, 08:55 AM
Well if anyone could explain to me how to use conditionals to achieve what I'm after, it'd be much appreciated. :)
Marco van Herwaarden
12-05-2005, 09:29 AM
<if condition="$vbulletin->userinfo[userid]">
....code for logged in users
</else>
...code for guests
</if>
chrisisonfire
12-05-2005, 10:44 AM
Thanks for the insight there, but I guess I'm in over my head here. HTML is one thing, but PHP is really something else. If anyone wouldn't mind working with me so that we can achieve what I'm looking for, PM me. :)
Basically, what would be the coding to replace an image for 'Register' to one for 'User CP' depending on whether the user is logged in or not, and the same for 'Log In' and 'Log Out'.
Thanks for your help so far, Marco. ;)
Marco van Herwaarden
12-05-2005, 11:09 AM
Thanks for the insight there, but I guess I'm in over my head here. HTML is one thing, but PHP is really something else.
This is HTML (the <if...> is a vB addition), not php.
chrisisonfire
12-05-2005, 08:14 PM
Oh right, okay... but that still doesn't mean I know what to do! ;)
Edit:
I think I'm really getting somewhere with using conditionals after finding a tut in the vBulletin Manual, and I'll post again if everything works!
What this edit is for (also to save on double posting), is I'm unsure what link to use in the <a> wrap, because I think finding '&u=82040' at the end of the logout link describes a specific user, and not a general log out link?
So, would the logout link be something like:
/login.php?do=logout&u=[userid]
...or what? :ermm:
Thanks!
Marco van Herwaarden
12-06-2005, 05:54 AM
Try using:
<a href="login.php?do=logout&u=$vbulletin->userinfo[userid]">Logout</a>
chrisisonfire
12-06-2005, 12:08 PM
<td><if condition="$bbuserinfo['userid'] == 0"> <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Login','','newlayout/header/buttons/login-on.jpg',1)"><img src="newlayout/header/buttons/login-off.jpg" alt="Log In" name="Login" width="63" height="22" border="0"></a>
<else /><a href="login.php?do=logout&u=$vbulletin->userinfo[userid]" onclick="return log_out()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Log Out','','newlayout/header/buttons/logout-on.jpg',1)"><img src="newlayout/header/buttons/logout-off.jpg" alt="Log Out" name="Log Out" width="63" height="22" border="0"></a></if></td>
This is the table for my log-in/out rollover images, the conditionals attached to them, and the links for them. I tried what you suggested, as you can see above, but upon clicking Log Out, I'm sent to an error page saying, "An error occurred while attempting to log you out. Click here to log out."
Could you check the code and tell me what I've done wrong? :nervous:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.