From ae3bbe1c82ab5cca5bf9f26843efe8d3fd52185c Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Sat, 26 Jan 2013 02:22:10 -0800 Subject: Deleting dead code. --- pages/admin.php | 165 -------------------------------------------------------- 1 file changed, 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 .= ""; - for( $j = 0; $j < count($mapMatrix[$i]); $j++) - { - //== - $index++; - - $handle = "$idprefix,$i,$j"; - switch($mapMatrix[$i][$j]) - { - case 's': $maptable .= ""; break; - case 'f': $maptable .= ""; break; - case 't': $maptable .= ""; break; - //case 't': $maptable .= ""; break; - case 'u': $maptable .= ""; break; - case 'm': $maptable .= ""; break; - case 'n': $maptable .= ""; break; - - case 'a': $maptable .= ""; break; - case 'b': $maptable .= ""; break; - case 'c': $maptable .= ""; break; - case 'd': $maptable .= ""; break; - case 'e': $maptable .= ""; break; - - case 'r': $maptable .= ""; break; //rock - case 'w': $maptable .= ""; break; //wall - //default: $maptable .= "".$index.""; - default: $maptable .= ""; - //default: $maptable .= "".$mapMatrix[$i][$j].""; - } - } - $maptable .= ""; - } - //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 .= "'; - - $maptable = " - $maptable -
"; - - if ($example) { - $output = $maptable; - $output .= ""; - $output .= " -
- - - - -
- "; - $output .= $mapdatadiv; - $output = "
- $output -
"; - return $output; - } - - $output = " -
- -
-
- MapID: $idprefix -
-
- -
- Reset -
- - -
-
- ".$mapdata['walls']." walls -
-
- - $maptable - -
- - - - - -
- -
- -
- -
-
- ".$path['moves']." moves -
-
- - $mapdatadiv -
- "; - - return $output; -} htmlFooter(); ?> \ No newline at end of file -- cgit v1.2.3