The Arcive of vBulletin Modifications Site. |
|
Restrict/allow users/groups - non vb pages Details »»
|
|||||||||||||||||||||||||||
|
Restrict/allow users/groups - non vb pages
Developer Last Online: Apr 2006
This hack will enable you to;
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");
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
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
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
AWESOME JOB! I have an irc chat page which is not integrated with vb so this helps alot.
|
|
#3
|
||||
|
||||
|
Oh and could you please attach a zip file with the instructions please?
|
|
#4
|
|||
|
|||
|
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' |
|
#5
|
||||
|
||||
|
Just a note:
You can remove: PHP Code:
PHP Code:
PHP Code:
|
|
#6
|
|||
|
|||
|
That's real good of you to advise some changes, thanks alot.
|
![]() |
|
|