-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.php
More file actions
46 lines (46 loc) · 1.21 KB
/
link.php
File metadata and controls
46 lines (46 loc) · 1.21 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
<?php
include('functions.php');
$samplestart='<?xml version="1.0" encoding="UTF-8"?>
<pages>';
$sampleend='
</pages>';
$data=$samplestart;
$result=$conn->query('select sid,stitle from songs where lang!="ERROR"');
while ($row = $result->fetch_assoc()) {
$list[] = $row;
}
foreach($list as $link){
$data.='
<link>
<title>'.htmlspecialchars(sanitize($link['stitle'])).' - Song</title>
<url>'.$urlhead.'song/'.$link['sid'].'</url>
</link>';
}
$result=$conn->query('select aid,atitle from albums where lang!="ERROR"');
while ($row = $result->fetch_assoc()) {
$list[] = $row;
}
foreach($list as $link){
$data.='
<link>
<title>'.htmlspecialchars(sanitize($link['atitle'])).' - Album</title>
<url>'.$urlhead.'album/'.$link['aid'].'</url>
</link>';
}
$result=$conn->query('select pid,atitle from playlists');
while ($row = $result->fetch_assoc()) {
$list[] = $row;
}
foreach($list as $link){
$data.='
<link>
<title>'.htmlspecialchars(sanitize($link['atitle'])).' - Playlist</title>
<url>'.$urlhead.'playlist/'.$link['pid'].'</url>
</link>';
}
$data.=$sampleend;
$fp = fopen('maps/ajaxsongs.xml', 'w');
fwrite($fp, $data);
fclose($fp);
//echo $total.' sitemaps generated';
?>