vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to make the CMS tab the default page after login? (https://vborg.vbsupport.ru/showthread.php?t=255848)

shooptek 12-24-2010 03:00 PM

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!

Lynne 12-24-2010 03:33 PM

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.

shooptek 12-24-2010 07:12 PM

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!

CroNiX 12-24-2010 07:21 PM

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.

shooptek 12-24-2010 07:58 PM

That worked perfect!

Thanks so much for the help!

CroNiX 12-24-2010 08:00 PM

You're welcome. Happy holidays :)

shooptek 12-26-2010 02:38 PM

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.

CroNiX 12-26-2010 06:17 PM

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.

shooptek 12-28-2010 03:14 AM

Beautiful thanks so much!

jiffylb1 12-28-2010 05:48 PM

awsome thanks for tips


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