I would also like to know something like this. I am running a 3rd party video gallery for my site and laready have it so that user registration is required to view the gallery but I would like to know who to restrict it further to just members of several usergroups (for promotional purposes).
Here is my current PHP file, please note that this is located outside the forum directory of course-
PHP Code:
<?
session_start();
if (substr($_SERVER['PHP_SELF'], -9) != "index.php") {
header('Location:' . $url . '/index.php');
}
define('SCRIPT_PATH',"includes");
require_once (SCRIPT_PATH .'/mysql.inc.php');
define('DIR_PATH',"$dir_path");
require_once (DIR_PATH .'/includes/getlang.php');
require_once (DIR_PATH .'/includes/global.php');
if (!isset($HTTP_COOKIE_VARS['bbuserid'])) {
$bbuserid=0;
$logged=0;
} else {
$logged=($user=$HTTP_COOKIE_VARS['bbuserid']);
}
if ($logged >= "1") {
$time_start = getmicrotime();
require_once (DIR_PATH .'/includes/functions.gal.php');
require_once (DIR_PATH .'/includes/player.inc.php');
include_once (DIR_PATH .'/header.php');
require_once (DIR_PATH .'/includes/gallery.inc.php');
$time_end = getmicrotime();
show_queries($time_start,$time_end);
include_once (DIR_PATH .'/footer.php');
} else {
echo "<div align=center>You must be logged in and a registered user of the Trackpads Community.<br><br>";
echo "Please click <a href=http://www.trackpads.com/forum/login.php><i><b>here</b></i></a> ";
echo "to login first...<br><br>Or click <a href=http://www.trackpads.com/forum/register.php><i>";
echo "<b>here</b></i></a> to register with Trackpads.";
echo "Registration only takes a minute and is free!</div>";
}
ob_end_flush();
?>
Thanks in advance for any help,
-Jason