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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
<!DOCTYPE html> <html> <head> <title>GRID TIP</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//mamnaslim.dsmynas.net/piwik/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code -->
<style type="text/css">
#menu__toggle { opacity: 0; } #menu__toggle:checked + .menu__btn > span { transform: rotate(45deg); } #menu__toggle:checked + .menu__btn > span::before { top: 0; transform: rotate(0deg); } #menu__toggle:checked + .menu__btn > span::after { top: 0; transform: rotate(90deg); } #menu__toggle:checked ~ .menu__box { left: 0 !important; } .menu__btn { position: fixed; top: 20px; left: 20px; width: 26px; height: 26px; cursor: pointer; z-index: 1; } .menu__btn > span, .menu__btn > span::before, .menu__btn > span::after { display: block; position: absolute; width: 100%; height: 2px; background-color: #616161; transition-duration: .25s; } .menu__btn > span::before { content: ''; top: -8px; } .menu__btn > span::after { content: ''; top: 8px; } .menu__box { display: block; position: fixed; top: 0; left: -100%; width: 300px; height: 100%; margin: 0; padding: 40px 0; list-style: none; background-color: #ECEFF1; box-shadow: 2px 2px 6px rgba(0, 0, 0, .4); transition-duration: .25s; overflow: auto; } .menu__item { display: block; padding: 12px 24px; color: #333; font-family: Arial, sans-serif; font-size: 18px; font-weight: 400; text-decoration: none; transition-duration: .25s; } .menu__item:hover { background-color: #CFD8DC; text-decoration: none; } .menu__home { position: fixed; top: 7px; right: 17px; }
.leaderboard { // column-count: 3; // column-gap: 10px; column-count: auto; column-width: 10rem; } ol, li { list-style-type: 1; margin: 0; padding: 0; }
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link='#000000' alink='#000000' vlink='#000000'>
<link href="shoutbox/style.css" rel="stylesheet" type="text/css" />
<div class="hamburger-menu"> <input id="menu__toggle" type="checkbox" /> <label class="menu__btn" for="menu__toggle"> <span></span> </label>
<ul class="menu__box"> <li><h1> GRID TIP</h></li>
<li><a class="menu__item" href="login.php" target="mainFrame">Login</a></li> <li><a class="menu__item" href="tipsresults.php" target="mainFrame">Tips & Results</a></li> <li><a class="menu__item" href="schedule.php" target="mainFrame">Schedule</a></li> <li><a class="menu__item" href="rules.php" target="mainFrame">Rules</a></li> <li><a class="menu__item" href="members.php" target="mainFrame">Members List</a></li> <li><a class="menu__item" href="halloffame.php" target="mainFrame">Hall of Fame</a></li> <li><a class="menu__item" href="statistics.php" target="mainFrame">Statistics</a></li> <li><a class="menu__item" href="archive.php" target="mainFrame">Archive</a></li> <li><a class="menu__item" href="../gridtip_2022/" target="_blank">Last Season</a></li> <li><a class="menu__item" href="admin/admin.html" target="mainFrame">Admin</a></li> </ul>
<div class="menu__home"> <a href="gridtip.php" target="mainFrame"><img src="images/home.png" width="32" height="28"></a> </div>
</div>
<br><br><br><br>
<table width="80%" border="0" align="center"> <tr> <td width="60%" align="center"><font face="Arial, Helvetica, sans-serif" size="6"><b>Leaderboard</b></font></td> <td width="40%" align="center"><font face="Arial, Helvetica, sans-serif" size="6"><b>Shoutbox</b></font></td> </tr> <tr> <td width="60%" valign="top"><div align="center"><font face="Arial, Helvetica, sans-serif" size="5"><br>Overall score (and won GP weekends score in brackets)<br><br></font></div>
<div class="leaderboard" align="left">
<?PHP require("dbconnect.php"); dbconnect();
$created=mysql_query("create table temp_score as select t_g_id,t_u_Id,sum(t_score) t_score from tips group by t_g_id,t_u_id;"); $created=mysql_query("create table temp_max_score as select t_g_id,max(t_score) t_max_score from temp_score group by t_g_id;");
// $created=mysql_query("create table temp_g_u as select ts.t_g_id,ts.t_u_id,ms.t_max_score from temp_score ts,temp_max_score ms where ts.t_g_id=ms.t_g_id and ts.t_score=ms.t_max_score group by ts.t_g_id having count(*)=1 and ms.t_max_score>0;"); $created=mysql_query("create table temp_g_u as select ts.t_g_id,ts.t_u_id,ms.t_max_score from temp_score ts,temp_max_score ms where ts.t_g_id=ms.t_g_id and ts.t_score=ms.t_max_score and ms.t_max_score>0;"); $created=mysql_query("create table temp_coffees as select t_u_id,count(*) t_coffees from temp_g_u group by t_u_id");
$x=0; $scores=mysql_query("select t.t_u_id,u_name,sum(t.t_score) points,tc.t_coffees coffees from users left join tips t on u_id=t.t_u_id left join temp_coffees tc on t.t_u_id=tc.t_u_id group by t.t_u_id,u_name order by points desc, coffees desc, u_name asc;"); while ($user_scores=mysql_fetch_array($scores)) { $user_names[$x]=$user_scores['u_name']; $user_points[$x]=$user_scores['points']; $user_coffees[$x]=$user_scores['coffees']; if ($user_coffees[$x]=="") $user_coffees[$x]=0; $x=$x+1; } //echo "<font face='Arial, Helvetica, sans-serif' size='4' color='#009933'>Leaderboard:</font>"; echo "<ol type='1'>"; $j=0; for ($i=0;$i<$x;$i++) { echo "<font face='Arial, Helvetica, sans-serif' size='4' color='#0099CC'><b><li>".$user_names[$i].": <font color='#FF0000'>".$user_points[$i]." (".$user_coffees[$i].") <br><br></li></b></font></font>"; $j=$j+1; //if ($j==10) { echo "<br>"; $j=0;}
} echo "</ol>";
$deleted=mysql_query("drop table temp_score;"); $deleted=mysql_query("drop table temp_max_score;"); $deleted=mysql_query("drop table temp_g_u;"); $deleted=mysql_query("drop table temp_coffees;");
?> </div> </td> <td width="40%" valign="top" align="center"><br><br>
<?php // Glens shoutbox script using files and sessions ?> <table width="350" border="0" bordercolor="#000000" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#CCCCCC"> <p><div align="center"><IFRAME SRC="shoutbox/shouts.php" WIDTH=94% HEIGHT=300 scrolling=auto frame-border=0></IFRAME></div></p> </td> </tr> <tr> <td bgcolor="#99CCFF"> <form id="shoutbox" name="shoutbox" method="post" action=""> <br> <font face="Arial, Helvetica, sans-serif" size="3"> <b> Name:<br><br> <div align="center"><input name="name" type="text" id="name" size="40" maxlength="50"></div> <br> Message:<br><br> <div align="center"><input name="message" type="text" id="message" size="40" maxlength="500"></div></b></font> <br> <p align="center"> <input type="submit" id="shout" name="shout" value="." class="submit"><br><br><a href="<?php echo $_SERVER['PHP_SELF']; ?>"><font size="2"><b>refresh</b></font></a> </p> </form> </td> </tr> </table> <?php
// Start coding new entrys on post
if ($_POST['shout']) {
$file = "shoutbox/shouts.html"; $handle = fopen($file, "a") or die ("Cant open file"); $message = $_POST['message']; $message = htmlentities($message); $name = $_POST['name']; $name = htmlentities($name); $date = date("Y-m-d - H:i:s");
$name_l = strlen($name); $message_l = strlen($message); $nl = chr(13) . chr(10);
if ($name_1 > 50) { echo "<span class='error'>Name must be less than 50</span>"; //exit; } if ($message_1 > 500) { echo "<span class='error'>Message must be less than 500</span>"; //exit; }
if ($name == '') { echo "<span class='error'>You must enter a name</span><br>"; //exit; }else{ $true++; } if ($message == '') { echo "<span class='error'>You must enter a message</span><br>"; //exit; }else{ $true++; if ($name == "name") { echo "<span class='error'>You must enter your name</span><br>"; //exit; } if ($message == "message") { echo "<span class='error'>You must enter a message</span><br>"; //exit; //if ($name == "name" and $message == "message") { //echo "Please enter your name and message"; //exit; //} } } if ($true == 2) {
$data = "<span class='first'>$date</span><br><span class='second'>$name:</span><br><span class='third'>$message</span><br><br>$nl"; fwrite ($handle, $data) or die ("Cant write new message"); fclose($handle); //echo '<meta http-equiv="Refresh" content="0">'; } }
?> </td> </tr> </table>
<br>
<div align='center'><font face='Arial, Helvetica, sans-serif' size='3'>© 2023 - RoMa</font></div>
</body> </html>
|