Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Redirect To Page Viewed Before Login Details »»
Redirect To Page Viewed Before Login
Version: 1.00, by armatik armatik is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.8 Rating:
Released: 09-24-2007 Last Update: Never Installs: 11
Code Changes  
No support by the author.

This hack simply makes the browser redirect back to the page you were viewing before you logged in when you log in. I myself was getting pretty pissed off when I'd get logged out of the admin panel and log in, to find myself at the bloody forum home. Also useful for login boxes outside of the forums.

Anyway, this is what you do. First, go to login.php and (by default line 136) find:

PHP Code:
exec_header_redirect($vbulletin->options['forumhome'] . '.php'); 
And replace with:

PHP Code:
$vbulletin->input->clean_gpc('s''REQUEST_URI'TYPE_NOHTML);
exec_header_redirect($vbulletin->GPC['REQUEST_URI']); 
I'm not sure exactly if you need to clean the $_SERVER variable, or if I even cleaned it right, but I did it just incase.

Next, go to /includes/functions_login.php, and (by default on line 292) find:

PHP Code:
$vbulletin->url $vbulletin->options['forumhome'] . '.php' $vbulletin->session->vars['sessionurl_q']; 
And replace it with:

PHP Code:
$vbulletin->input->clean_gpc('s''REQUEST_URI'TYPE_NOHTML);
$vbulletin->url $vbulletin->GPC['REQUEST_URI'] . $vbulletin->session->vars['sessionurl_q']; 
And that's it!

Show Your Support

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

Comments
  #2  
Old 09-26-2007, 01:12 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well there is the link by default that says return to page previously viewing, I suppose this just makes it auto, but it was never a huge concern for myself. Thanks for sharing it anyway.
Reply With Quote
  #3  
Old 09-26-2007, 01:23 AM
armatik armatik is offline
 
Join Date: Aug 2007
Location: Atlanta, GA
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, not when you logout, I mean when you login, it automatically takes you to the forum homepage.
Reply With Quote
  #4  
Old 09-26-2007, 01:41 AM
FreshFroot's Avatar
FreshFroot FreshFroot is offline
 
Join Date: Jul 2005
Posts: 770
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack.. too bad it can't be a plugin
Reply With Quote
  #5  
Old 10-11-2007, 06:56 PM
armatik armatik is offline
 
Join Date: Aug 2007
Location: Atlanta, GA
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's a little bug with this.. for some reason it creates an endless loop in some places because of the little redirecting thing vbulletin has. If anyone wants to help out and fix that bit too, I'd be eternally grateful.
Reply With Quote
  #6  
Old 10-30-2007, 11:34 PM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any update on this?
Reply With Quote
  #7  
Old 10-30-2007, 11:42 PM
armatik armatik is offline
 
Join Date: Aug 2007
Location: Atlanta, GA
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm afraid not, I haven't been able to find a way around this without doing some serious modifications to more than just a few files.
Reply With Quote
  #8  
Old 10-31-2007, 12:04 AM
gwerzal's Avatar
gwerzal gwerzal is offline
 
Join Date: Oct 2007
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this for if you don't tick the remember me box and it logs you out.
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 06:49 AM.


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.04550 seconds
  • Memory Usage 2,273KB
  • Queries Executed 21 (?)
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
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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