-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsitemap.php
More file actions
146 lines (120 loc) · 4.25 KB
/
sitemap.php
File metadata and controls
146 lines (120 loc) · 4.25 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
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
<?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");
print "<?xml version=\"1.0\" encoding=\"$settings[site_pages_encoding]\" ?> \n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<?
if(!$op){
//---------- cats -------------
$qr=db_query("select * from songs_cats order by id");
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".cat_url($data['id'],$data['page_name'],$data['name']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
//---------- singers -------------
$qr=db_query("select * from songs_singers order by id") ;
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".singer_url($data['id'],$data['page_name'],$data['name']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
//---------- 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") ;
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".album_url($data['id'],$data['page_name'],$data['name'],$data['cat'],$data['singer_page_name'],$data['singer_name']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
//---------- videos cats -------------
$qr=db_query("select id from songs_videos_cats order by id desc");
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".str_replace("{id}",$data['id'],$links['browse_videos']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
//---------- News -------------
$qr=db_query("select id from songs_news order by id");
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".str_replace("{id}",$data['id'],$links['news_details']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
//---------- Pages -------------
$qr=db_query("select id from songs_pages order by id");
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".str_replace("{id}",$data['id'],$links['pages']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
//--------------------------
}
//---------- SONGS ---------------------
if($op=="songs"){
$page = intval($page);
if(!$page){$page=1;}
$perpage = $sitemap_perpage ;
$start = (($page-1) * $perpage) ;
$qr=db_query("select id from songs_songs order by id limit $start,$perpage");
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".str_replace(array('{cat}','{id}'),array($settings['default_url_id'],$data['id']),$links['song_listen']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
}
//-------- VIDEOS ---------------------
if($op=="videos"){
$page = intval($page);
if(!$page){$page=1;}
$perpage = $sitemap_perpage ;
$start = (($page-1) * $perpage) ;
$qr=db_query("select id from songs_videos_data order by id limit $start,$perpage");
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".str_replace('{id}',$data['id'],$links['video_watch']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
}
//-------- PHOTOS ---------------------
if($op=="photos"){
$page = intval($page);
if(!$page){$page=1;}
$perpage = $sitemap_perpage ;
$start = (($page-1) * $perpage) ;
$qr=db_query("select id from songs_singers_photos order by id limit $start,$perpage");
while($data = db_fetch($qr)){
print "<url>
<loc>".htmlspecialchars($scripturl."/".str_replace('{id}',$data['id'],$links['singer_photo']))."</loc>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>";
}
}
print "</urlset>";