-
Notifications
You must be signed in to change notification settings - Fork 9
/
logos.php
69 lines (50 loc) · 1.58 KB
/
logos.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
<html>
<head>
<title>Logos</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
error_reporting(E_ALL);
$_PATH['classes'] = 'classes/';
include_once($_PATH['classes'].'Config.class.php');
include_once($_PATH['classes'].'Artists.class.php');
include_once($_PATH['classes'].'util/UnicodeEntities.class.php');
$_PATH['logos'] = Config::FOLDER_LOGOS;
$artists = Artists::getListArtists();
$uniReplace = new UnicodeEntities();
echo "
<h2>Logos</h2>Currently ".count($artists)." different logos are included.<br/>
<hr color=\"#000\"/>";
//List of letters
echo "<center>";
$letter=35;
echo "<a href=\"#".chr($letter)."\">".chr($letter)."</a> ";
for($letter = 65;$letter<91;$letter++) {
echo "<a href=\"#".chr($letter)."\">".chr($letter)."</a> ";
}
echo "</center>\n\n";
$uniReplace = new UnicodeEntities();
$prevAscii = -1;
//List of artists
foreach($artists as $a) {
$name = $a->getName();
$file = $a->getPathLogo();
$ascii = ord($name);
if($ascii != $prevAscii && 64 < $ascii && $ascii < 91) {
echo "<h3><a name=\"".chr($ascii)."\">".chr($ascii)."</a></h3>\n";
$prevAscii = $ascii;
}
else if($prevAscii == -1) {
echo "<h3><a name=\"#\">#</a></h3>\n";
$prevAscii = 0;
}
$nameFilter = urldecode($name);
$nameFilter = str_replace(array('%23','%2F','"','%2B','%26','<','>','%5C'),array('#','/','"','+','&','<','>','\\'),$nameFilter);
//$nameFilter = $uniReplace->UTF8entities($nameFilter);
echo "<a href=\"http://last.fm/music/".$name."\">".$nameFilter."</a><br/>\n";
}
echo "<hr color=\"#000\"/>";
?>
</body>
</html>