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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2007, 09:38 PM
trgreen trgreen is offline
 
Join Date: Oct 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How do I make login.php go to my vBadvanced home page, rather than to the forums?

When people log in, they are taken to my forums: http://www.example.com/forums/

I just realized that they might not ever see the home page that is at: http://www.example.com/ (which is my vBadvanced home page)

How can I get login.php to always go to the vBadvanced home page instead of the forums? I looked in the code, and it looked like I could easily break it. I'm okay in PHP, but certainly not an expert.

I also tried changing the 'forumhome' variable in the vB settings, but of course that broke all kind of stuff. Any help appreciated!
Reply With Quote
  #2  
Old 09-21-2007, 05:22 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to set $vbulletin->url to your home page before the redirect is called. THis can be achieved using plugins.
Reply With Quote
  #3  
Old 09-21-2007, 05:23 AM
trgreen trgreen is offline
 
Join Date: Oct 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for responding! Can you elaborate just a little bit?
Reply With Quote
  #4  
Old 09-21-2007, 05:43 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Set $vbulletin->url to the URL. The hook should be login_redirect.
Reply With Quote
  #5  
Old 09-21-2007, 05:51 AM
trgreen trgreen is offline
 
Join Date: Oct 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much! I had no idea it was that easy to make a plug-in.
Reply With Quote
  #6  
Old 10-17-2007, 10:44 AM
too_cool_3's Avatar
too_cool_3 too_cool_3 is offline
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After following the instructions given here by the thread starter:

http://www.vbadvanced.com/forum/show...692#post126692
Quote:
Originally Posted by trgreen View Post
I got some help over at vbulletin.org. Turns out you have to make a plugin. Here's the thread: https://vborg.vbsupport.ru/showthrea...31#post1343631

But here's how you do it... it's pretty easy:

1. In Admin, click "Add New Plugin" under the "Plugins & Products" menu
2. For "Product" choose vBulletin
3. For "Hook Location" choose "Login Redirect" under "vBulletin: Login / Logout" - It's basically in alphabetical order. Look for the "L" part of the list.
4. Enter a Title, whatever you want, like "Login redirect to vBadvanced home page"
5. For "Execution Order" I just left it at 5. They all seem to be 5.
6. For "Plugin PHP Code" here's the code. Just use the URL you want it to go to after they log in.
Code:
$vbulletin->url = 'http://yourhomepage.com';

7. BE sure to check "Yes" under "Plugin is Active." It defaults to "No."
8. Click "Save"

Note: This will work, but it makes it a little strange when you login to the Admin CP. For example: I right-click "Admin" and open it in a new Tab. When you login to get to the Admin CP, it will open your site in the "main" frame. Thats okay... just choose the link you want on the left. That's it.


I started experiencing this problem described in the Note: as well.. even when i left click it brings up the admincp login page but after i input my info it brings me right back to the mainpage?!?
Then i have to click admincp again and it will then go to the admincp. This is getting really annoying, anyway to fix it?
Reply With Quote
  #7  
Old 10-17-2007, 12:11 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by too_cool_3 View Post
Then i have to click admincp again and it will then go to the admincp. This is getting really annoying, anyway to fix it?
Just a quick guess but what about if you wrap it in an if() statement to check the current setting?
E.g.
PHP Code:
if($vbulletin->url != $vbulletin->options['bburl'].'/admincp/index.php')
{
    
// $vbulletin->url...

That probably won't work but you could maybe run some testing or something and see if you can get it to work.
Reply With Quote
  #8  
Old 10-17-2007, 03:52 PM
trgreen trgreen is offline
 
Join Date: Oct 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I agree. It's definitely annoying, but really it's just a few extra clicks. Worth it in my mind to make sure your users see your vBa home page. Has anyone tried the recommended fix above? I'd be curious to know if it works.
Reply With Quote
  #9  
Old 10-17-2007, 06:33 PM
too_cool_3's Avatar
too_cool_3 too_cool_3 is offline
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll give it a shot in a couple hours after my classes r done. Gotta run to my Networking Essentials class, I'll post back once I've tried it :up:

--------------- Added 17 Oct 2007 at 17:46 ---------------

I just tried using this code:

if($vbulletin->url != 'http://www.tbaec.ca';
$vbulletin->options['bburl'].'/admincp/index.php')
{
// $vbulletin->url = 'http://www.tbaec.ca';
}

...and yes, it worked! BUT... every time I loged into an account I get this ERROR at the top of the page:


Parse error: parse error, unexpected ';' in /home/content/b/i/g/bigsac/html/includes/functions_login.php(312) : eval()'d code on line 1

So then I tried this code:

if($vbulletin->url != $vbulletin->options['bburl'].'/admincp/index.php')
{
// $vbulletin->url = 'http://www.tbaec.ca';
}

and IT WORKED PERFECT!!!...
Enjoy!
p.s. Thx Opserty for providing the original code

trgreen, you should now update your thread over at vbadvanced.com(http://www.vbadvanced.com/forum/show...692#post126692) to reflect the new code and maybe put a note in the first post of this thread, as to avoid other people having a problem with their admincp... hope this code is as helpfull to you as it was me in solving that annoying issue.
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 09:27 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.11653 seconds
  • Memory Usage 2,247KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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