moved hiscore functions into seperate file

This commit is contained in:
Rob Pearce 2008-11-06 02:34:17 +00:00
parent feb7606510
commit 9f78f1cf77
2 changed files with 74 additions and 62 deletions

View File

@ -0,0 +1,72 @@
<script language="php">
$havefunctions = 1;
function getbgcolor($p) {
if ($p == 1) {
$col = "bgcolor=\"#00ff00\"";
} else if ($p == 2) {
$col = "bgcolor=\"#11ff11\"";
} else if ($p == 3) {
$col = "bgcolor=\"#33ff33\"";
} else if ($p == 4) {
$col = "bgcolor=\"#55ff55\"";
} else if ($p == 5) {
$col = "bgcolor=\"#77ff77\"";
} else if ($p == 6) {
$col = "bgcolor=\"#99ff99\"";
} else if ($p == 7) {
$col = "bgcolor=\"#bbffbb\"";
} else if ($p == 8) {
$col = "bgcolor=\"#ccffcc\"";
} else if ($p == 9) {
$col = "bgcolor=\"#ddffdd\"";
} else if ($p == 10) {
$col = "bgcolor=\"#eeffee\"";
} else {
$col = "bgcolor=\"#ffffff\"";
}
return $col;
}
function getworld($lev) {
$wnum = (int)(($lev-1)/20)+1;
$lnum = (int)($lev % 20);
if ($lnum == 0) return $lnum = 20;
return $wnum . "-" . $lnum;
}
function addcommas($fullnum) {
if ($fullnum >= 0) {
$num = $fullnum;
} else {
$num = -$fullnum;
}
$cbuf = "";
$ccount = 0;
for ($pos = strlen($num)-1; $pos >= 0 ; $pos--) {
$ctemp = sprintf("%s%s",$cbuf, substr($num,$pos,1));
$cbuf = $ctemp;
$ccount++;
if (($ccount == 3) && ($pos != 0)) {
$ctemp = sprintf("%s,", $cbuf);
$cbuf = $ctemp;
$ccount = 0;
}
}
$rbuf = "";
for ($pos = strlen($cbuf)-1; $pos >= 0; $pos--) {
$rbuf = $rbuf . sprintf("%s", substr($cbuf, $pos, 1));
}
if ($fullnum >= 0) return $rbuf;
else return "-" . $rbuf;
}
</script>

View File

@ -1,67 +1,7 @@
<script language="php">
function getbgcolor($p) {
if ($p == 1) {
$col = "bgcolor=\"#00ff00\"";
} else if ($p == 2) {
$col = "bgcolor=\"#11ff11\"";
} else if ($p == 3) {
$col = "bgcolor=\"#33ff33\"";
} else if ($p == 4) {
$col = "bgcolor=\"#55ff55\"";
} else if ($p == 5) {
$col = "bgcolor=\"#77ff77\"";
} else if ($p == 6) {
$col = "bgcolor=\"#99ff99\"";
} else if ($p == 7) {
$col = "bgcolor=\"#bbffbb\"";
} else if ($p == 8) {
$col = "bgcolor=\"#ccffcc\"";
} else if ($p == 9) {
$col = "bgcolor=\"#ddffdd\"";
} else if ($p == 10) {
$col = "bgcolor=\"#eeffee\"";
} else {
$col = "bgcolor=\"#ffffff\"";
}
return $col;
}
function getworld($lev) {
$wnum = (int)(($lev-1)/20)+1;
$lnum = (int)($lev % 20);
if ($lnum == 0) return $lnum = 20;
return $wnum . "-" . $lnum;
}
function addcommas($fullnum) {
if ($fullnum >= 0) {
$num = $fullnum;
} else {
$num = -$fullnum;
}
$cbuf = "";
$ccount = 0;
for ($pos = strlen($num)-1; $pos >= 0 ; $pos--) {
$ctemp = sprintf("%s%s",$cbuf, substr($num,$pos,1));
$cbuf = $ctemp;
$ccount++;
if (($ccount == 3) && ($pos != 0)) {
$ctemp = sprintf("%s,", $cbuf);
$cbuf = $ctemp;
$ccount = 0;
}
}
$rbuf = "";
for ($pos = strlen($cbuf)-1; $pos >= 0; $pos--) {
$rbuf = $rbuf . sprintf("%s", substr($cbuf, $pos, 1));
}
if ($fullnum >= 0) return $rbuf;
else return "-" . $rbuf;
if (!isset($havefunctions)) {
include("functions.php");
}
if (isset($_GET['easymode'])) {