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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-11-2009, 07:41 AM
Exstedt Exstedt is offline
 
Join Date: Apr 2009
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Creating a logout button in the header area

Hi all,

I'm trying to create a logout button in my header navibar, mainly because my current style doesn't have one by the username/password area.

I'm new at this, and the only code I've tried to use was

Code:
<td><a href="login.php?do=logout&logouthash" accesskey="6"><img src="$stylevar[imgdir_misc]/log_off.gif" width="90" height="25" border="0"></a></td>
But when I press the button, I keep getting an error message (vbulletin message).

"An error occurred while attempting to log you out. Click here to log out."

When I proceed to click that link, I'm logged out just fine, but I'd rather not have everyone do that.

Any help on what code to use to allow people to log out would be appriciated.

Thank you,
regards
Yngve

--------------- Added [DATE]1239440235[/DATE] at [TIME]1239440235[/TIME] ---------------

I managed to make it with the use of the "similar threads" below

/close

--------------- Added [DATE]1239443961[/DATE] at [TIME]1239443961[/TIME] ---------------

/REOPENED

I spoke too soon. I'm now experiencing issues when i try to LOG IN to the forums. I type my information in, and press the Login button. I get the welcome message, and my nickname is visible on the Who's Online listing below, however I'm still just a Guest as if I didn't log in at all. The only way I've been able to log in and get control over my registered account is through the admin control panel.

The objective was to get a logout button working.

What I did
In the header code:

- ADDED
Code:
<!-- member logout button -->
<td align="$stylevar[right]">
<a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')"><img src="$stylevar[imgdir_misc]/log_off.gif" 
border="0" width="90" height="25" alt="<phrase 1="$bbuserinfo[username]">$vbphrase[log_out_x]</phrase>"></a></td>
<!-- end member logout -->
In the FORUMHOME
-REMOVED
Code:
Everything between <!-- member logout -->
        
        <!-- end member logout -->
Mainly because I thought the addition of the initial code could be in conflict with the latter.

I found these codes in the 'similar threads' below.

Many thanks for advice and help to fix my Login.

Regards,
Yngve

--------------- Added [DATE]1239461500[/DATE] at [TIME]1239461500[/TIME] ---------------

Is anyone able to help? Perhaps I'm not good enough at explaining what is happening.
Reply With Quote
  #2  
Old 04-11-2009, 03:05 PM
Mr-Moo Mr-Moo is offline
 
Join Date: Sep 2007
Location: Chicago, IL.
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are missing the IF commands and some other key user information. Please refer to my example below (which you can copy+paste into your template).

PHP Code:
        <if condition="$show['member']">
            <
td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]onclick="return log_out()">$vbphrase[log_out]</a></td>
        </if> 
Please let me know if this works,
Thank you
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 02:41 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.07741 seconds
  • Memory Usage 2,172KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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_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