-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathalbums.php
More file actions
86 lines (68 loc) · 2.53 KB
/
albums.php
File metadata and controls
86 lines (68 loc) · 2.53 KB
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
<?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");
//---------------------------------------------------------
$year = (int) $year;
$qr = db_query("select year from songs_albums where year > 0 group by year order by year desc");
if(db_num($qr)){
open_table();
print "<center><a href=\"".$links['albums_page']."\" class='big'>$phrases[all]</a> ";
while($data = db_fetch($qr)){
print "<a href=\"".str_replace("{year}",$data['year'],$links['albums_page_w_year'])."\" class='big'>$data[year]</a> ";
}
print "</center>";
close_table();
}
//-----------
$start = (int) $start;
$perpage = $settings['albums_perpage'];
$page_string = str_replace("{year}",$year,$links['albums_page_w_pages']);
//---------------
$qr = db_query("select songs_albums.*,songs_singers.name as singer_name , songs_singers.id as singer_id , songs_singers.page_name as singer_page_name from songs_albums,songs_singers where songs_singers.id = songs_albums.cat ".iif($year,"and songs_albums.year like '$year'")." order by songs_albums.year desc,songs_albums.id desc limit $start,$perpage");
if(db_num($qr)){
$page_result = db_qr_fetch("select count(*) as count from songs_albums ".iif($year," where year like '$year'"));
$last_year = -1;
open_table();
// print "<table width=100%><tr>";
$c=0 ;
while($data_album = db_fetch($qr)){
if($last_year != $data_album['year']){
if($last_year != -1){
print "</tr></table>";
}
print "<span class=title>".iif($data_album['year'],$data_album['year'],$phrases['other'])."</span>
<hr class='separate_line' size=1>";
print "<table width=100%><tr>";
$last_year = $data_album['year'];
$c=0;
}
if ($c==$settings['songs_cells']) {
print " </tr><tr>" ;
$c = 0 ;
}
++$c ;
print "<td>";
run_template('browse_albums');
print "</td>";
}
print "</tr></table>";
close_table();
print_pages_links($start,$page_result['count'],$perpage,$page_string);
}else{
open_table();
print "<center> $phrases[no_albums] </center>";
close_table();
}
//---------------------------------------------
require(CWD . "/includes/framework_end.php");