vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Redirect To Page Viewed Before Login (https://vborg.vbsupport.ru/showthread.php?t=158752)

armatik 09-24-2007 10:00 PM

Redirect To Page Viewed Before Login
 
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! :D

Hornstar 09-26-2007 01:12 AM

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.

armatik 09-26-2007 01:23 AM

No, not when you logout, I mean when you login, it automatically takes you to the forum homepage.

FreshFroot 09-26-2007 01:41 AM

great hack.. too bad it can't be a plugin :(

armatik 10-11-2007 06:56 PM

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. :)

yoyoyoyo 10-30-2007 11:34 PM

any update on this?

armatik 10-30-2007 11:42 PM

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.

gwerzal 10-31-2007 12:04 AM

Is this for if you don't tick the remember me box and it logs you out.


All times are GMT. The time now is 09: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.01114 seconds
  • Memory Usage 1,730KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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