The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
modding navbar/header template links, require assistance!
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 irate: (for the sake of Pirate smilies.) |
#2
|
|||
|
|||
This is just controlled by template conditionals i think.
|
#3
|
|||
|
|||
Well if anyone could explain to me how to use conditionals to achieve what I'm after, it'd be much appreciated.
|
#4
|
|||
|
|||
HTML Code:
<if condition="$vbulletin->userinfo[userid]"> ....code for logged in users </else> ...code for guests </if> |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
Quote:
|
#7
|
|||
|
|||
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: Code:
/login.php?do=logout&u=[userid] Thanks! |
#8
|
|||
|
|||
Try using:
HTML Code:
<a href="login.php?do=logout&u=$vbulletin->userinfo[userid]">Logout</a> |
#9
|
|||
|
|||
HTML Code:
<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> Could you check the code and tell me what I've done wrong? :nervous: |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|