summaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/about.php16
-rw-r--r--pages/admin.php153
-rw-r--r--pages/leaderboard.php9
3 files changed, 101 insertions, 77 deletions
diff --git a/pages/about.php b/pages/about.php
index 9181a87..ab46c57 100644
--- a/pages/about.php
+++ b/pages/about.php
@@ -2,14 +2,26 @@
htmlHeader(array());
?>
+<link href="https://plus.google.com/105148482605711831543" rel="publisher" />
+
<body>
<?php
topbar($Links);
?>
<div class="wrapper">
- Email us: <a href='mailto:snapems@gmail.com'>snapems@gmail.com</a>
- <br />
+ Email us: <a href='mailto:snap@pathery.com'>snap@pathery.com</a>
+ <br /><br />Follow us on twitter:
+<a href="https://twitter.com/Pathery" class="twitter-follow-button" data-show-count="false">Follow @Pathery</a>
+<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
+ <br /><br />Like us on facebook:
+
+ <iframe id='facebook' src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com/pages/Pathery/176985129018434&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font&amp;colorscheme=dark&amp;height=21"></iframe>
+
+ <br />Follow us on Google Plus:
+ <a href="https://plus.google.com/105148482605711831543?prsrc=3" style="text-decoration:none;"><img src="https://ssl.gstatic.com/images/icons/gplus-32.png" alt="" style="border:0;width:32px;height:32px;"/></a>
+
+ <br /><br />
<h3>Created by:</h3>
Patrick Davison (Snap) and Rex Ounekeo
diff --git a/pages/admin.php b/pages/admin.php
index d825ebc..90060c2 100644
--- a/pages/admin.php
+++ b/pages/admin.php
@@ -10,84 +10,89 @@ include('./includes/maps.php');
include('./includes/mapoftheday.php');
include('./includes/db.inc.php');
-//$motd = MapOfTheDay(3);
-//$mapID = $motd['id'];
-
-$pastMap = pastMap(3, 1);
-$mapID = $pastMap;
-
-echo $mapID;
-
-//$mapID = '38';
-$mapcode = getMapCode($mapID);
-$map = GenerateMapByCode($mapcode);
-
-$sql = "SELECT `moves`, `displayName`, `solution`
- FROM `solutions`, `users`
- WHERE `mapID` = '$mapID' AND
- `userID` = users.ID
- ORDER BY `moves` DESC, `dateModified` ASC
- LIMIT 1";
-
-$result = mysql_query($sql) or die(mysql_error());
-if (mysql_num_rows($result) > 0) {
- list($bestMoves, $byName, $solution) = mysql_fetch_row($result);
- echo "<br />Best solution for this map: $bestMoves by $byName";
-
- //$map = MergeMapSolution($motd['map'], $solution);
- $map = MergeMapSolution($map, $solution);
- echo DisplayMap($map, $mapID);
-
- echo "<br />";
- echo "<br />Is Current:";
- $is = isCurrentMap(77);
- echo "<br />$is";
- $is = isCurrentMap(20);
- echo "<br />$is";
- $is = isCurrentMap(76);
- echo "<br />$is";
- $is = isCurrentMap(75);
- echo "<br />$is";
- $is = isCurrentMap(74);
- echo "<br />$is";
- echo "<br />";
-
-}
-function isCurrentMap($mapID) {
- include_once('./includes/db.inc.php');
- $sql = "SELECT `ID` FROM `mapOfTheDay`
- WHERE `mapDate` = CURDATE() AND
- `mapID` = '$mapID'
- ";
- $result = mysql_query($sql) or die(mysql_error());
- if (mysql_num_rows($result) == 0)
- return false;
- else
- return true;
+$sql = "SELECT `ID`, `displayName`, `dateJoined`, `dateLogin`, `email`, `isAdmin` FROM `users`";
+$result = mysql_query($sql);
+
+echo "
+<center>
+<h3>Administrators Page</h3>
+<p>News:</p>
+<p>Hello admins, this is our current userlist.</p>
+</center>
+<table style='padding-left:20px;'>
+<tr>
+<th>ID</th><th>Display name:</th><th>Joined On:</th><th>Last Logon</th><th>Email</th><th>Administrator</th>
+</tr>
+";
+
+while (list($CUID, $CUsername, $Joined, $LastLogon, $email, $isAdmin) = mysql_fetch_row($result)) {
+
+ //$Joined = Date("d/m/y - g:ia", $Joined);
+ $Joined = strtotime($Joined);
+ //$Joined = relative_date($Joined);
+ $Joined = date("Y-m-d", $Joined);
+
+ $LastLogon = strtotime($LastLogon);
+ //$LastLogon = relative_date($LastLogon);
+ $LastLogon = date("Y-m-d", $LastLogon);
+
+ if ($isAdmin == 1)
+ $isAdmin = "Yes";
+ else
+ $isAdmin = "No";
+
+
+ Echo "<tr>
+<td>$CUID</td>
+<td><a href='javascript:;'>$CUsername</a></td>
+<td>$Joined</td>
+<td>$LastLogon</td>
+<td>$email</td>
+<td>$isAdmin</td>
+</tr>";
+
}
+Echo "
+ </table>
+ <br />
+ <br />
+ </td>
+ </tr>
+</table>
+";
+
+
+//Thank you:
+//http://snippets.dzone.com/posts/show/196
+function relative_date($time) {
+ $today = strtotime(date('M j, Y'));
+ $reldays = ($time - $today)/86400;
+ if ($reldays >= 0 && $reldays < 1) {
+ return 'Today';
+ } else if ($reldays >= 1 && $reldays < 2) {
+ return 'Tomorrow';
+ } else if ($reldays >= -1 && $reldays < 0) {
+ return 'Yesterday';
+ }
+ if (abs($reldays) < 7) {
+ if ($reldays > 0) {
+ $reldays = floor($reldays);
+ return 'in ' . $reldays . ' day' . ($reldays != 1 ? 's' : '');
+ } else {
+ $reldays = abs(floor($reldays));
+ return $reldays . ' day' . ($reldays != 1 ? 's' : '') . ' ago';
+ }
+ }
+ if (abs($reldays) < 182) {
+ return date('l, F j',$time ? $time : time());
+ } else {
+ return date('l, F j, Y',$time ? $time : time());
+ }
+}
-echo "<br />";
-echo "<br />";
-echo "<br />Solution before";
-echo "<br />";
-echo $solution;
-echo "<br />";
-echo "<br />Solution after";
-echo "<br />";
-$solution = formSolution($solution);
-echo $solution;
-echo "<br />";
-echo "<br />";
-echo "<br />";
-// echo "<center><b> The map for today:
-// <br />Once logged in your best solutions for the map(s) are saved.
-// <br />- Soon i'll fix it so you can see those solutions, and compare them with others.
-// <br />- New maps are generated daily, at 9:00 PM Pacific Standard. (for now...)
-// </b></center>";
-// echo DisplayMap($motd['map'], $motd['id']);
@@ -226,4 +231,4 @@ function createThumbnail($mapMatrix, $idprefix, $width, $height) {
}
htmlFooter();
-?>
+?> \ No newline at end of file
diff --git a/pages/leaderboard.php b/pages/leaderboard.php
index d69d9fd..143188f 100644
--- a/pages/leaderboard.php
+++ b/pages/leaderboard.php
@@ -181,7 +181,7 @@ function displayPastMaze($mapType, $name, $daysago = 1) {
echo '<div class="col2">';
echo "Best solution for this map: <b>$bestMoves by $byName </b>";
- echo DisplayMap($map, $mapID, true, 2);
+ echo DisplayMap($map, $mapID, 'example', 2);
echo '</div>';
echo '</div>';
}
@@ -272,6 +272,13 @@ function showStats(type) {
showStats(0);
</script>
+<div id="copy">
+ Copyright &copy; 2011 pathery.com
+</div>
+
+<script src="sounds/script/soundmanager.js"></script>
+<script type="text/javascript">soundManagerInit();</script>
+
<?php
htmlFooter();
?>