2009-08-25 12:16:42 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
******************************************************************
|
|
|
|
| Copyright (c) 2007-2009 Clip-Bucket.com. All rights reserved.
|
|
|
|
| @ Author : ArslanHassan
|
|
|
|
| @ Software : ClipBucket , © PHPBucket.com
|
|
|
|
*******************************************************************
|
|
|
|
*/
|
|
|
|
|
2009-09-28 05:23:50 +00:00
|
|
|
define("THIS_PAGE",'watch_video');
|
2009-11-30 19:46:45 +00:00
|
|
|
define("PARENT_PAGE",'videos');
|
2009-08-25 12:16:42 +00:00
|
|
|
require 'includes/config.inc.php';
|
2009-10-15 15:50:26 +00:00
|
|
|
$userquery->perm_check('view_video',true);
|
2009-08-25 12:16:42 +00:00
|
|
|
$pages->page_redir();
|
|
|
|
|
|
|
|
//Getting Video Key
|
|
|
|
$vkey = @$_GET['v'];
|
2011-01-25 13:23:03 +00:00
|
|
|
$vdo = $cbvid->get_video($vkey);
|
2011-02-17 15:20:22 +00:00
|
|
|
assign('vdo',$vdo);
|
2011-01-25 13:23:03 +00:00
|
|
|
if(video_playable($vdo))
|
2011-02-03 17:03:48 +00:00
|
|
|
{
|
2011-09-05 11:39:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Please check http://code.google.com/p/clipbucket/issues/detail?id=168
|
|
|
|
* for more details about following code
|
|
|
|
*/
|
|
|
|
|
|
|
|
if(SEO=='yes')
|
|
|
|
{
|
|
|
|
//Checking if Video URL is Exactly What we have created
|
|
|
|
$vid_link = videoLink($vdo);
|
|
|
|
$vid_link_seo = explode('/',$vid_link);
|
|
|
|
$vid_link_seo = $vid_link_seo[count($vid_link_seo) -1 ];
|
|
|
|
|
|
|
|
//What we are getting
|
|
|
|
$server_link = $_SERVER['REQUEST_URI'];
|
|
|
|
$server_link_seo = explode('/',$server_link);
|
|
|
|
$server_link_seo = $server_link_seo[count($server_link_seo) -1 ];
|
|
|
|
|
|
|
|
//Now finally Checking if both are equal else redirect to new link
|
|
|
|
if($vid_link_seo != $server_link_seo)
|
|
|
|
{
|
|
|
|
//Redirect to valid link leaving mark 301 Permanent Redirect
|
|
|
|
header ('HTTP/1.1 301 Moved Permanently');
|
|
|
|
header ('Location: '.$vid_link);
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-11-30 19:46:45 +00:00
|
|
|
//Checking for playlist
|
|
|
|
$pid = $_GET['play_list'];
|
|
|
|
if(!empty($pid))
|
|
|
|
{
|
|
|
|
$plist = $cbvid->action->get_playlist($pid,userid());
|
|
|
|
if($plist)
|
|
|
|
$_SESSION['cur_playlist'] = $pid;
|
2011-02-06 21:28:53 +00:00
|
|
|
}
|
2009-11-04 10:27:40 +00:00
|
|
|
//Calling Functions When Video Is going to play
|
2009-10-10 14:25:07 +00:00
|
|
|
call_watch_video_function($vdo);
|
2011-07-02 12:35:00 +00:00
|
|
|
|
2009-12-31 08:59:12 +00:00
|
|
|
subtitle($vdo['title']);
|
2011-01-24 13:47:03 +00:00
|
|
|
|
2010-02-25 14:02:12 +00:00
|
|
|
}else
|
|
|
|
$Cbucket->show_page = false;
|
2009-08-25 12:16:42 +00:00
|
|
|
|
2010-07-24 14:39:42 +00:00
|
|
|
//Return category id without '#'
|
|
|
|
$v_cat = $vdo['category'];
|
|
|
|
if($v_cat[2] =='#') {
|
|
|
|
$video_cat = $v_cat[1];
|
|
|
|
}else{
|
|
|
|
$video_cat = $v_cat[1].$v_cat[2];}
|
|
|
|
$vid_cat = str_replace('%#%','',$video_cat);
|
|
|
|
assign('vid_cat',$vid_cat);
|
|
|
|
|
2011-02-24 16:22:58 +00:00
|
|
|
|
2009-09-28 05:23:50 +00:00
|
|
|
//Displaying The Template
|
|
|
|
template_files('watch_video.html');
|
|
|
|
display_it();
|
2009-08-25 12:16:42 +00:00
|
|
|
?>
|