include("classy/class.classy.php");
$page = new classy_page(); //create instance of classy page
//$page->track(true);
include("config.php");
if(isset($_SESSION)==false){
session_start();
}
$access=false;
$SEL_QUERY=mysql_query("select userid from tbluser where username='".$_SESSION['PST_ADMIN']."'");
if($data=mysql_fetch_array($SEL_QUERY)) {
$userid = $data['userid'];
}
$id = sanitize($_GET['id']);
$SEL_QUERY=mysql_query("SELECT * FROM tblvideo WHERE videoid='$id'");
$data = mysql_fetch_array($SEL_QUERY);
$titleid = $data['titleid'];
$videoid = $data['videoid'];
$filename = $data['filename'];
$filename2 = $data['filename2'];
$iconfilename = $data['iconfilename'];
$videotitle = cleanUp($data['title']);
$tags = $data['tags'];
$description = cleanUp($data['description']);
$public = $data['public'];
if ($public) {
$access = true;
}
$access = get_access($titleid, $userid, "video");
//track video view
track_video($id, $userid);
?>
if ($videotitle) { echo $videotitle; } else { echo "No Video Selected"; }?>
$parent = mysql_fetch_array(mysql_query("select title,iconfilename,artfilename,description FROM tbltitle WHERE titleid='$titleid'"));
$title = cleanUp($parent['title']);
$titleicon = $parent['iconfilename'];
$artfilename = $parent['artfilename'];
$titledescription = cleanUp($parent['description']);
$sql = "select videoid from tblvideo where titleid = '$titleid' order by videoid asc";
$result = mysql_query($sql);
if (mysql_num_rows($result) > 0) {
//$counter = 1;
while( $row = mysql_fetch_array($result) ) {
$vid = $row['videoid'];
$video_array[] = $vid;
//$counter++;
}
}
//print_r($video_array);
$cur_key = array_search($id, $video_array);
$next_key = $cur_key + 1;
$prev_key = $cur_key - 1;
//create next prev menu
//prev btn
//echo "$prev_key | $cur_key | $next_key";
if ($prev_key >= 0) {
$prev_id = $video_array[$prev_key];
$vid_menu = "
<< Prev ";
}
if ($video_array[$next_key] != "") {
$next_id = $video_array[$next_key];
$vid_menu .= "
Next >> ";
}
/*
$nid=$id+1;
$nxt_query=mysql_query('SELECT * FROM tblvideo WHERE videoid='.$nid);
$nxt=mysql_fetch_array($nxt_query);
if ($nxt) {
$nxtid=$nid;
} else {
$nxtid=false;
}
$pid=$id-1;
$prv_query=mysql_query('SELECT * FROM tblvideo WHERE videoid='.$pid);
$prv=mysql_fetch_array($prv_query);
if ($prv) {
$prvid=$pid;
} else {
$prvid=false;
}
*/
?>
if ($access) {
echo "";
//check to see if filename is a pdf
if (strpos($filename, "pdf") > 0) {
echo '

Click here to view eBook';
} else if ($filename == "") {
echo '

';
} else {
include("video_display2.php");
echo "
$vid_menu
";
}
} else {
echo '

';
}
?>
if ($_SESSION['PST_ADMIN'] != "") {
$favorite = add_fave($userid, 'video', $videoid);
echo $favorite;
}
?>
echo '
Tags: ';
$alltags = preg_split('/, /', $tags);
foreach ($alltags as $tg) {
echo ''.$tg.' ';
}
echo '
';
?>

From:
if (!$access) {
if ($userid != "") {
echo "
Sorry, you do not have access to this video.
";
} else {
echo "
Please
Login to view this item.
";
}
}
?>
if ($_SESSION['PST_ADMIN']=="") { ?>
} ?>
Other videos from this title: