vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   If 'Guest' or 'Newbie' then redirect (https://vborg.vbsupport.ru/showthread.php?t=257913)

Tyraunt 01-27-2011 03:25 PM

If 'Guest' or 'Newbie' then redirect
 
Hello,

I want to redirect a specific forum if a 'Guest' or 'Newbie' views it unless they are promoted to the usergroup which will be able to view this forum. Thanks

borbole 01-27-2011 04:27 PM

Quote:

Originally Posted by Tyraunt (Post 2155298)
Hello,

I want to redirect a specific forum if a 'Guest' or 'Newbie' views it unless they are promoted to the usergroup which will be able to view this forum. Thanks

Try this:

Go to your Plugin Manager at your Acp and create a new plugin. For the hook location choose:

forumdisplay_start

Then for the php code add this:

PHP Code:

global $foruminfo

$redirectforums = array(1,2,3);

if(!
$vbulletin->userinfo['userid'] AND in_array($foruminfo['forumid'], $redirectforums))
{
$vbulletin->url 'http://www.redirecturl.com';



Then replace1,2,3 with the id of the forums where you want to resdirect the guests when viewing the redirect forums.

Also, replace

Code:

http://www.redirecturl.com

with the actual url of where you want to redirect your guests when viewing those particular forums.


To do the same if the guests will view the latest post at those particular forums, add the exact php code for the the showthread_start hook location as well. (create a new plugin).

Hope it helps.

borbole 01-28-2011 05:55 PM

Did the above suggestion work for you Tyraunt?

Tyraunt 02-24-2011 06:11 PM

Sorry for the late reply, no it didn't work but the syntax code is 3.0 and not 4.0.

Tyraunt 02-26-2011 01:37 PM

Bump!

Lynne 02-26-2011 03:45 PM

What do you mean the syntax code is 3.0 and not 4.0? It looks just fine to me for 3.x or 4.x (php is php in either version). Did you actually try the code or did you just assume it wouldn't work?

instanticity 02-26-2011 04:46 PM

How would I do this for the entire forum page?

Lynne 02-26-2011 04:58 PM

Quote:

Originally Posted by instanticity (Post 2167193)
How would I do this for the entire forum page?

Do what exactly? You need to be much more specific and actually since it sounds like you are not asking for the same thing, you should start your own thread being specific with what you want.

instanticity 02-26-2011 05:38 PM

I want to redirect guests to a non-VB landing page as opposed to showing them the error log ni page. Forum is open to members only. I did start a new thread, but ran across this thread which sounds very similar to what I want to achieve. Most place get angry when you start a new thread about a topic already being discussed, redirecting guests.

Lynne 02-26-2011 06:19 PM

If you have the exact same issue as in this thread, then the answer is exactly the same.


All times are GMT. The time now is 12:53 AM.

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.00973 seconds
  • Memory Usage 1,732KB
  • 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
  • (2)bbcode_quote_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