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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2010, 03:00 PM
shooptek shooptek is offline
 
Join Date: Feb 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to make the CMS tab the default page after login?

Hey all,
So when a user logs in they are automatically brought to the forum page. I would like them to be brought to the Home/CMS page. Anyone know how to do this?

I assume I have to edit a template I just dont know which one.

Thanks in advance!
Reply With Quote
  #2  
Old 12-24-2010, 03:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check out the function do_login_redirect in functions_login.php and then notice you have a hook at login_redirect to do what you want with a plugin.
Reply With Quote
  #3  
Old 12-24-2010, 07:12 PM
shooptek shooptek is offline
 
Join Date: Feb 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, but I dont have much experience working with the functions in vBull. Could you give me a bit more detail to help me get through it?

Thanks!
Reply With Quote
  #4  
Old 12-24-2010, 07:21 PM
CroNiX CroNiX is offline
 
Join Date: Dec 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Someone made a plugin that does what Lynne is talking about (and more). Haven't used it, so no comment...but you might check it out.

https://vborg.vbsupport.ru/showthread.php?t=235203

--------------- Added [DATE]1293226751[/DATE] at [TIME]1293226751[/TIME] ---------------

Or if you want to only do what you asked:

Go to Admin CP / Plugins & Products
Add new Plugin

Fill in the following Fields
Product: vBulletin
Hook Location: login_redirect
Title: Login Redirect to homepage (or whatever you want to call it)
Execution Order: 5
Plugin PHP Code:
PHP Code:
$vbulletin->url 'http://www.yoursite.com/the-url'
Plugin is Active? Yes

Obviously just substitute the "http://www.yoursite.com/the-url" with the url you want it to redirect to.

Save it.

It should work now.
Reply With Quote
  #5  
Old 12-24-2010, 07:58 PM
shooptek shooptek is offline
 
Join Date: Feb 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That worked perfect!

Thanks so much for the help!
Reply With Quote
  #6  
Old 12-24-2010, 08:00 PM
CroNiX CroNiX is offline
 
Join Date: Dec 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're welcome. Happy holidays
Reply With Quote
  #7  
Old 12-26-2010, 02:38 PM
shooptek shooptek is offline
 
Join Date: Feb 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay still have one slight problem.

Now, when I log-in to my admin cp or one of my mods logs in to the mod cp, it also brings them back to the homepage rather than forwarding to the proper cp. If we then go ahead and click on the admin or mod link at the bottom of the page again, after being forwarded to the homepage, it brings us to the appropriate page.

Any way to use an if/then type statement to fix this?

If not, I can deal with it. Its not that big of a deal and is worth it to have regular members redirected to the homepage.
Reply With Quote
  #8  
Old 12-26-2010, 06:17 PM
CroNiX CroNiX is offline
 
Join Date: Dec 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This should work:
PHP Code:
if ( ! is_member_of($vbulletin->userinfo567))
{
    
$vbulletin->url 'http://www.site.com';

Assuming you haven't changed any of the default usergroups.
It should not redirect for members of these groups:
5=Supermod
6=Admin
7=Mod

Add or remove groups as appropriate.
Reply With Quote
  #9  
Old 12-28-2010, 03:14 AM
shooptek shooptek is offline
 
Join Date: Feb 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Beautiful thanks so much!
Reply With Quote
  #10  
Old 12-28-2010, 05:48 PM
jiffylb1's Avatar
jiffylb1 jiffylb1 is offline
 
Join Date: Aug 2006
Location: clearwater
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

awsome thanks for tips
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 07:38 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.04198 seconds
  • Memory Usage 2,251KB
  • 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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)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_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