-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontests.php
44 lines (36 loc) · 1.24 KB
/
contests.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
<?php
function umc_contest_index() {
return "this feature is under construction";
}
function umc_new_listcontests($status = 'active') {
$sql = "SELECT title, id from minecraft_srvr.contest_contests WHERE status='$status' ORDER by id ASC;";
$D = umc_mysql_fetch_all($sql);
$out = "<ul>";
foreach ($D as $row) {
$out .= "<li>" . $row['title'] . "</li>";
}
$out .= "</ul>";
return $out;
}
function umc_contests_status() {
global $UMC_SETTING;
$status_arr = array('voting', 'active');
$out = '<ul>';
foreach ($status_arr as $status) {
$sql = "SELECT title, id from 'minecraft_srvr.contest_contests WHERE status='$status' ORDER by id ASC;";
$D = umc_mysql_fetch_all($sql);
if (count($D) > 0) {
$title = ucfirst("$status:") ;
$out .= "<li><strong>$title</strong>";
$out .= "<ul>";
foreach ($D as $row) {
$link = $UMC_SETTING['path']['url'] . "/contestsmanager/?action=show_contest&type=" . $row['id'];
$out .= "<li><a href=\"$link\">{$row['title']}</a></li>";
}
$out .= "</ul></li>";
}
}
$out .= "</ul>";
echo $out;
}
?>