-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrandom_list.php
More file actions
49 lines (38 loc) · 1.22 KB
/
random_list.php
File metadata and controls
49 lines (38 loc) · 1.22 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
<?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)
*
*/
include "global.php" ;
$num = intval($num);
$cat = intval($cat) ;
if(!$num){$num=10;}
if($cat){
$qr = db_query("select songs_urls_data.url from songs_songs,songs_singers,songs_urls_data where songs_urls_data.cat=1 and songs_urls_data.song_id=songs_songs.id and songs_songs.album=songs_singers.id and songs_singers.cat='$cat' order by rand() limit $num");
}else{
$qr = db_query("select url from songs_urls_data where cat=1 order by rand() limit $num");
}
//$cont = "[playlist]\nNumberOfEntries=$num\n";
$c=1 ;
while($data = db_fetch($qr)){
if (strchr($data['url'],"http://")) {
$file_url = $data['url'] ;
}else{
$file_url = $scripturl."/$data[url]";
}
//$cont .= "File".$c."=".$file_url."\n" ;
$cont .= $file_url."
" ;
$c++;
}
header("Content-type: audio/x-pn-realaudio");
header("Content-Disposition: filename=random.ram");
header("Content-Description: PHP Generated Data");
print $cont ;