\ No newline at end of file From a73a9cb684ea491a8f9f5798f579642ce592ffe2 Mon Sep 17 00:00:00 2001 From: beatzz Date: Sun, 3 Feb 2019 16:08:21 +0900 Subject: [PATCH 2/3] test commit --- html/includes/functions.php | 407 +++++++++++++++++++++--------------- 1 file changed, 243 insertions(+), 164 deletions(-) diff --git a/html/includes/functions.php b/html/includes/functions.php index d0be5b7..afc1b0d 100755 --- a/html/includes/functions.php +++ b/html/includes/functions.php @@ -1,6 +1,7 @@ =")) ? true : false; + if ($use_fgets === null) $use_fgets = (version_compare(phpversion(), "4.3.0", ">=")) ? true : false; if ($use_fgets and $compression == 'none') { if ($length == -1) { - return(fgets($fp)); + return (fgets($fp)); } else { - return(fgets($fp, $length)); + return (fgets($fp, $length)); } } $buffer = ''; $i = 0; - while(!feof($fp)) { + while (!feof($fp)) { if ($length != -1 and $i >= $length) break; $i++; - switch($compression) { - case 'bz2': $char = bzread($fp, 1); break; - case 'zlib': $char = gzread($fp, 1); break; - default: $char = fread($fp, 1); + switch ($compression) { + case 'bz2': + $char = bzread($fp, 1); + break; + case 'zlib': + $char = gzread($fp, 1); + break; + default: + $char = fread($fp, 1); } $buffer .= $char; if ($char == "\n") break; } - if (empty($buffer) and feof($fp)) return(false); - return($buffer); + if (empty($buffer) and feof($fp)) return (false); + return ($buffer); } -function my_fopen($filename, $mode, &$compression) { - if ($compression === NULL) { +function my_fopen($filename, $mode, &$compression) +{ + if ($compression === null) { $compression = 'none'; if (substr($filename, -4) == '.bz2') { if (check_extension('bz2')) { - $compression = 'bz2'; + $compression = 'bz2'; } else { - return(false); + return (false); } } if (substr($filename, -3) == '.gz') { if (check_extension('zlib')) { - $compression = 'zlib'; + $compression = 'zlib'; } else { - return(false); + return (false); } } } - switch($compression) { - case 'bz2': $fp = @bzopen($filename, $mode); break; - case 'zlib': $fp = @gzopen($filename, $mode); break; - default: $fp = @fopen($filename, $mode); break; + switch ($compression) { + case 'bz2': + $fp = @bzopen($filename, $mode); + break; + case 'zlib': + $fp = @gzopen($filename, $mode); + break; + default: + $fp = @fopen($filename, $mode); + break; } - return($fp); + return ($fp); } -function my_fclose($fp, $compression) { - switch($compression) { - case 'bz2': return(@bzclose($fp)); - case 'zlib': return(@gzclose($fp)); - default: return(@fclose($fp)); +function my_fclose($fp, $compression) +{ + switch ($compression) { + case 'bz2': + return (@bzclose($fp)); + case 'zlib': + return (@gzclose($fp)); + default: + return (@fclose($fp)); } } // Small query -function small_query($query) { - $sql_small = "$query"; - $q_small = mysqli_query($GLOBALS["___mysqli_link"], $sql_small) or die(mysqli_error($GLOBALS["___mysqli_link"])); - $r_small = mysqli_fetch_array($q_small); - return $r_small; +function small_query($query) +{ + $sql_small = "$query"; + $q_small = mysqli_query($GLOBALS["___mysqli_link"], $sql_small) or die(mysqli_error($GLOBALS["___mysqli_link"])); + $r_small = mysqli_fetch_array($q_small); + return $r_small; } // Small query count -function small_count($query) { - $sql_small = "$query"; - $q_small = mysqli_query($GLOBALS["___mysqli_link"], $sql_small) or die(mysqli_error($GLOBALS["___mysqli_link"])); - $r_small = mysqli_num_rows($q_small); - return $r_small; +function small_count($query) +{ + $sql_small = "$query"; + $q_small = mysqli_query($GLOBALS["___mysqli_link"], $sql_small) or die(mysqli_error($GLOBALS["___mysqli_link"])); + $r_small = mysqli_num_rows($q_small); + return $r_small; } // uid generator -function str_rand($length = 8, $seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') { +function str_rand($length = 8, $seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') +{ $str = ''; $seeds_count = strlen($seeds); // Seed list($usec, $sec) = explode(' ', microtime()); - $seed = (float) $sec + ((float) $usec * 100000); + $seed = (float)$sec + ((float)$usec * 100000); mt_srand($seed); // Generate for ($i = 0; $length > $i; $i++) { - $str .= $seeds{mt_rand(0, $seeds_count - 1)}; + $str .= $seeds { + mt_rand(0, $seeds_count - 1)}; } return $str; } -function zero_out($data) { - if (!is_array($data)) return($data); - foreach($data as $key => $value) { +function zero_out($data) +{ + if (!is_array($data)) return ($data); + foreach ($data as $key => $value) { if ($value == '0') $data[$key] = ''; } - return($data); + return ($data); } -function get_dp($number) { +function get_dp($number) +{ $dp = number_format($number, 2, '.', ''); return ($dp); } -function sec2min($number) { - $dp = $number/60; +function sec2min($number) +{ + $dp = $number / 60; $dp = number_format($dp, 2, '.', ''); return ($dp); } -function sec2hour($number) { - $dp = $number/3600; +function sec2hour($number) +{ + $dp = $number / 3600; $dp = number_format($dp, 2, '.', ''); return ($dp); } -function un_ut($name) { +function un_ut($name) +{ $gname = str_replace("Botpack.", "", "$name"); $gname = str_replace("Class ", "", "$gname"); $gname = str_replace("CTFGame", "Capture The Flag", "$gname"); @@ -179,7 +208,8 @@ function un_ut($name) { return ($gname); } -function mtimestamp($date) { +function mtimestamp($date) +{ $hour = substr($date, 8, 2); $minute = substr($date, 10, 2); $second = 00; @@ -187,15 +217,17 @@ function mtimestamp($date) { $month = substr($date, 4, 2); $year = substr($date, 0, 4); - return(mktime($hour,$minute,$second,$month,$day,$year)); + return (mktime($hour, $minute, $second, $month, $day, $year)); } -function mdate($date) { +function mdate($date) +{ $ourdate = date('D, M j Y \a\t g:i a', mtimestamp($date)); return ($ourdate); } -function mdate2($date) { +function mdate2($date) +{ $hour = substr("$date", 8, 2); $minute = substr("$date", 10, 2); $second = "00"; @@ -203,13 +235,14 @@ function mdate2($date) { $month = substr("$date", 4, 2); $year = substr("$date", 0, 4); - $ourdate = mktime($hour,$minute,$second,$month,$day,$year); + $ourdate = mktime($hour, $minute, $second, $month, $day, $year); $ourdate = date('Y-m-d g:i a', $ourdate); return ($ourdate); } -function utdate($gametime) { +function utdate($gametime) +{ $year = substr("$gametime", 0, 4); $month = substr("$gametime", 5, 2); $day = substr("$gametime", 8, 2); @@ -221,7 +254,8 @@ function utdate($gametime) { return ($gametime); } -function btcaptime($time) { +function btcaptime($time) +{ if (empty($time)) { return; } @@ -244,38 +278,42 @@ function btcaptime($time) { } // UT Server Query Functions -function GetItemInfo ($itemname, $itemchunks) { +function GetItemInfo($itemname, $itemchunks) +{ $retval = "N/A"; for ($i = 0; $i < count($itemchunks); $i++) { //Found this item if (strcasecmp($itemchunks[$i], $itemname) == 0) { - $retval = $itemchunks[$i+1]; + $retval = $itemchunks[$i + 1]; } } - return $retval; + return $retval; } -function GetMinutes($seconds) { +function GetMinutes($seconds) +{ $timemins = intval($seconds / 60); $timesecs = ($seconds % 60); $Reqlength = 2; //Amount of digits we need - if ($Reqlength-strlen($timemins) > 0) $timemins = str_repeat("0",($Reqlength-strlen($timemins))) . $timemins; - if ($Reqlength-strlen($timesecs) > 0) $timesecs = str_repeat("0",($Reqlength-strlen($timesecs))) . $timesecs; + if ($Reqlength - strlen($timemins) > 0) $timemins = str_repeat("0", ($Reqlength - strlen($timemins))) . $timemins; + if ($Reqlength - strlen($timesecs) > 0) $timesecs = str_repeat("0", ($Reqlength - strlen($timesecs))) . $timesecs; return $timemins . ":" . $timesecs; } -function FlagImage($country, $mini = true) { +function FlagImage($country, $mini = true) +{ global $a_countries; $width = ($mini) ? 20 : 20; $height = ($mini) ? 14 : 14; - if (empty($country)) return(''); - if (!file_exists("assets/images/flags/$country.png")) return(''); //18*12 + if (empty($country)) return (''); + if (!file_exists("assets/images/flags/$country.png")) return (''); //18*12 $countryname = (isset($a_countries[$country])) ? $a_countries[$country] : ''; - return(''. $country .''); + return ('' . $country . ''); } -function RankMovement($diff) { +function RankMovement($diff) +{ $diff = round($diff, 2); if ($diff == 0) { $chimg = 'same'; @@ -283,28 +321,29 @@ function RankMovement($diff) { } if ($diff > 0) { $chimg = 'up'; - $chtext = "gained ". get_dp($diff) ." ranking points"; + $chtext = "gained " . get_dp($diff) . " ranking points"; } if ($diff < 0) { $chimg = 'down'; - $chtext = "lost ". get_dp($diff * -1) ." ranking points"; + $chtext = "lost " . get_dp($diff * -1) . " ranking points"; } $moveimg = ''; if (file_exists("assets/images/ranks/$chimg.png")) { $infos = getimagesize("assets/images/ranks/$chimg.png"); $width = $infos[0]; $height = $infos[1]; - $moveimg = ''; + $moveimg = ''; } - return($moveimg); + return ($moveimg); } -function ordinal($number) { +function ordinal($number) +{ // when fed a number, adds the English ordinal suffix. Works for any number, even negatives - if ($number % 100 > 10 && $number %100 < 14) { + if ($number % 100 > 10 && $number % 100 < 14) { $suffix = "th"; } else { - switch($number % 10) { + switch ($number % 10) { case 0: $suffix = "th"; break; @@ -330,185 +369,219 @@ function ordinal($number) { return $suffix; } -function RankImageOrText($pid, $name, $rank, $gid, $gamename, $mini = true, $format = NULL, $rankchange = NULL) { +function RankImageOrText($pid, $name, $rank, $gid, $gamename, $mini = true, $format = null, $rankchange = null) +{ $points = 0; if (empty($rank)) { $r_rank = small_query("SELECT rank FROM uts_rank WHERE pid = '$pid' AND gid= '$gid';"); - if (!$r_rank) return(''); + if (!$r_rank) return (''); $points = get_dp($r_rank['rank']); $r_no = small_query("SELECT (COUNT(*) + 1) AS no FROM uts_rank WHERE gid = '$gid' and rank > ${points}9"); $rank = $r_no['no']; } $img = ''; - $ranktext = $rank.ordinal($rank); + $ranktext = $rank . ordinal($rank); if (file_exists("assets/images/ranks/$rank.png")) { - $img = ''. $rank .''; + $img = '' . $rank . ''; } $moveimg = ''; if ($rankchange !== null) { - $moveimg = ' '. RankMovement($rankchange); + $moveimg = ' ' . RankMovement($rankchange); } if (empty($format)) { if ($img) { - return($img.$moveimg); + return ($img . $moveimg); } else { - return('('.$ranktext.$moveimg.')'); + return ('(' . $ranktext . $moveimg . ')'); } } $imageortext = ($img) ? $img : $ranktext; - $search = array('%RT%', '%RN%', '%RP%', '%RI%', '%GN%', '%PN%', '%IT%'); - $replace = array($ranktext, $rank, $points, $img, $gamename, $name, $imageortext); - return(str_replace($search, $replace, $format)); + $search = array('%RT%', '%RN%', '%RP%', '%RI%', '%GN%', '%PN%', '%IT%'); + $replace = array($ranktext, $rank, $points, $img, $gamename, $name, $imageortext); + return (str_replace($search, $replace, $format)); } -function FormatPlayerName($country, $pid, $name, $gid = NULL, $gamename = NULL, $mini = true, $rankchange = NULL) { +function FormatPlayerName($country, $pid, $name, $gid = null, $gamename = null, $mini = true, $rankchange = null) +{ static $cache = array(); - if (isset($cache[$pid])) return($cache[$pid]); + if (isset($cache[$pid])) return ($cache[$pid]); $ranktext = false; - if (!empty($gamename) and $pid !== NULL) { - $ranktext = RankImageOrText($pid, $name, 0, $gid, $gamename, $mini, NULL, $rankchange); + if (!empty($gamename) and $pid !== null) { + $ranktext = RankImageOrText($pid, $name, 0, $gid, $gamename, $mini, null, $rankchange); } $ret = ''; - if (!empty($country)) $ret .= FlagImage($country, $mini) ." "; + if (!empty($country)) $ret .= FlagImage($country, $mini) . " "; $ret .= htmlentities($name); if ($ranktext) $ret .= " " . $ranktext; $cache[$pid] = $ret; - return($ret); + return ($ret); } -function QuoteHintText($text) { +function QuoteHintText($text) +{ $search = array('\\', '\'', '(', ')'); $replace = array('\\\\', '\\\'', '\\(', '\\)'); - return(str_replace($search, $replace, $text)); + return (str_replace($search, $replace, $text)); } -function OverlibPrintHint($name, $text = NULL, $caption = NULL) { - include(dirname(__FILE__) .'/hints.php'); - if (!isset($hint[$name]) and empty($text)) return(''); - if ($text === NULL) $text = $hint[$name]['text']; - if ($caption === NULL and isset($hint[$name]['caption'])) $caption = $hint[$name]['caption']; - $rv = 'onmouseover="return overlib(\''. QuoteHintText($text) .'\''; - if ($caption !== NULL) $rv .= ', CAPTION, \''. QuoteHintText($caption) .'\''; +function OverlibPrintHint($name, $text = null, $caption = null) +{ + include(dirname(__FILE__) . '/hints.php'); + if (!isset($hint[$name]) and empty($text)) return (''); + if ($text === null) $text = $hint[$name]['text']; + if ($caption === null and isset($hint[$name]['caption'])) $caption = $hint[$name]['caption']; + $rv = 'onmouseover="return overlib(\'' . QuoteHintText($text) . '\''; + if ($caption !== null) $rv .= ', CAPTION, \'' . QuoteHintText($caption) . '\''; $rv .= ');" '; $rv .= 'onmouseout="return nd();"'; - return($rv); + return ($rv); } -function debug_output($desc, $data) { +function debug_output($desc, $data) +{ echo '
';
-  echo $desc .": ";
+  echo $desc . ": ";
 
   $len = strlen($data);
   for ($i = 0; $i < $len; $i++) {
-    echo substr($data, $i, 1) .'  ';
+    echo substr($data, $i, 1) . '  ';
   }
 
   echo "\n";
   echo str_repeat(' ', (strlen($desc) + 2));
 
   for ($i = 0; $i < $len; $i++) {
-    echo ord(substr($data, $i, 1)) .' ';
+    echo ord(substr($data, $i, 1)) . ' ';
   }
   echo "
"; } -function check_extension($name) { - if (extension_loaded($name)) return(true); - if( !(bool)ini_get("enable_dl") or (bool)ini_get( "safe_mode" )) return(false); +function check_extension($name) +{ + if (extension_loaded($name)) return (true); + if (!(bool)ini_get("enable_dl") or (bool)ini_get("safe_mode")) return (false); $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : ''; - return(@dl($prefix . $name . PHP_SHLIB_SUFFIX)); + return (@dl($prefix . $name . PHP_SHLIB_SUFFIX)); } -function compress_file($method, $in, $out, $stripx00) { - if ((!file_exists($out) and !is_writeable(dirname($out))) or (file_exists($out) and !is_writable($out))) return(false); +function compress_file($method, $in, $out, $stripx00) +{ + if ((!file_exists($out) and !is_writeable(dirname($out))) or (file_exists($out) and !is_writable($out))) return (false); $blocksize = 8192; - switch($method) { - case 'bz2': $suffix = '.bz2'; break; - case 'zlib': $suffix = '.gz'; break; - case 'none': $suffix = ''; break; - default: return(false); + switch ($method) { + case 'bz2': + $suffix = '.bz2'; + break; + case 'zlib': + $suffix = '.gz'; + break; + case 'none': + $suffix = ''; + break; + default: + return (false); } if (substr($out, strlen($out) - strlen($suffix)) != $suffix) $out .= $suffix; $fp_in = fopen($in, 'rb'); - if (!$fp_in) return(false); - switch($method) { - case 'bz2': $fp_out = @bzopen($out, 'wb'); break; - case 'zlib': $fp_out = @gzopen($out, 'wb6'); break; - case 'none': $fp_out = @fopen($out, 'wb'); break; + if (!$fp_in) return (false); + switch ($method) { + case 'bz2': + $fp_out = @bzopen($out, 'wb'); + break; + case 'zlib': + $fp_out = @gzopen($out, 'wb6'); + break; + case 'none': + $fp_out = @fopen($out, 'wb'); + break; } - if (!$fp_out) return(false); + if (!$fp_out) return (false); while (!feof($fp_in)) { $buffer = @fread($fp_in, $blocksize); - if ($buffer === false) return(false); + if ($buffer === false) return (false); if ($stripx00) $buffer = preg_replace('/[\x00]/', '', $buffer); - switch($method) { - case 'bz2': $bytes = @bzwrite($fp_out, $buffer, strlen($buffer)); break; - case 'zlib': $bytes = @gzwrite($fp_out, $buffer, strlen($buffer)); break; - case 'none': $bytes = @fwrite($fp_out, $buffer, strlen($buffer)); break; + switch ($method) { + case 'bz2': + $bytes = @bzwrite($fp_out, $buffer, strlen($buffer)); + break; + case 'zlib': + $bytes = @gzwrite($fp_out, $buffer, strlen($buffer)); + break; + case 'none': + $bytes = @fwrite($fp_out, $buffer, strlen($buffer)); + break; } - if ($bytes === false) return(false); + if ($bytes === false) return (false); } @fclose($fp_in); - switch($method) { - case 'bz2': @bzclose($fp_out); break; - case 'zlib': @gzclose($fp_out); break; - case 'none': @fclose($fp_out); break; + switch ($method) { + case 'bz2': + @bzclose($fp_out); + break; + case 'zlib': + @gzclose($fp_out); + break; + case 'none': + @fclose($fp_out); + break; } - return(true); + return (true); } -function backup_logfile($method, $filename, $backupfilename, $stripx00) { +function backup_logfile($method, $filename, $backupfilename, $stripx00) +{ switch ($method) { case 'compress': if (!check_extension('bz2') or !compress_file('bz2', $filename, $backupfilename, $stripx00)) { - return(backup_logfile('gzip', $filename, $backupfilename, $stripx00)); + return (backup_logfile('gzip', $filename, $backupfilename, $stripx00)); } - return('Succeeded (bz2)'); + return ('Succeeded (bz2)'); break; case 'gzip': if (!check_extension('zlib') or !compress_file('zlib', $filename, $backupfilename, $stripx00)) { - return(backup_logfile('yes', $filename, $backupfilename, $stripx00)); + return (backup_logfile('yes', $filename, $backupfilename, $stripx00)); } - return('Succeeded (gzip)'); + return ('Succeeded (gzip)'); break; case 'no': - return('NO (disabled in config)'); + return ('NO (disabled in config)'); break; default: if ($stripx00) { if (compress_file('none', $filename, $backupfilename, $stripx00)) { - return('Succeeded (uncompressed)'); + return ('Succeeded (uncompressed)'); } else { - return('FAILED' . (!empty($php_errormsg) ? ': '. $php_errormsg : '')); + return ('FAILED' . (!empty($php_errormsg) ? ': ' . $php_errormsg : '')); } } if (@copy($filename, $backupfilename)) { - return('Succeeded (uncompressed)'); + return ('Succeeded (uncompressed)'); } else { - return('FAILED' . (!empty($php_errormsg) ? ': '. $php_errormsg : '')); + return ('FAILED' . (!empty($php_errormsg) ? ': ' . $php_errormsg : '')); } } } -function purge_backups($dir, $maxage) { - if (empty($maxage) or rand(0, 5) != 0) return(NULL); +function purge_backups($dir, $maxage) +{ + if (empty($maxage) or rand(0, 5) != 0) return (null); // $maxage is days but we need seconds $maxage = $maxage * 86400; @@ -517,7 +590,7 @@ function purge_backups($dir, $maxage) { $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { if ($filename == '.htaccess' or $filename == 'index.htm') continue; - $cna = $dir .'/'. $filename; + $cna = $dir . '/' . $filename; if (@is_file($cna) and (@filemtime($cna) + $maxage) < time()) { unlink($cna); $deleted++; @@ -528,7 +601,8 @@ function purge_backups($dir, $maxage) { return $deleted; } -function file_size_info($filesize) { +function file_size_info($filesize) +{ $bytes = array('KB', 'KB', 'MB', 'GB', 'TB'); # values are always displayed if ($filesize < 1024) $filesize = 1; # in at least kilobytes. for ($i = 0; $filesize > 1024; $i++) $filesize /= 1024; @@ -537,22 +611,25 @@ function file_size_info($filesize) { return $file_size_info; } -function GetCurrentWatchlist() { - if (!isset($_COOKIE['uts_watchlist'])) return(array()); +function GetCurrentWatchlist() +{ + if (!isset($_COOKIE['uts_watchlist'])) return (array()); $watchlist = @explode(',', $_COOKIE['uts_watchlist']); - if (!$watchlist or !is_array($watchlist)) return(array()); - foreach($watchlist as $key => $value) { + if (!$watchlist or !is_array($watchlist)) return (array()); + foreach ($watchlist as $key => $value) { $watchlist[$key] = addslashes($value); } return $watchlist; } -function PlayerOnWatchlist($pid) { +function PlayerOnWatchlist($pid) +{ $watchlist = GetCurrentWatchlist(); return in_array($pid, $watchlist); } -function ToggleWatchStatus($pid) { +function ToggleWatchStatus($pid) +{ $watchlist = GetCurrentWatchlist(); if (in_array($pid, $watchlist)) { @@ -564,11 +641,12 @@ function ToggleWatchStatus($pid) { $status = 1; } - setcookie('uts_watchlist', implode(',', $watchlist), time() + 60*60*24*30*365*5); + setcookie('uts_watchlist', implode(',', $watchlist), time() + 60 * 60 * 24 * 30 * 365 * 5); return $status; } -function DeBugMessage($message) { +function DeBugMessage($message) +{ global $debug, $html; if (!$debug) { @@ -582,17 +660,18 @@ function DeBugMessage($message) { if ($html) echo '

'; } -function getMapImageName($mapname) { +function getMapImageName($mapname) +{ for ($i = 0; $i < 3; $i++) { // try substracting modname from map if ($i == 1) { - if(($x_pos = strpos($mapname, '-')) !== false) { + if (($x_pos = strpos($mapname, '-')) !== false) { $mapname = substr($mapname, $x_pos + 1); } } // try substracting league names or other known suffixes from the map - if ($i==2) { + if ($i == 2) { $mapVersions = array( 'CB1', 'CB2', @@ -648,7 +727,7 @@ function getMapImageName($mapname) { $mappic = strtolower("assets/images/maps/" . $mapname . "_large.jpg"); - if(file_exists(dirname(dirname(__FILE__)) . "/" . $mappic)) { + if (file_exists(dirname(dirname(__FILE__)) . "/" . $mappic)) { return $mappic; } } From 668e2b94e7d61c35c0579a4a675760227a8630d5 Mon Sep 17 00:00:00 2001 From: beatzz Date: Sun, 3 Feb 2019 17:53:34 +0900 Subject: [PATCH 3/3] admin login page, HTML formating :sheep: --- html/admin.php | 60 +++++++++++++++--------------- html/includes/footer.php | 73 +++++++++++++++++++------------------ html/includes/functions.php | 2 +- 3 files changed, 69 insertions(+), 66 deletions(-) diff --git a/html/admin.php b/html/admin.php index 9b20c3f..54975d2 100755 --- a/html/admin.php +++ b/html/admin.php @@ -6,10 +6,10 @@ $adminkey = $_REQUEST['uts_adminkey']; } -include 'includes/config.php'; -include 'includes/functions.php'; -include 'includes/functions_admin.php'; -include 'includes/header.php'; +require 'includes/config.php'; +require 'includes/functions.php'; +require 'includes/functions_admin.php'; +require 'includes/header.php'; // Get key from web browser if (isset($_REQUEST['key'])) { @@ -23,43 +23,45 @@ $action = (!empty($_REQUEST['action'])) ? $_REQUEST['action'] : 'main'; echo ' - - - - '; +
UTStats Administration
+ + + '; if (empty($import_adminkey)) { echo ' - - - - -
UTStats Administration
Error:No key set in config.php
'; + + Error: + No key set in config.php + + '; include 'includes/footer.php'; return; } if (!empty($adminkey) and $adminkey != $import_adminkey) { - echo 'Error: - Keys do not match - '; + echo ' + + Error: + Keys do not match + '; $adminkey = ''; } if (empty($adminkey)) { echo ' - - Enter Admin key: - -
- - - Remember the key -
- - - '; + + Enter Admin key: + +
+ + + Remember the key +
+ + + '; include 'includes/footer.php'; return; } @@ -74,8 +76,8 @@ require $fn; echo ' -
'; +
'; -include 'includes/footer.php'; +require 'includes/footer.php'; ?> diff --git a/html/includes/footer.php b/html/includes/footer.php index cedf4ca..4abdd03 100755 --- a/html/includes/footer.php +++ b/html/includes/footer.php @@ -1,43 +1,44 @@ +