vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Changing the login redirect? (https://vborg.vbsupport.ru/showthread.php?t=162304)

troykristoffer 11-09-2007 07:06 PM

Changing the login redirect?
 
So,

I took the source code from the login field that appears in the navbar of vBulletin, and plugged it into my websites front page (PHP).

Login functions fine, but instead of redirecting to the forum after login, it just redirects back to the front page. To get to the forums, I click my "Forums" link, and alas, I really have been logged, but I didn't get to the forums as expected.

I realize this is NOT something vBulletin was designed to do, and accept full risk of hacking it, as minor as it may be.

I was wondering if anyone had any thoughts on how to do one of two things:
  1. Make my front page behave in a way similar to vBulletin when users login. For example: Click login, page refreshes to display the "Welcome, <username>" in place of the login form.
  2. or, and this would probably be simpler, simply get my front page login form to redirect to the front page of the forums instead of staying on the front page of my site.
Any help or input is appreciated!

-Troy

Analogpoint 11-10-2007 06:42 PM

For #2, create a plugin & choose login_redirect as the hook location, then add the following code:

Code:

$vbulletin->url = 'http://your-forum-url-here';

troykristoffer 11-11-2007 04:15 AM

WORKS BEAUTIFULLY! :)

Thanks so much!

I'm still interested in hearing ideas if anyone has them on option 1. Until then, I'm happy with #2!

Whee!

Opserty 11-11-2007 01:09 PM

It depends how the front page is coded.

If its in PHP you could edit the PHP
PHP Code:

// #########################
// TOP OF THE SCRIPT
// #########################
$curdir getcwd();
chdir('path/to/forums/');
require_once(
'global.php');
chdir($curdir);

// #####################
// Where ever its meant to go
// #####################
if($vbulletin->userinfo['userid'])
{
    echo 
'Welcome! Bla bal';
}
else
{
    echo 
'LOGIN FORM';



Analogpoint 11-11-2007 10:30 PM

All you really need to include is init.php and you save some overhead since you don't need all the code in global.php

troykristoffer 11-14-2007 02:04 AM

Thanks I'll try that!


All times are GMT. The time now is 02:49 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.01075 seconds
  • Memory Usage 1,722KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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