Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Sep 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-07-2001 Last Update: Never Installs: 2
 
No support by the author.

This hack was requested by theflow for God knows how many times.
I'm surprised no one has ever came up with a way to do this, as it's very simple.

Description: This hack lets you place a log out link on any of your pages, and it makes you go back to where you clicked the link from after you have logged out.

Files to edit: member.php.

Templates to add: redirect_logout.

Templates to edit: Any that you want to put the logout link on.

Tested on: vBulletin v2.0.3.

Installation:
1) Open members.php and find
PHP Code:
  eval("standarderror(\"".gettemplate("error_cookieclear")."\");"); 
and replace it with
PHP Code:
  $url $HTTP_REFERER;
  eval(
"standardredirect(\"".gettemplate("redirect_logout")."\",\"$url\");"); 
2) Add a template called redirect_logout and put
Code:
All cookies cleared. Please wait.
or, as a matter of fact, any other message you want to be displayed.

3) Place
Code:
<smallfont><a href="member.php?s=$session[sessionhash]&action=logout">Log Out</a></smallfont>
on any template you want to give the option to log out.

Enjoy this, and please feedback!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-08-2001, 02:14 PM
ThomasP
Guest
 
Posts: n/a
Default

Hi there,

aaah, I see, looks good. I was looking for that quite a time...

Someone came up with that solution for me:

Options -> PHP parsed code
PHP Code:
// Register button swapping
if ($bbuserinfo[userid]) { 
$registerbutton "<a href=\"member.php?s=$session[sessionhash]&action=logout\"><img src=\"images/top_logout.gif\" alt=\"Abmelden\" border=\"0\"></a>"
} else { 
$registerbutton "<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"images/top_register.gif\" alt=\"Als Benutzer registrieren\" border=\"0\"></a>"
}
// end swapping 
member.php?action=logout refers to the error_cookieclear
template

cu,
-Tom
Reply With Quote
  #3  
Old 08-08-2001, 04:16 PM
theflow theflow is offline
 
Join Date: Aug 2002
Location: San Francisco
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm confused. I tried this on your site and did not get it to work.

(1) I registered on your site.

(2) I created a new thread for testing:
http://forum.t-cove.com/showthread.php?s=&threadid=37

(3) I attempted to reply to my own message, and at the reply screen, I then logged out as "theflow", got the "cookies are cleared" message. But In attempting to go back to where I was, I reached a "you do not have permission" error, asking me for a username & password. This would make sense if your site requires you to be regsitered to post messages.

But my primary intention (among several) is to be able to have a Registered user logout at the "Reply" compose screen, get a confirmation message that "you are now logged out", and a link to "return to where you were" (as well as second link to "return to startpage" or whatever...)

So this functionality can't be tested on your site if your site requires that a user be regsitered in order to post. ... It's great to see some real effort being put into this, and perhaps you have solved it. I just don't know yet.
Reply With Quote
  #4  
Old 08-09-2001, 03:17 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Thomas.

TheFlow, you are right, I don't let unregistered users to post on my board. But you can see very clearly on the address bar that you -are- returned to the reply screen.
Reply With Quote
  #5  
Old 08-09-2001, 03:52 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I set a demo forum up, just so you could test it.
http://forum.t-cove.com/demo/
Reply With Quote
  #6  
Old 08-09-2001, 04:37 AM
theflow theflow is offline
 
Join Date: Aug 2002
Location: San Francisco
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
Ok, I set a demo forum up, just so you could test it.
http://forum.t-cove.com/demo/
I'll be damned, you sonofabitch, you did it. That which many others said couldn't be done. Congratulations. Great work.

Here's the thread that confirms it works:
http://forum.t-cove.com/demo/showthread.php?&threadid=1

I requested 3 tweeks, mostly minor I think.... I will post the "enhanced request" to vB tomorrow. This is the hack that I have been waiting for for a month, and was growing very frustrated because the logic seemed so clear and consistent -- since vB could hold the URL in one direction --- going from unreg to reg, I couldn't understand why they vB couldn't hold the URL going the other way. As you have proven, it can.
Reply With Quote
  #7  
Old 08-09-2001, 04:45 AM
theflow theflow is offline
 
Join Date: Aug 2002
Location: San Francisco
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is repeating here what I wrote at firefly's test site:

I could not understand why people were saying it was hard to hold that URL variable when the existing out-the-box vB currently does that exact thing in the following case:

(see vB thread as reference:
http://www.vbulletin.com/forum/show...&threadid=22185

1. I am unregistered and I go to a thread and hit REPLY to a post.
2. I'm at a Reply screen now. But I Click "register" at top of screen, and go through a Reg process.
3. I get my confirmation screen that I am registered. and there's a link that says "return to where you last were". I click that link.
4. I am redirected to the exact REPLY screen where I started, and now my status shows me logged in with new username.

Why is it that the system and $scriptpath can hold the URL one way but not the other?

-----------
I knew this could be solved, and I am impressed that you did it despite others saying "it's not possible". Good work.

The three tweeks I am looking for:

(1) strip out the pre-fill of the words "Unregistered" at the reply screen

(2) an option would be great such that, upon logout, I get message that cookies cleared (on my site I say "you are now logged out", plus something like this:

------------------------------------------------------------------------------
You are now logged out.

Click here to return to previous screen, or wait a few seconds to return there automatically.

Click here to return to Start page.

-------------------------------------------------------------------------------

(3) A separate request, but kind of related (i will post it later as a separate hack request): Can you find a way to pass the "unregistered name" to the Preview screen and back to the Compose screen if one wants to preview their message first, make a change, then post it? Currently, vB will not hold that username, and unregistered users who use Preview get their name stripped out, often unknowingly. Once they post it's too late because, as unregistered, they cannot edit it...

Again, excellent work firefly!
Reply With Quote
  #8  
Old 08-10-2001, 12:11 PM
SirSteve SirSteve is offline
 
Join Date: Oct 2001
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

TomasP - can you elaborate a little on where that code goes?
Reply With Quote
  #9  
Old 08-10-2001, 01:13 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On the left frame, under Styles click on Modify. There click on [fonts/colors/etc] for the style you want this in.
Insert
PHP Code:
if ($bbuserinfo[userid]) { 
$registerbutton "<a href=\"member.php?s=$session[sessionhash]&action=logout\"><img src=\"images/top_logout.gif\" alt=\"Abmelden\" border=\"0\"></a>"
} else { 
$registerbutton "<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"images/top_register.gif\" alt=\"Als Benutzer registrieren\" border=\"0\"></a>"

in the field for "PHP parsed code" (By default it's
PHP Code:
// This code is PHP4 only:
// ob_start(); 
// require("yourheader.html");
// $header = ob_get_contents(); 
// ob_end_clean(); 
).

Then, write $registerbutton wherever you want the login/logout button to appear.
Reply With Quote
  #10  
Old 08-10-2001, 01:32 PM
SirSteve SirSteve is offline
 
Join Date: Oct 2001
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked flawlessly!
Reply With Quote
Reply

Thread Tools

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:22 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09105 seconds
  • Memory Usage 2,307KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete