-
Notifications
You must be signed in to change notification settings - Fork 0
/
watch_video.php
70 lines (65 loc) · 2.01 KB
/
watch_video.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* File: watch_video
* Description: FIle used to display watch video page
* @author: Arslan Hassan, Saqib Razzaq
* @since: 2007
* @website: clip-bucket.com
* @modified: Feb 26, 2016 ClipBucket 2.8.1 [ Saqib Razzaq ]
*/
define("THIS_PAGE",'watch_video');
define("PARENT_PAGE",'videos');
require 'includes/config.inc.php';
global $cbvid;
$userquery->perm_check('view_video',true);
$pages->page_redir();
$vkey = @$_GET['v'];
$vkey = mysql_clean($vkey);
$vdo = $cbvid->get_video($vkey);
$cbvid->update_comments_count($vdo['videoid']);
$assign_arry['vdo'] = $vdo;
if(video_playable($vdo)) {
//Checking for playlist
$pid = (int)$_GET['play_list'];
if(!empty($pid)) {
$plist = get_playlist( $pid );
if ( $plist ) {
$assign_arry['playlist'] = $plist;
}
}
//Calling Functions When Video Is going to play
call_watch_video_function($vdo);
subtitle(ucfirst($vdo['title']));
} else {
$Cbucket->show_page = false;
}
//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);
$assign_arry['vid_cat'] = $vid_cat;
$title = $vdo['title'];
$tags = $vdo['tags'];
$videoid = $vdo['videoid'];
$related_videos = get_videos(array('title'=>$title,'tags'=>$tags,
'exclude'=>$videoid,'show_related'=>'yes','limit'=>12,'order'=>'RAND()'));
if(!$related_videos){
$relMode = "ono";
$related_videos = get_videos(array('exclude'=>$videoid,'limit'=>12,'order'=>'date_added DESC'));
}
$playlist = $cbvid->action->get_playlist($pid,userid());
$assign_arry['playlist'] = $playlist;
//Getting Playlist Item
$items = $cbvid->get_playlist_items( $pid, 'playlist_items.date_added DESC' );
$assign_arry['items'] = $items;
$assign_arry['videos'] = $related_videos;
$assign_arry['relMode'] = $relMode;
# assigning all variables
array_val_assign($assign_arry);
template_files('watch_video.html');
display_it();
?>