vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   modding navbar/header template links, require assistance! (https://vborg.vbsupport.ru/showthread.php?t=102239)

chrisisonfire 12-04-2005 11:52 PM

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

: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

HTML Code:

<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

Quote:

Originally Posted by chrisisonfire
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:

Code:

/login.php?do=logout&u=[userid]
...or what? :ermm:

Thanks!

Marco van Herwaarden 12-06-2005 05:54 AM

Try using:
HTML Code:

<a href="login.php?do=logout&amp;u=$vbulletin->userinfo[userid]">Logout</a>

chrisisonfire 12-06-2005 12:08 PM

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&amp;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:


All times are GMT. The time now is 08:43 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.01041 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete