-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrss.php
152 lines (111 loc) · 6.13 KB
/
rss.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
<?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)
*
*/
header('Content-type: text/xml');
include "global.php" ;
print "<?xml version=\"1.0\" encoding=\"$settings[site_pages_encoding]\" ?> \n";
if(!$op){$op="singers";}
?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<? print "<title><![CDATA[$sitename - ".htmlspecialchars($op)."]]></title>\n";?>
<description></description>
<?print "<link>$scripturl</link>\n";
print "<copyright><![CDATA[$settings[copyrights_sitename]]]></copyright>";
?>
<?
//-------------------- singers --------------------------------
if($op=="singers"){
$qr=db_query("select songs_singers.*,songs_cats.name as cat_name from songs_singers,songs_cats where songs_cats.id = songs_singers.cat order by songs_singers.last_update desc limit 200") ;
while($data = db_fetch($qr)){
print " <item>
<title><![CDATA[".$data["name"]."]]></title>
<pubDate>".date("d M Y H:i:s",$data['last_update'])."</pubDate>
<description><![CDATA[ <img align=center src=\"".iif(!strchr($data['img'],"://"),$scripturl."/").get_image($data['img'])."\"><br>".get_date($data['last_update'])."]]></description>";
print "
<link>".htmlspecialchars($scripturl."/".singer_url($data['id'],$data['page_name'],$data['name']))."</link>
<category><![CDATA[$data[cat_name]]]></category>
</item>\n";
}
}
//------------------------------- songs -------------------------------------------
if($op=="songs"){
$qr=db_query("select songs_songs.*,songs_singers.name as singer_name from songs_songs,songs_singers where songs_singers.id = songs_songs.album order by songs_songs.id desc limit 200") ;
while($data = db_fetch($qr)){
print " <item>
<title><![CDATA[".$data['singer_name'] . " - " . $data["name"]."]]></title>
<pubDate>".date("d M Y H:i:s",$data['date'])."</pubDate>
<link>".htmlspecialchars($scripturl."/".str_replace(array('{cat}','{id}'),array($settings['default_url_id'],$data['id']),$links['song_listen']))."</link>
<category><![CDATA[$data[singer_name]]]></category>
</item>\n";
}
}
//--------------------- albums ----------------------
if($op=="albums"){
$qr=db_query("select songs_albums.*,b.name as singer_name,b.page_name as singer_page_name from songs_albums,songs_singers b where b.id = songs_albums.cat order by songs_albums.id desc limit 200") ;
while($data = db_fetch($qr)){
print " <item>
<title><![CDATA[".$data['singer_name'] . " - " . $data["name"]."]]></title>
<pubDate>".date("d M Y H:i:s",$data['date'])."</pubDate>
<description><![CDATA[ <img align=center src=\"".iif(!strchr($data['img'],"://"),$scripturl."/").get_image($data['img'])."\">]]></description>
<link>".htmlspecialchars($scripturl."/".album_url($data['id'],$data['page_name'],$data['name'],$data['cat'],$data['singer_page_name'],$data['singer_name']))."</link>
<category><![CDATA[$data[singer_name]]]></category>
</item>\n";
}
}
//--------------------- videos ----------------------
if($op=="videos"){
$qr=db_query("select songs_videos_data.*,songs_videos_cats.name as cat_name from songs_videos_data,songs_videos_cats where songs_videos_cats.id = songs_videos_data.cat order by songs_videos_data.id desc limit 200") ;
while($data = db_fetch($qr)){
print " <item>
<title><![CDATA[".$data['cat_name'] . " - " . $data["name"]."]]></title>
<pubDate>".date("d M Y H:i:s",$data['date'])."</pubDate>
<description><![CDATA[ <img align=center src=\"".iif(!strchr($data['img'],"://"),$scripturl."/").get_image($data['img'])."\">]]></description>
<link>".htmlspecialchars($scripturl."/".str_replace("{id}",$data['id'],$links['video_watch']))."</link>
<media:content url=\"".iif(!strchr($data['url'],"://"),$scripturl."/")."$data[url]\" medium=\"video\" />
<media:title>".$data['cat_name'] . " - " . $data["name"]."</media:title>
<media:thumbnail url=\"".iif(!strchr($data['img'],"://"),$scripturl."/").get_image($data['img'])."\" />
<category><![CDATA[$data[cat_name]]]></category>
</item>\n";
}
}
//--------------------- photos ----------------------
if($op=="photos"){
$qr=db_query("select songs_singers_photos.*,b.name as singer_name from songs_singers_photos,songs_singers b where b.id = songs_singers_photos.cat order by songs_singers_photos.id desc limit 200") ;
while($data = db_fetch($qr)){
print " <item>
<title>Photo $data[id] - $data[singer_name]</title>
<pubDate>".date("d M Y H:i:s",$data['date'])."</pubDate>
<description><![CDATA[ <img align=center src=\"".iif(!strchr($data['thumb'],"://"),$scripturl."/").get_image($data['thumb'])."\">]]></description>
<link>".htmlspecialchars($scripturl."/".str_replace("{id}",$data['id'],$links['singer_photo']))."</link>
<media:content url=\"".iif(!strchr($data['img'],"://"),$scripturl."/")."$data[img]\" medium=\"image\" />
<media:title>Photo $data[id] - $data[singer_name]</media:title>
<media:thumbnail url=\"".iif(!strchr($data['thumb'],"://"),$scripturl."/").get_image($data['thumb'])."\" />
<category><![CDATA[$data[singer_name]]]></category>
</item>\n";
}
}
//--------------------- news ----------------------
if($op=="news"){
$qr=db_query("select * from songs_news order by id desc limit 200") ;
while($data = db_fetch($qr)){
print " <item>
<title><![CDATA[".$data["title"]."]]></title>
<pubDate>".date("d M Y H:i:s",$data['date'])."</pubDate>
<description><![CDATA[ <img align=center src=\"".iif(!strchr($data['img'],"://"),$scripturl."/").get_image($data['img'])."\"> <br> $data[content] ]]></description>
<link>".htmlspecialchars($scripturl."/".str_replace("{id}",$data['id'],$links['news_details']))."</link>
</item>\n";
}
}
//---------------------------------------------------------
print "</channel>
</rss>";