Try something like this. (untested)
PHP Code:
<?php
$curdir = getcwd ();
chdir('/home/myforumpath.com/forum');
@include('/home/myforumpath.com/forum/global.php');
chdir ($curdir);
if (!$vbulletin->userinfo['userid'])
{
// not logged in
echo "<html>";
echo "<head>";
echo "<title>";
echo "Restricted Area";
echo "</title>";
echo "</head>";
echo "<body>";
@require_once('/home/pathtomyforum/login_inc.php'); //login_inc.php shows a login panel
echo "<br />Access only for members of group 17.";
echo "</body>";
echo "</html>";
}
else
{
// logged in
if (!is_member_of($vbulletin->userinfo, 17))
{
// not a member of group 17
echo "<html>";
echo "<head>";
echo "<title>";
echo "Restricted Area";
echo "</title>";
echo "</head>";
echo "<body>";
echo "<br />Access only for members of group 17.";
echo "</body>";
echo "</html>";
}
else
{
// show the movies
$id = intval($_GET['id']);
switch ($id) {
case 1:
$file = "movies/showitifid1.avi";
$content_len = @filesize($file);
header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Datum in der Vergangenheit
header('Pragma: no-cache'); //HTTP/1.0
header("Content-type: video/x-msvideo");
header("Content-type: octet-stream");
header('Content-Disposition: attachment; filename="'.$file.'"');
if($content_len!=FALSE)
{
header("Content-length: $content_len");
}
readfile($file);
break;
case 2:
$file = "movies/showitifid2.avi";
$content_len = @filesize($file);
header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Datum in der Vergangenheit
header('Pragma: no-cache'); //HTTP/1.0
header("Content-type: video/x-msvideo");
header("Content-type: octet-stream");
header('Content-Disposition: attachment; filename="'.$file.'"');
if($content_len!=FALSE)
{
header("Content-length: $content_len");
}
readfile($file);
break;
}
}
}
?>