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 01-27-2011, 03:25 PM
Tyraunt Tyraunt is offline
 
Join Date: Dec 2010
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 01-27-2011, 04:27 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tyraunt View Post
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.
Reply With Quote
  #3  
Old 01-28-2011, 05:55 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did the above suggestion work for you Tyraunt?
Reply With Quote
  #4  
Old 02-24-2011, 06:11 PM
Tyraunt Tyraunt is offline
 
Join Date: Dec 2010
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for the late reply, no it didn't work but the syntax code is 3.0 and not 4.0.
Reply With Quote
  #5  
Old 02-26-2011, 01:37 PM
Tyraunt Tyraunt is offline
 
Join Date: Dec 2010
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump!
Reply With Quote
  #6  
Old 02-26-2011, 03:45 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 02-26-2011, 04:46 PM
instanticity instanticity is offline
 
Join Date: Jan 2011
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I do this for the entire forum page?
Reply With Quote
  #8  
Old 02-26-2011, 04:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by instanticity View Post
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.
Reply With Quote
  #9  
Old 02-26-2011, 05:38 PM
instanticity instanticity is offline
 
Join Date: Jan 2011
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 02-26-2011, 06:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have the exact same issue as in this thread, then the answer is exactly the same.
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 10:39 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04400 seconds
  • Memory Usage 2,250KB
  • Queries Executed 11 (?)
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
  • (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_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