Back to vBulletin 3.0 Add-Ons

Restrict/allow users/groups - non vb pages
Mod Version: 1.00, by VirtualBurn

This modification is in the archives.
vB Version: 3.0.8 Rating: (0 vote - 0 average) Installs: 8
Released: 31 Jul 2005 Last Update: Never Downloads: 1
Not Supported  

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.

Download

No files for download.

Screenshots

 


vblts.ru supports vBulletin®, 2022-2024