Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Restrict/allow users/groups - non vb pages Details »»
Restrict/allow users/groups - non vb pages
Version: 1.00, by VirtualBurn VirtualBurn is offline
Developer Last Online: Apr 2006 Show Printable Version Email this Page

Version: 3.0.8 Rating:
Released: 07-30-2005 Last Update: Never Installs: 8
 
No support by the author.

This hack will enable you to;
  • Stop Guests viewing non-vb pages
  • Stop Registered users viewing non-vb pages
  • Prompt with custom information
  • Allow 'specified' Group to access

For example:

This code stops my guests (ID:0) and my registered users (ID:2) from accesing the non-vb pages but with let the 'Premium Member' group (ID:9) walk right in.

################################################## ##

1. Create new phrase [ACP --> Lang & Phrases --> Phrase Manager --> Add New Phrase]

Phrase Type: Permissions
Varname: nonvb_restrict
Text: Your Message

e.g.
Code:
Ticket support & Live support is an advanced feature only available to 'Premium Members'.<br /><br />
Please use the subscription service to enable this feature.
################################################## ##

2. Create new Template [ACP --> Styles & Templates --> Style Manager --> Add new template]

Style: Default style
Title: nonvb_restrict
template: Copy below
Code:
$stylevar[htmldoctype]
<html id="vb" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $pagetitle</title>
$headinclude
</head>
<body>
$header
$navbar

<table border="2" width="100%" cellspacing="1" cellpadding="1" >
<tr>
<td class="tcat">
Notice!
</td>
</tr>
<tr>
<td class="alt1" align="center"><br />
$vbphrase[nonvb_restrict]
<br /><br />
</td></tr>
</table>

$footer
</body>
</html>
################################################## ##

3. Protect Pages

In each of the non-vb pages you wish to protect find:
Code:
require_once("./global.php");
and add the following code after:
Code:
// ## NONVB_RESTRICT ##

 

if ($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 2 and !is_member_of($bbuserinfo, 9))

{  
	eval('print_output("' . fetch_template('nonvb_restrict') . '");'); 
}  

// ## END OF NONVB_RESTRICT
change the numbers in red as you desire.
  • 0 = user ID 'Guest'
  • 2 = group ID 'Registered'
  • 9 = group ID 'Premium'

This has been tested, implemented and working.

Original code by 'Gary King' although his hack was different, various questions and suggestions throughout the thread prompted me to put this together.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-01-2005, 04:48 AM
Corriewf's Avatar
Corriewf Corriewf is offline
 
Join Date: Dec 2004
Location: parse error
Posts: 799
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AWESOME JOB! I have an irc chat page which is not integrated with vb so this helps alot.
Reply With Quote
  #3  
Old 08-01-2005, 04:49 AM
Corriewf's Avatar
Corriewf Corriewf is offline
 
Join Date: Dec 2004
Location: parse error
Posts: 799
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh and could you please attach a zip file with the instructions please?
Reply With Quote
  #4  
Old 08-01-2005, 11:55 PM
VirtualBurn VirtualBurn is offline
 
Join Date: Nov 2003
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All the instructions are above.

That is the same reason I put this together, I have a live support page which uses PJirc, I also use it to restrict groups to the ticket support system.

Once you have configured the last bit of code, you can insert it into any of your vb or non-vb pages so they will see your custom message instead of the standard vb 'you do not have permission to view this page'
Reply With Quote
  #5  
Old 08-02-2005, 12:34 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a note:

You can remove:
PHP Code:
 $membergroups explode(',',$bbuserinfo[membergroupids]); 
and replace
PHP Code:
!array_search(9,$membergroups
with
PHP Code:
!is_member_of($bbuserinfo9
as vBulletin does this for you.
Reply With Quote
  #6  
Old 08-02-2005, 01:34 AM
VirtualBurn VirtualBurn is offline
 
Join Date: Nov 2003
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's real good of you to advise some changes, thanks alot.
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:55 PM.


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.04144 seconds
  • Memory Usage 2,253KB
  • Queries Executed 19 (?)
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
  • (4)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)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