if (0 && $cmd == 'create') { echo("Sorry! ProgressQuest.com is down. Try again in a few days... In the meantime, create a character offline."); exit(); } include('log.php'); include('db.php'); include('util.php'); if ($cmd == 'create') { //header('content-type: text/plain'); srand((double)microtime()*1000000); $passkey = rand(); $name = arg($name); $result = mysql_query("SELECT * FROM pqhi WHERE name='$name' and level >= 1") or die(mysql_error()); if (mysql_num_rows($result) > 0) { echo("The character name you have selected is not available. Please choose a different name."); } else if (!is_numeric($rev) || $rev < 2) { echo("You version of Progress Quest is obsolete. You must download the latest version of Progress Quest before you can create any more online characters. Please visit http://progressquest.com/"); } else { mysql_query("DELETE FROM pqhi WHERE name='$name'") or die(mysql_error()); mysql_query("INSERT INTO pqhi(name,passkey) VALUES ('$name',$passkey)") or die(mysql_error()); echo("ok|$passkey"); } exit(); } else if ($cmd == 'brag') { $name = arg($name); $class = arg($class); $race = arg($race); $level = intval($level); $plot = arg($plot); $item = arg($item); $spell = arg($spell); $stat = arg($stat); $motto = arg($motto); $ip = mysql_escape_string($REMOTE_ADDR); $result = mysql_query("SELECT passkey FROM pqhi WHERE name='$name'") or die(mysql_error()); $key = mysql_result($result,0,0); if ($passkey == ((~$level * 9831) ^ $key)) { mysql_query("UPDATE pqhi SET class='$class', race='$race', level='$level', item='$item', spell='$spell', stat='$stat', plot='$plot', motto='$motto', ip='$ip' WHERE name='$name'"); if (($level > 299) || ($REMOTE_ADDR == '208.180.156.195')) mysql_query("UPDATE pqhi SET stigma=1 WHERE name='$name'"); echo("ok"); } else { echo("forbidden"); } exit(); } if (isset($cmd)) { echo("'$cmd'?"); exit(); } if (!is_numeric($min)) $min = 0; if (!is_numeric($max)) $max = $cheaters ? 100 : 10; if (isset($name)) { $sname = arg($name); $result = mysql_query("SELECT level,stamp,stigma FROM pqhi WHERE level >= 1 AND name='$sname'"); if ($row = mysql_fetch_row($result)) { $l = $row[0]; $s = $row[1]; $cheaters = $row[2]; $filter = $cheaters ? '(stigma > 0)' : '(stigma = 0)'; $result = mysql_query("SELECT COUNT(*) FROM pqhi WHERE $filter AND (level > $l OR (level = $l AND stamp < '$s'))") or die(mysql_error()); $min = mysql_result($result, 0); $min -= 6; $max = 13; if ($min < 0) { $max += $min; $min = 0; } } } $title = "Fame"; if ($cheaters) $title = "Infamy"; $filter = $cheaters ? '(stigma > 0)' : '(stigma = 0)'; $result = mysql_query("SELECT COUNT(*) FROM pqhi WHERE $filter AND level >= 1") or die(mysql_error()); $count = mysql_result($result, 0); ?>
| Rank | Name | Race | Class | Level | Prime Stat | Plot Stage | Prized Item | Specialty | Motto (Ctrl-M) |
|---|---|---|---|---|---|---|---|---|---|
Top 10 - Top 100 if (!$cheaters) { $span = $max; $max = $min + $max; if ($span > 100) $span = 100; if ($span < 10) $span = 10; if ($min > 0) { $from = $min - $span; if ($from < 0) echo("- First $span\n"); else echo("- Previous $span\n"); } if ($max < $count) { $to = $max + $span; if ($to >= $count) { $span = $count - $max; echo("- Last $span\n"); } else { echo("- Next $span\n"); } } } footer(); ?>