-
Notifications
You must be signed in to change notification settings - Fork 5
/
videos.php
121 lines (78 loc) · 3.2 KB
/
videos.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* Allomani Audio & Video (Songs) v3.0
*
* @package Allomani.Songs
* @version 3.0
* @copyright (c) 2006-2018 Allomani , All rights reserved.
* @author Ali Allomani <info@allomani.com>
* @link http://allomani.com
* @license GNU General Public License version 3.0 (GPLv3)
*
*/
require("global.php");
require(CWD . "/includes/framework_start.php");
//----------------------------------------------------
$cat= (int) $cat;
compile_hook('videos_start');
print_videos_path_links($cat);
compile_hook('videos_after_path_links');
//-------- cats -------
$qr = db_query("select * from songs_videos_cats where cat='$cat' and active=1 order by ord asc");
if(db_num($qr)){
templates_cache(array('browse_videos_cats_header','browse_videos_cats_sep','browse_videos_cats','browse_videos_cats_footer'));
$c=0;
run_template('browse_videos_cats_header');
while($data = db_fetch($qr)){
if ($c==$settings['songs_cells']) {
run_template('browse_videos_cats_sep');
$c = 0 ;
}
run_template('browse_videos_cats');
$c++;
}
run_template('browse_videos_cats_footer');
close_table();
}else{
$no_cats = true;
}
//------------------------
//----------------------
$start = intval($start);
$perpage = $settings['videos_perpage'];
$page_string = str_replace('{id}',$cat,$links['browse_videos_w_pages']);
//---------------------
$qr = db_query("select songs_videos_data.* from songs_videos_data,songs_videos_cats where songs_videos_data.cat=songs_videos_cats.id and songs_videos_cats.active=1 and songs_videos_cats.id='$cat' order by songs_videos_data.{$settings['videos_orderby']} $settings[videos_sort] limit $start,$perpage");
$data_cat = db_qr_fetch("select name,cat from songs_videos_cats where id='$cat'");
if(db_num($qr)){
// $videos_count = db_qr_fetch("select count(*) as count from songs_videos_data where cat='$cat'");
$videos_count = db_qr_fetch("select count(*) as count from songs_videos_data,songs_videos_cats where songs_videos_data.cat=songs_videos_cats.id and songs_videos_cats.active=1 and songs_videos_cats.id='$cat'");
templates_cache(array('browse_videos_header','browse_videos_sep','browse_videos','browse_videos_footer'));
run_template('browse_videos_header');
$c=0;
while($data = db_fetch($qr)){
if ($c==$settings['songs_cells']) {
run_template("browse_videos_sep");
$c = 0 ;
}
run_template('browse_videos');
$c++;
}
run_template('browse_videos_footer');
//-------------------- pages system ------------------------
print_pages_links($start,$videos_count['count'],$perpage,$page_string);
//-----------------------------
}else{
if($no_cats){
open_table();
print "<center> $phrases[err_no_videos] </center>";
close_table();
}
}
if($settings['prev_next_video_cat']){
prev_next_video_cat($cat,$data_cat['cat']);
}
compile_hook('videos_end');
//---------------------------------------------------
require(CWD . "/includes/framework_end.php");
?>