Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-04-2005, 11:52 PM
chrisisonfire chrisisonfire is offline
 
Join Date: Apr 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.)
Reply With Quote
  #2  
Old 12-05-2005, 05:14 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is just controlled by template conditionals i think.
Reply With Quote
  #3  
Old 12-05-2005, 08:55 AM
chrisisonfire chrisisonfire is offline
 
Join Date: Apr 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well if anyone could explain to me how to use conditionals to achieve what I'm after, it'd be much appreciated.
Reply With Quote
  #4  
Old 12-05-2005, 09:29 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<if condition="$vbulletin->userinfo[userid]">
....code for logged in users
</else>
...code for guests
</if>
Reply With Quote
  #5  
Old 12-05-2005, 10:44 AM
chrisisonfire chrisisonfire is offline
 
Join Date: Apr 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 12-05-2005, 11:09 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 12-05-2005, 08:14 PM
chrisisonfire chrisisonfire is offline
 
Join Date: Apr 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #8  
Old 12-06-2005, 05:54 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try using:
HTML Code:
<a href="login.php?do=logout&amp;u=$vbulletin->userinfo[userid]">Logout</a>
Reply With Quote
  #9  
Old 12-06-2005, 12:08 PM
chrisisonfire chrisisonfire is offline
 
Join Date: Apr 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:13 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.04966 seconds
  • Memory Usage 2,246KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete