-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbrowse.php
199 lines (129 loc) · 4.62 KB
/
browse.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?php
/**
* Allomani Audio & Video (Songs) v3.0
*
* @package Allomani.Songs
* @version 3.0
* @copyright (c) 2006-2018 Allomani , All rights reserved.
* @author Ali Allomani <[email protected]>
* @link http://allomani.com
* @license GNU General Public License version 3.0 (GPLv3)
*
*/
require("global.php");
require(CWD . "/includes/framework_start.php");
//----------------------------------------------------
compile_hook('singers_start');
//-------- Show Cats -------
if(!$id && $op !="letter"){
$qr2 = db_query("select * from songs_cats where active=1 order by ord asc");
if(db_num($qr2)){
open_table($phrases['the_cats']);
$c=0;
print "<table width=100%><tr>";
while($data = db_fetch($qr2)){
if ($c==$settings['songs_cells']) {
print " </tr><tr>" ;
$c = 0 ;
}
++$c ;
print "<td align=center>".print_link(print_image(get_image($data['img'],"images/folder.gif"),$data['name'])."<br>$data[name]",cat_url($data['id'],$data['page_name'],$data['name']),$data['name'])."</td>";
}
print "</tr></table>";
close_table();
}else{
print "<center> $phrases[err_no_cats] </center>";
}
}else{
//------------------------
if ($letter){
$qr = db_query("select songs_singers.*,songs_cats.name as cat_name , songs_cats.id as cat_id , songs_cats.page_name as cat_page_name from songs_singers,songs_cats where songs_singers.active=1 and songs_singers.cat=songs_cats.id and songs_cats.active=1 and songs_singers.name like '".db_escape($letter)."%' order by songs_singers.name asc");
$title = htmlspecialchars($letter) ;
}else{
$qr = db_query("select songs_singers.* from songs_singers,songs_cats where songs_singers.active=1 and songs_singers.cat=songs_cats.id and songs_cats.active=1 and songs_cats.id='$id' order by songs_singers.name asc ");
$data_title = db_qr_fetch("select name from songs_cats where id='$id' and active=1");
$title = $data_title['name'];
}
if (db_num($qr)){
open_table($title);
if($settings['singers_groups'] && !$letter){
//-------- use groups --------------
unset($data_arr,$data_arr2);
while($data = db_fetch($qr)){
$lt_found = false ;
for($cx=0;$cx < count($letters_groups) ;++$cx){
if(in_array(utf8_substr(strtoupper($data['name']),0,1),$letters_groups[$cx])){
$data_arr[$cx][] = $data ;
$lt_found = true ;
break;
}
}
if(!$lt_found){
$data_arr2[] = $data ;
}
}
unset($data);
//------------------ end sync data -------------------
for($cy = 0;$cy < count($letters_groups) ;++$cy){
$data_arr_main = $data_arr[$cy];
if(count($data_arr_main)){
print "<span align=right class=title>".$letters_groups_names[$cy]."</span><hr class=separate_line 1px\" size=\"1\">";
print "<table width=100%><tr>" ;
$c = 0 ;
foreach($data_arr_main as $data){
if ($c==$settings['songs_cells']) {print " </tr><tr>" ;$c = 0 ;}
print "<td>";
run_template('browse_singers');
print "</td>";
$c++;
}
// }
print "</tr></table>";
}
}
unset($data);
//---------------------- others array --------------------
if(count($data_arr2)){
print "<span align=right class=title>$phrases[singers_other_letters]</span><hr class=separate_line size=\"1\">";
print "<table width=100%><tr>" ;
$c = 0 ;
foreach($data_arr2 as $data){
if ($c==$settings['songs_cells']) {print " </tr><tr>" ;$c = 0 ;}
print "<td>";
run_template('browse_singers');
print "</td>";
$c++;
}
print "</tr></table>";
}
unset($data);
//---------------------------- END Letters Groups System -------------------
}else{
print "<table width=100%><tr>" ;
while($data = db_fetch($qr)){
// $singer_songs_count = db_qr_fetch("select count(id) as count from songs_songs where album='$data[id]'");
//----------
if ($c==$settings['songs_cells']) {
print " </tr><TR>" ;
$c = 0 ;
}
++$c ;
print "<td>";
run_template('browse_singers');
print "</td>";
}
print "</tr></table>";
}
close_table();
}else{
open_table($title);
print "<center> $phrases[err_no_singers] </center>";
close_table();
}
if($settings['prev_next_cat'] && !$letter){
prev_next_cat($id);
}
}
compile_hook('singers_end');
//---------------------------------------------------
require(CWD . "/includes/framework_end.php");