summaryrefslogtreecommitdiffstats
path: root/pages/admin.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-01-26 02:22:10 -0800
committerPatrick Davison <snapwilliam@gmail.com>2013-01-26 02:22:10 -0800
commitae3bbe1c82ab5cca5bf9f26843efe8d3fd52185c (patch)
treefdee07606907e34f73ab86b3bc847cfb3cc75bbc /pages/admin.php
parent410b98f546aba9189355364a24193eb55622c035 (diff)
downloadpathery-ae3bbe1c82ab5cca5bf9f26843efe8d3fd52185c.tar.xz
Deleting dead code.
Diffstat (limited to 'pages/admin.php')
-rw-r--r--pages/admin.php165
1 files changed, 0 insertions, 165 deletions
diff --git a/pages/admin.php b/pages/admin.php
index e6c0164..630879a 100644
--- a/pages/admin.php
+++ b/pages/admin.php
@@ -94,171 +94,6 @@ Echo "
";
-//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());
- }
-}
-
-
-
-
-
-
-function createThumbnail($mapMatrix, $idprefix, $width, $height) {
- //Iterate through $mapMatrix and generate the html
-
- $maptable = ""; //The string to return to the database.
- $index = 0; //The current number of tiles from the last tile saved.
-
- for( $i = 1; $i < count($mapMatrix); $i++)
- {
- $maptable .= "<tr>";
- for( $j = 0; $j < count($mapMatrix[$i]); $j++)
- {
- //==
- $index++;
-
- $handle = "$idprefix,$i,$j";
- switch($mapMatrix[$i][$j])
- {
- case 's': $maptable .= "<td class='grid_td_start' id='$handle' ></td>"; break;
- case 'f': $maptable .= "<td class='grid_td_finish' id='$handle' ></td>"; break;
- case 't': $maptable .= "<td class='grid_td_tp1_in' id='$handle' ></td>"; break;
- //case 't': $maptable .= "<td class='grid_td_tp1_in' id='$handle' ><img class='grid_img' src='images/OverlayTeleport.png' /></td>"; break;
- case 'u': $maptable .= "<td class='grid_td_tp1_out' id='$handle' ></td>"; break;
- case 'm': $maptable .= "<td class='grid_td_tp2_in' id='$handle' ></td>"; break;
- case 'n': $maptable .= "<td class='grid_td_tp2_out' id='$handle' ></td>"; break;
-
- case 'a': $maptable .= "<td class='grid_td_cpa' id='$handle' ></td>"; break;
- case 'b': $maptable .= "<td class='grid_td_cpb' id='$handle' ></td>"; break;
- case 'c': $maptable .= "<td class='grid_td_cpc' id='$handle' ></td>"; break;
- case 'd': $maptable .= "<td class='grid_td_cpd' id='$handle' ></td>"; break;
- case 'e': $maptable .= "<td class='grid_td_cpe' id='$handle' ></td>"; break;
-
- case 'r': $maptable .= "<td class='grid_td_rocks' id='$handle' ></td>"; break; //rock
- case 'w': $maptable .= "<td class='grid_td_walls' id='$handle' onClick='grid_click(this)' ></td>"; break; //wall
- //default: $maptable .= "<td class='grid_td' id='$handle' onClick='grid_click(this)' >".$index."</td>";
- default: $maptable .= "<td class='grid_td' id='$handle' onClick='grid_click(this)' ></td>";
- //default: $maptable .= "<td class='grid_td' id='$handle' onClick='grid_click(this)' >".$mapMatrix[$i][$j]."</td>";
- }
- }
- $maptable .= "</tr>";
- }
- //Prepare mapdata.
- $mapdata['height'] = $mapMatrix[0][0];
- $mapdata['width'] = $mapMatrix[0][1];
- $mapdata['points'] = $mapMatrix[0][2];
- $mapdata['rocks'] = $mapMatrix[0][3];
- $mapdata['walls'] = $mapMatrix[0][4];
- $mapdata['teleports'] = $mapMatrix[0][5];
- $mapdata['example'] = $example;
- $mapdata['mapid'] = $idprefix;
-
- $path = routePath($mapMatrix);
- $mapdata['code'] = GenerateMapCode($mapMatrix);
-
- $width = (($j * 35) + 2).'px';
- //$width = (($j * 23) + 2).'px';
- $i -= 1;
- $height = (($i * 35)).'px';
- //$height = (($i * 22) + 2).'px';
-
- $jsonmap = json_encode($mapdata);
- $mapdatadiv .= "<div id='$idprefix,mapdata' style='visibility:hidden;display:none'>";
- $mapdatadiv .= $jsonmap;
- $mapdatadiv .= '</div>';
-
- $maptable = "<table style='width:$width;height:$height;' class='grid_table'>
- $maptable
- </table>";
-
- if ($example) {
- $output = $maptable;
- $output .= "<input id='$idprefix,btn' type='button' onclick='doSend($idprefix)' value='Test path' />";
- $output .= "
- <div style='display:none;'>
- <input type='radio' name='$idprefix,speed' id='$idprefix,spdslow' checked=true />
- <input type='radio' name='$idprefix,speed' id='$idprefix,spdmed' />
- <input type='radio' name='$idprefix,speed' id='$idprefix,spdfast' />
- <input type='checkbox' id='$idprefix,mute' checked=true class='checkbox_mute' />
- </div>
- ";
- $output .= $mapdatadiv;
- $output = "<div style='width:$width;height:$height;'>
- $output
- </div>";
- return $output;
- }
-
- $output = "
-<div id='$idprefix,outer' class='grid_outer' style='width:".($width+30)."px;height:".($height+60)."px;'>
-
- <div class='grid_dsp_left dsp_60'>
- <div id='$idprefix,dspID' class='grid_dsp_data' title='MapID: $idprefix'>
- MapID: $idprefix
- </div>
- </div>
-
- <div id='$idprefix,dsptl' class='grid_dsp_mid dsp_24'>
- <a href='javascript:resetwalls($idprefix)'>Reset</a>
- </div>
-
-
- <div id='$idprefix,dsptr' class='grid_dsp_right dsp_24'>
- <div id='$idprefix,dspWalls' class='grid_dsp_data'>
- ".$mapdata['walls']." walls
- </div>
- </div>
-
- $maptable
-
- <div id='$idprefix,dspbl' class='grid_dsp_left dsp_49'>
- <input id='$idprefix,btn' type='button' onclick='doSend($idprefix)' value='Test path' />
-
- <label><input type='radio' name='$idprefix,speed' id='$idprefix,spdslow' />slow</label>
- <label><input type='radio' name='$idprefix,speed' id='$idprefix,spdmed' checked=true />med</label>
- <label><input type='radio' name='$idprefix,speed' id='$idprefix,spdfast' />fast</label>
- </div>
-
- <div class='grid_dsp_mid dsp_16'>
- <label><input type='checkbox' id='$idprefix,mute' class='checkbox_mute' />Mute</label>
- </div>
-
- <div id='$idprefix,dspbr' class='grid_dsp_right dsp_33'>
- <div id='$idprefix,dspCount' class='grid_dsp_data'>
- ".$path['moves']." moves
- </div>
- </div>
-
- $mapdatadiv
-</div>
- ";
-
- return $output;
-}
htmlFooter();
?> \ No newline at end of file