This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
parties.php
199 lines (172 loc) · 5.59 KB
/
parties.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?
$when=$_REQUEST['when'];
$which=$_REQUEST['which'];
$order=$_REQUEST['order'];
require("include/top.php");
function cmp_year($a, $b)
{
if ($a["year"] == $b["year"])
{
return ($a["name"] < $b["name"]) ? -1 : 1;
}
return ($a["year"] > $b["year"]) ? -1 : 1;
}
function cmp_name($a, $b)
{
if (strtolower($a["name"]) == strtolower($b["name"]))
{
return (strtolower($a["year"]) > strtolower($b["year"])) ? -1 : 1;
}
return (strtolower($a["name"]) < strtolower($b["name"])) ? -1 : 1;
}
function goodfleche($wanted,$current) {
if($wanted==$current) {
$fleche="fleche1a";
} else {
$fleche="fleche1b";
}
return $fleche;
}
$pattern = chr(rand(ord('a'),ord('z')));
if (isset($_GET["pattern"]))
$pattern = substr($_GET["pattern"],0,1);
$query = "SELECT parties.name as name,prods.party as id,prods.party_year ".
"as year,count(0) as count,COUNT(prods.party) as cprods,parties.web, ".
"partylinks.csdb, partylinks.slengpung, partylinks.zxdemo, ".
"partylinks.download FROM prods JOIN parties LEFT JOIN partylinks ON ".
"(prods.party_year=partylinks.year AND parties.id=partylinks.party) WHERE parties.id=prods.party ";
if($pattern=="#") {
//$sqlwhere="(name LIKE '0%')||(name LIKE '1%')||(name LIKE '2%')||(name LIKE '3%')||(name LIKE '4%')||(name LIKE '5%')||(name LIKE '6%')||(name LIKE '7%')||(name LIKE '8%')||(name LIKE '9%')";
$query.="and (parties.name REGEXP '^[^a-zA-Z]')";
} else {
$query.="and parties.name LIKE '".$pattern."%'";
}
$query .=" GROUP BY prods.party, prods.party_year ";
if ($order=="year") {
$query .= "ORDER BY prods.party_year DESC,parties.name ASC";
} else {
$query .= "ORDER BY parties.name ASC,prods.party_year DESC";
}
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)) {
$parties[] = $row;
}
function lettermenu($pattern) {
print("[ ");
if($pattern=="#") {
print("<b>#</b>");
} else {
print("<a href=\"parties.php?pattern=%23\">#</a>");
}
for($i=1;$i<=26;$i++) {
print(" | ");
if($pattern==chr(96+$i)) {
print("<b>".chr(96+$i)."</b>");
} else {
print("<a href=\"parties.php?pattern=".chr(96+$i)."\">".chr(96+$i)."</a>");
}
}
print(" ]<br />\n");
}
?>
<br>
<table bgcolor="#000000" cellspacing="1" cellpadding="0" border="0">
<tr>
<td>
<table bgcolor="#000000" cellspacing="1" cellpadding="2" border="0">
<tr bgcolor="#224488">
<th colspan="4">
<center><? lettermenu($pattern); ?></center>
</th>
</tr>
<tr bgcolor="#224488">
<th>
<table><tr>
<td>
<a href="parties.php?order=name&pattern=<?php print($pattern); ?>"><img src="gfx/<? print(goodfleche("name",$order)); ?>.gif" width="13" height="12" border="0"></a><br>
</td>
<td>
<a href="parties.php?order=name&pattern=<?php print($pattern); ?>"><b>partyname</b></a><br>
</td>
</tr></table>
</th>
<th>
<table><tr>
<td>
<a href="parties.php?order=year&pattern=<?php print($pattern); ?>"><img src="gfx/<? print(goodfleche("year",$order)); ?>.gif" width="13" height="12" border="0"></a><br>
</td>
<td>
<a href="parties.php?order=year&pattern=<?php print($pattern); ?>"><b>year</b></a><br>
</td>
</tr></table>
</th>
<th>
<b>releases</b><br>
</th>
<th>
<b>download</b><br>
</th>
</tr>
<?
for($i=0,$j=0;$i<count($parties);$i++):
if($parties[$i]['id']!=1024):
if($parties[$i]['id']!=$parties[$i-1]['id']):
if (($order=="year") && ($parties[$i]['year']!=$parties[$i-1]['year']))
print("<tr bgcolor=\"#224488\"><td></td><td><b>".$parties[$i]["year"]."</b><br /></td><td></td><td></td></tr>");
$j++;
if($j%2) {
print("<tr bgcolor=\"#446688\"><td>");
} else {
print("<tr bgcolor=\"#557799\"><td>");
}
print("<b><a href=\"party.php?which=".$parties[$i]['id']."\">".$parties[$i]['name']."</a></b>\n");
if($parties[$i]["web"])
{
print(" [<a href=\"".$parties[$i]['web']."\">web</a>]");
} ?>
<br />
<? else:
if($j%2) {
print("<tr bgcolor=\"#446688\"><td><br /></td>");
} else {
print("<tr bgcolor=\"#557799\"><td><br /></td>");
}
endif; ?>
<td>
<? print("<a href=\"party.php?which=".$parties[$i]['id']."&when=".$parties[$i]['year']."\">".$parties[$i]['year']."</a>\n"); ?>
<? if($parties[$i]["slengpung"]): ?>
[<a href="http://www.slengpung.com/?eventid=<?=$parties[$i]["slengpung"]?>">slengpung</a>]
<? endif; ?>
<? if($parties[$i]["csdb"]): ?>
[<a href="http://noname.c64.org/csdb/event/?id=<?=$parties[$i]["csdb"]?>">csdb</a>]
<? endif; ?>
<? if($parties[$i]["zxdemo"]): ?>
[<a href="http://zxdemo.org/party.php?id=<?=$parties[$i]["zxdemo"]?>">zxdemo</a>]
<? endif; ?>
<br />
</td>
<td>
<? print($parties[$i]['cprods']); ?><br />
</td>
<td>
<? if($parties[$i]["download"]): ?>
[<a href="<?=$parties[$i]["download"]?>">prods</a>]
<? endif; ?>
<? if(file_exists("results/".$parties[$i]["id"]."_".substr($parties[$i]["year"],-2).".txt")): ?>
[<a href="results.php?which=<?=$parties[$i]["id"]?>&when=<?=substr($parties[$i]["year"],-2)?>">results</a>]
<? endif; ?>
</td>
</tr>
<? endif; ?>
<? endfor; ?>
</table>
</td>
</tr>
<tr bgcolor="#224488">
<th colspan="3">
<center><? lettermenu($pattern); ?></center>
</th>
</tr>
</table>
<br />
<? require("include/bottom.php"); ?>