View Full Version : Adding pages outside the vb template
DreyerMedia
06-13-2007, 12:54 PM
Hi there,
I would like to add pages outside the vbulletin forum templates, that only can be viewed forum members (and if possible, spesific groups only).
Any code snipples I can add to the pages?
Dismounted
06-14-2007, 07:11 AM
<?php
$cur_dir = getcwd();
chdir('/path/to/vbforum/');
require_once('./global.php');
chdir($cur_dir);
if (!is_member_of($vbulletin->userinfo, 4, 5, 6)
{
print_no_permission();
}
?>
This would deny everyone except if they are from usergroup id's 4, 5 and 6.
jhonka
06-22-2007, 12:11 PM
<?php
$cur_dir = getcwd();
chdir('/path/to/vbforum/');
require_once('./global.php');
chdir($cur_dir);
if (!is_member_of($vbulletin->userinfo, 4, 5, 6)
{
print_no_permission();
}
?>
This would deny everyone except if they are from usergroup id's 4, 5 and 6.
Corrected code.
<?php
$cur_dir = getcwd();
chdir('/path/to/vbforum/');
require_once('./global.php');
chdir($cur_dir);
if (!is_member_of($vbulletin->userinfo, 4, 5, 6))
{
print_no_permission();
}
?>
) was missing, You should at least read the code before hitting submit. ;)
Thanks for this quick tutorial :D
Regards,
jhonka
quitsmoking
06-26-2007, 11:00 AM
OK What is if I want to create this page on another subdomain? Should I use the same code for remote file?
Dismounted
06-26-2007, 11:22 AM
Is the subdomain on the same server? Can they access each others files internally?
quitsmoking
06-26-2007, 12:43 PM
Thank you, Dismounted. The subdomains are all on the same server. Yes I changed the path internally and this method works. But I still have these questions:
1. Will this method (chdir, etc.) affect my own script that is on the other subdomain? Will it be heavier? Will it produce any errors? Are there any functions that I should not run in the script?
2. What are the variables that I can retrieve and how? For example, I need to retrieve:
UserID
Username
Email
Member Level (regular, admin, etc.)
Thank you.
Never mind. Got that :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.