game before using the control panel."); }
if ($userrow["authlevel"] != 1) { die("You must have administrator privileges to use the control panel."); }
$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control");
$controlrow = mysql_fetch_array($controlquery);
if (isset($_GET["do"])) {
$do = explode(":",$_GET["do"]);
if ($do[0] == "main") { main(); }
elseif ($do[0] == "items") { items(); }
elseif ($do[0] == "edititem") { edititem($do[1]); }
elseif ($do[0] == "drops") { drops(); }
elseif ($do[0] == "editdrop") { editdrop($do[1]); }
elseif ($do[0] == "towns") { towns(); }
elseif ($do[0] == "edittown") { edittown($do[1]); }
elseif ($do[0] == "monsters") { monsters(); }
elseif ($do[0] == "editmonster") { editmonster($do[1]); }
elseif ($do[0] == "levels") { levels(); }
elseif ($do[0] == "editlevel") { editlevel(); }
elseif ($do[0] == "spells") { spells(); }
elseif ($do[0] == "editspell") { editspell($do[1]); }
elseif ($do[0] == "users") { users(); }
elseif ($do[0] == "edituser") { edituser($do[1]); }
elseif ($do[0] == "news") { addnews(); }
} else { donothing(); }
function donothing() {
$page = "Welcome to the Dragon Knight Administration section. Use the links on the left bar to control and edit various elements of the game.
Please note that the control panel has been created mostly as a shortcut for certain individual settings. It is meant for use primarily with editing one thing at a time. If you need to completely replace an entire table (say, to replace all stock monsters with your own new ones), it is suggested that you use a more in-depth database tool such as phpMyAdmin. Also, you may want to have a copy of the Dragon Knight development kit, available from the Dragon Knight homepage.
Also, you should be aware that certain portions of the DK code are dependent on the formatting of certain database results (for example, the special attributes on item drops). While I have attempted to point these out throughout the admin script, you should definitely pay attention and be careful when editing some fields, because mistakes in the database content may result in script errors or your game breaking completely.";
admindisplay($page, "Admin Home");
}
function main() {
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($gamename == "") { $errors++; $errorlist .= "Game name is required. "; }
if (($gamesize % 5) != 0) { $errors++; $errorlist .= "Map size must be divisible by five. "; }
if (!is_numeric($gamesize)) { $errors++; $errorlist .= "Map size must be a number. "; }
if ($forumtype == 2 && $forumaddress == "") { $errors++; $errorlist .= "You must specify a forum address when using the External setting. "; }
if ($class1name == "") { $errors++; $errorlist .= "Class 1 name is required. "; }
if ($class2name == "") { $errors++; $errorlist .= "Class 2 name is required. "; }
if ($class3name == "") { $errors++; $errorlist .= "Class 3 name is required. "; }
if ($diff1name == "") { $errors++; $errorlist .= "Difficulty 1 name is required. "; }
if ($diff2name == "") { $errors++; $errorlist .= "Difficulty 2 name is required. "; }
if ($diff3name == "") { $errors++; $errorlist .= "Difficulty 3 name is required. "; }
if ($diff2mod == "") { $errors++; $errorlist .= "Difficulty 2 value is required. "; }
if ($diff3mod == "") { $errors++; $errorlist .= "Difficulty 3 value is required. "; }
if ($errors == 0) {
$query = doquery("UPDATE {{table}} SET gamename='$gamename',gamesize='$gamesize',forumtype='$forumtype',forumaddress='$forumaddress',compression='$compression',class1name='$class1name',class2name='$class2name',class3name='$class3name',diff1name='$diff1name',diff2name='$diff2name',diff3name='$diff3name',diff2mod='$diff2mod',diff3mod='$diff3mod',gameopen='$gameopen',verifyemail='$verifyemail',gameurl='$gameurl',adminemail='$adminemail',shownews='$shownews',showonline='$showonline',showbabble='$showbabble' WHERE id='1' LIMIT 1", "control");
admindisplay("Settings updated.","Main Settings");
} else {
admindisplay("Errors:
$errorlist
Please go back and try again.", "Main Settings");
}
}
global $controlrow;
$page = <<Main Settings
These options control several major settings for the overall game engine.
";
admindisplay($page, "Edit Items");
}
function edititem($id) {
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($name == "") { $errors++; $errorlist .= "Name is required. "; }
if ($buycost == "") { $errors++; $errorlist .= "Cost is required. "; }
if (!is_numeric($buycost)) { $errors++; $errorlist .= "Cost must be a number. "; }
if ($attribute == "") { $errors++; $errorlist .= "Attribute is required. "; }
if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number. "; }
if ($special == "" || $special == " ") { $special = "X"; }
if ($errors == 0) {
$query = doquery("UPDATE {{table}} SET name='$name',type='$type',buycost='$buycost',attribute='$attribute',special='$special' WHERE id='$id' LIMIT 1", "items");
admindisplay("Item updated.","Edit Items");
} else {
admindisplay("Errors:
$errorlist
Please go back and try again.", "Edit Items");
}
}
$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items");
$row = mysql_fetch_array($query);
$page = <<Edit Items
Special Codes:
Special codes can be added in the item's Special field to give it extra user attributes. Special codes are in the format attribute,value. Attribute can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. Value may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be maxhp,50.
Suggested user fields for special codes:
maxhp - max hit points
maxmp - max magic points
maxtp - max travel points
goldbonus - gold bonus, in percent
expbonus - experience bonus, in percent
strength - strength (which also adds to attackpower)
dexterity - dexterity (which also adds to defensepower)
attackpower - total attack power
defensepower - total defense power
END;
if ($row["type"] == 1) { $row["type1select"] = "selected=\"selected\" "; } else { $row["type1select"] = ""; }
if ($row["type"] == 2) { $row["type2select"] = "selected=\"selected\" "; } else { $row["type2select"] = ""; }
if ($row["type"] == 3) { $row["type3select"] = "selected=\"selected\" "; } else { $row["type3select"] = ""; }
$page = parsetemplate($page, $row);
admindisplay($page, "Edit Items");
}
function drops() {
$query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "drops");
$page = "Edit Drops Click an item's name to edit it.
\n";
$count = 1;
while ($row = mysql_fetch_array($query)) {
if ($count == 1) { $page .= "
";
admindisplay($page, "Edit Drops");
}
function editdrop($id) {
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($name == "") { $errors++; $errorlist .= "Name is required. "; }
if ($mlevel == "") { $errors++; $errorlist .= "Monster level is required. "; }
if (!is_numeric($mlevel)) { $errors++; $errorlist .= "Monster level must be a number. "; }
if ($attribute1 == "" || $attribute1 == " " || $attribute1 == "X") { $errors++; $errorlist .= "First attribute is required. "; }
if ($attribute2 == "" || $attribute2 == " ") { $attribute2 = "X"; }
if ($errors == 0) {
$query = doquery("UPDATE {{table}} SET name='$name',mlevel='$mlevel',attribute1='$attribute1',attribute2='$attribute2' WHERE id='$id' LIMIT 1", "drops");
admindisplay("Item updated.","Edit Drops");
} else {
admindisplay("Errors:
$errorlist
Please go back and try again.", "Edit Drops");
}
}
$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "drops");
$row = mysql_fetch_array($query);
$page = <<Edit Drops
Special Codes:
Special codes are used in the two attribute fields to give the item properties. The first attribute field must contain a special code, but the second one may be left empty ("X") if you wish. Special codes are in the format attribute,value. Attribute can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. Value may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be maxhp,50.
Suggested user fields for special codes:
maxhp - max hit points
maxmp - max magic points
maxtp - max travel points
goldbonus - gold bonus, in percent
expbonus - experience bonus, in percent
strength - strength (which also adds to attackpower)
dexterity - dexterity (which also adds to defensepower)
attackpower - total attack power
defensepower - total defense power
END;
$page = parsetemplate($page, $row);
admindisplay($page, "Edit Drops");
}
function towns() {
$query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "towns");
$page = "Edit Towns Click an town's name to edit it.
\n";
$count = 1;
while ($row = mysql_fetch_array($query)) {
if ($count == 1) { $page .= "
";
admindisplay($page, "Edit Towns");
}
function edittown($id) {
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($name == "") { $errors++; $errorlist .= "Name is required. "; }
if ($latitude == "") { $errors++; $errorlist .= "Latitude is required. "; }
if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number. "; }
if ($longitude == "") { $errors++; $errorlist .= "Longitude is required. "; }
if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number. "; }
if ($innprice == "") { $errors++; $errorlist .= "Inn Price is required. "; }
if (!is_numeric($innprice)) { $errors++; $errorlist .= "Inn Price must be a number. "; }
if ($mapprice == "") { $errors++; $errorlist .= "Map Price is required. "; }
if (!is_numeric($mapprice)) { $errors++; $errorlist .= "Map Price must be a number. "; }
if ($travelpoints == "") { $errors++; $errorlist .= "Travel Points is required. "; }
if (!is_numeric($travelpoints)) { $errors++; $errorlist .= "Travel Points must be a number. "; }
if ($itemslist == "") { $errors++; $errorlist .= "Items List is required. "; }
if ($errors == 0) {
$query = doquery("UPDATE {{table}} SET name='$name',latitude='$latitude',longitude='$longitude',innprice='$innprice',mapprice='$mapprice',travelpoints='$travelpoints',itemslist='$itemslist' WHERE id='$id' LIMIT 1", "towns");
admindisplay("Town updated.","Edit Towns");
} else {
admindisplay("Errors:
$errorlist
Please go back and try again.", "Edit Towns");
}
}
$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "towns");
$row = mysql_fetch_array($query);
$page = <<Edit Towns
END;
$page = parsetemplate($page, $row);
admindisplay($page, "Edit Towns");
}
function monsters() {
global $controlrow;
$statquery = doquery("SELECT * FROM {{table}} ORDER BY level DESC LIMIT 1", "monsters");
$statrow = mysql_fetch_array($statquery);
$query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "monsters");
$page = "Edit Monsters ";
if (($controlrow["gamesize"]/5) != $statrow["level"]) {
$page .= "Note: Your highest monster level does not match with your entered map size. Highest monster level should be ".($controlrow["gamesize"]/5).", yours is ".$statrow["level"].". Please fix this before opening the game to the public.
";
} else { $page .= "Monster level and map size match. No further actions are required for map compatibility.
"; }
$page .= "Click an monster's name to edit it.
\n";
$count = 1;
while ($row = mysql_fetch_array($query)) {
if ($count == 1) { $page .= "
";
admindisplay($page, "Edit Monster");
}
function editmonster($id) {
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($name == "") { $errors++; $errorlist .= "Name is required. "; }
if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required. "; }
if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number. "; }
if ($maxdam == "") { $errors++; $errorlist .= "Max Damage is required. "; }
if (!is_numeric($maxdam)) { $errors++; $errorlist .= "Max Damage must be a number. "; }
if ($armor == "") { $errors++; $errorlist .= "Armor is required. "; }
if (!is_numeric($armor)) { $errors++; $errorlist .= "Armor must be a number. "; }
if ($level == "") { $errors++; $errorlist .= "Monster Level is required. "; }
if (!is_numeric($level)) { $errors++; $errorlist .= "Monster Level must be a number. "; }
if ($maxexp == "") { $errors++; $errorlist .= "Max Exp is required. "; }
if (!is_numeric($maxexp)) { $errors++; $errorlist .= "Max Exp must be a number. "; }
if ($maxgold == "") { $errors++; $errorlist .= "Max Gold is required. "; }
if (!is_numeric($maxgold)) { $errors++; $errorlist .= "Max Gold must be a number. "; }
if ($errors == 0) {
$query = doquery("UPDATE {{table}} SET name='$name',maxhp='$maxhp',maxdam='$maxdam',armor='$armor',level='$level',maxexp='$maxexp',maxgold='$maxgold',immune='$immune' WHERE id='$id' LIMIT 1", "monsters");
admindisplay("Monster updated.","Edit monsters");
} else {
admindisplay("Errors:
$errorlist
Please go back and try again.", "Edit monsters");
}
}
$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "monsters");
$row = mysql_fetch_array($query);
$page = <<Edit Monsters
END;
if ($row["immune"] == 1) { $row["immune1select"] = "selected=\"selected\" "; } else { $row["immune1select"] = ""; }
if ($row["immune"] == 2) { $row["immune2select"] = "selected=\"selected\" "; } else { $row["immune2select"] = ""; }
if ($row["immune"] == 3) { $row["immune3select"] = "selected=\"selected\" "; } else { $row["immune3select"] = ""; }
$page = parsetemplate($page, $row);
admindisplay($page, "Edit Monsters");
}
function spells() {
$query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "spells");
$page = "Edit Spells Click an spell's name to edit it.
\n";
$count = 1;
while ($row = mysql_fetch_array($query)) {
if ($count == 1) { $page .= "
";
admindisplay($page, "Edit Spells");
}
function editspell($id) {
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($name == "") { $errors++; $errorlist .= "Name is required. "; }
if ($mp == "") { $errors++; $errorlist .= "MP is required. "; }
if (!is_numeric($mp)) { $errors++; $errorlist .= "MP must be a number. "; }
if ($attribute == "") { $errors++; $errorlist .= "Attribute is required. "; }
if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number. "; }
if ($errors == 0) {
$query = doquery("UPDATE {{table}} SET name='$name',mp='$mp',attribute='$attribute',type='$type' WHERE id='$id' LIMIT 1", "spells");
admindisplay("Spell updated.","Edit Spells");
} else {
admindisplay("Errors:
$errorlist
Please go back and try again.", "Edit Spells");
}
}
$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "spells");
$row = mysql_fetch_array($query);
$page = <<Edit Spells
END;
if ($row["type"] == 1) { $row["type1select"] = "selected=\"selected\" "; } else { $row["type1select"] = ""; }
if ($row["type"] == 2) { $row["type2select"] = "selected=\"selected\" "; } else { $row["type2select"] = ""; }
if ($row["type"] == 3) { $row["type3select"] = "selected=\"selected\" "; } else { $row["type3select"] = ""; }
if ($row["type"] == 4) { $row["type4select"] = "selected=\"selected\" "; } else { $row["type4select"] = ""; }
if ($row["type"] == 5) { $row["type5select"] = "selected=\"selected\" "; } else { $row["type5select"] = ""; }
$page = parsetemplate($page, $row);
admindisplay($page, "Edit Spells");
}
function levels() {
$query = doquery("SELECT id FROM {{table}} ORDER BY id DESC LIMIT 1", "levels");
$row = mysql_fetch_array($query);
$options = "";
for($i=2; $i<$row["id"]; $i++) {
$options .= "\n";
}
$page = <<Edit Levels Select a level number from the dropdown box to edit it.
END;
admindisplay($page, "Edit Levels");
}
function editlevel() {
if (!isset($_POST["level"])) { admindisplay("No level to edit.", "Edit Levels"); die(); }
$id = $_POST["level"];
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($_POST["one_exp"] == "") { $errors++; $errorlist .= "Class 1 Experience is required. "; }
if ($_POST["one_hp"] == "") { $errors++; $errorlist .= "Class 1 HP is required. "; }
if ($_POST["one_mp"] == "") { $errors++; $errorlist .= "Class 1 MP is required. "; }
if ($_POST["one_tp"] == "") { $errors++; $errorlist .= "Class 1 TP is required. "; }
if ($_POST["one_strength"] == "") { $errors++; $errorlist .= "Class 1 Strength is required. "; }
if ($_POST["one_dexterity"] == "") { $errors++; $errorlist .= "Class 1 Dexterity is required. "; }
if ($_POST["one_spells"] == "") { $errors++; $errorlist .= "Class 1 Spells is required. "; }
if (!is_numeric($_POST["one_exp"])) { $errors++; $errorlist .= "Class 1 Experience must be a number. "; }
if (!is_numeric($_POST["one_hp"])) { $errors++; $errorlist .= "Class 1 HP must be a number. "; }
if (!is_numeric($_POST["one_mp"])) { $errors++; $errorlist .= "Class 1 MP must be a number. "; }
if (!is_numeric($_POST["one_tp"])) { $errors++; $errorlist .= "Class 1 TP must be a number. "; }
if (!is_numeric($_POST["one_strength"])) { $errors++; $errorlist .= "Class 1 Strength must be a number. "; }
if (!is_numeric($_POST["one_dexterity"])) { $errors++; $errorlist .= "Class 1 Dexterity must be a number. "; }
if (!is_numeric($_POST["one_spells"])) { $errors++; $errorlist .= "Class 1 Spells must be a number. "; }
if ($_POST["two_exp"] == "") { $errors++; $errorlist .= "Class 2 Experience is required. "; }
if ($_POST["two_hp"] == "") { $errors++; $errorlist .= "Class 2 HP is required. "; }
if ($_POST["two_mp"] == "") { $errors++; $errorlist .= "Class 2 MP is required. "; }
if ($_POST["two_tp"] == "") { $errors++; $errorlist .= "Class 2 TP is required. "; }
if ($_POST["two_strength"] == "") { $errors++; $errorlist .= "Class 2 Strength is required. "; }
if ($_POST["two_dexterity"] == "") { $errors++; $errorlist .= "Class 2 Dexterity is required. "; }
if ($_POST["two_spells"] == "") { $errors++; $errorlist .= "Class 2 Spells is required. "; }
if (!is_numeric($_POST["two_exp"])) { $errors++; $errorlist .= "Class 2 Experience must be a number. "; }
if (!is_numeric($_POST["two_hp"])) { $errors++; $errorlist .= "Class 2 HP must be a number. "; }
if (!is_numeric($_POST["two_mp"])) { $errors++; $errorlist .= "Class 2 MP must be a number. "; }
if (!is_numeric($_POST["two_tp"])) { $errors++; $errorlist .= "Class 2 TP must be a number. "; }
if (!is_numeric($_POST["two_strength"])) { $errors++; $errorlist .= "Class 2 Strength must be a number. "; }
if (!is_numeric($_POST["two_dexterity"])) { $errors++; $errorlist .= "Class 2 Dexterity must be a number. "; }
if (!is_numeric($_POST["two_spells"])) { $errors++; $errorlist .= "Class 2 Spells must be a number. "; }
if ($_POST["three_exp"] == "") { $errors++; $errorlist .= "Class 3 Experience is required. "; }
if ($_POST["three_hp"] == "") { $errors++; $errorlist .= "Class 3 HP is required. "; }
if ($_POST["three_mp"] == "") { $errors++; $errorlist .= "Class 3 MP is required. "; }
if ($_POST["three_tp"] == "") { $errors++; $errorlist .= "Class 3 TP is required. "; }
if ($_POST["three_strength"] == "") { $errors++; $errorlist .= "Class 3 Strength is required. "; }
if ($_POST["three_dexterity"] == "") { $errors++; $errorlist .= "Class 3 Dexterity is required. "; }
if ($_POST["three_spells"] == "") { $errors++; $errorlist .= "Class 3 Spells is required. "; }
if (!is_numeric($_POST["three_exp"])) { $errors++; $errorlist .= "Class 3 Experience must be a number. "; }
if (!is_numeric($_POST["three_hp"])) { $errors++; $errorlist .= "Class 3 HP must be a number. "; }
if (!is_numeric($_POST["three_mp"])) { $errors++; $errorlist .= "Class 3 MP must be a number. "; }
if (!is_numeric($_POST["three_tp"])) { $errors++; $errorlist .= "Class 3 TP must be a number. "; }
if (!is_numeric($_POST["three_strength"])) { $errors++; $errorlist .= "Class 3 Strength must be a number. "; }
if (!is_numeric($_POST["three_dexterity"])) { $errors++; $errorlist .= "Class 3 Dexterity must be a number. "; }
if (!is_numeric($_POST["three_spells"])) { $errors++; $errorlist .= "Class 3 Spells must be a number. "; }
if ($errors == 0) {
$updatequery = <<Errors:
$errorlist
Please go back and try again.", "Edit Spells");
}
}
$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "levels");
$row = mysql_fetch_array($query);
global $controlrow;
$class1name = $controlrow["class1name"];
$class2name = $controlrow["class2name"];
$class3name = $controlrow["class3name"];
$page = <<Edit Levels
Experience values for each level should be the cumulative total amount of experience up to this point. All other values should be only the new amount to add this level.
END;
$page = parsetemplate($page, $row);
admindisplay($page, "Edit Levels");
}
function users() {
$query = doquery("SELECT id,username FROM {{table}} ORDER BY id", "users");
$page = "Edit Users Click a username to edit the account.
\n";
$count = 1;
while ($row = mysql_fetch_array($query)) {
if ($count == 1) { $page .= "
";
admindisplay($page, "Edit Users");
}
function edituser($id) {
if (isset($_POST["submit"])) {
extract($_POST);
$errors = 0;
$errorlist = "";
if ($email == "") { $errors++; $errorlist .= "Email is required. "; }
if ($verify == "") { $errors++; $errorlist .= "Verify is required. "; }
if ($charname == "") { $errors++; $errorlist .= "Character Name is required. "; }
if ($authlevel == "") { $errors++; $errorlist .= "Auth Level is required. "; }
if ($latitude == "") { $errors++; $errorlist .= "Latitude is required. "; }
if ($longitude == "") { $errors++; $errorlist .= "Longitude is required. "; }
if ($difficulty == "") { $errors++; $errorlist .= "Difficulty is required. "; }
if ($charclass == "") { $errors++; $errorlist .= "Character Class is required. "; }
if ($currentaction == "") { $errors++; $errorlist .= "Current Action is required. "; }
if ($currentfight == "") { $errors++; $errorlist .= "Current Fight is required. "; }
if ($currentmonster == "") { $errors++; $errorlist .= "Current Monster is required. "; }
if ($currentmonsterhp == "") { $errors++; $errorlist .= "Current Monster HP is required. "; }
if ($currentmonstersleep == "") { $errors++; $errorlist .= "Current Monster Sleep is required. "; }
if ($currentmonsterimmune == "") { $errors++; $errorlist .= "Current Monster Immune is required. "; }
if ($currentuberdamage == "") { $errors++; $errorlist .= "Current Uber Damage is required. "; }
if ($currentuberdefense == "") { $errors++; $errorlist .= "Current Uber Defense is required. "; }
if ($currenthp == "") { $errors++; $errorlist .= "Current HP is required. "; }
if ($currentmp == "") { $errors++; $errorlist .= "Current MP is required. "; }
if ($currenttp == "") { $errors++; $errorlist .= "Current TP is required. "; }
if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required. "; }
if ($maxmp == "") { $errors++; $errorlist .= "Max MP is required. "; }
if ($maxtp == "") { $errors++; $errorlist .= "Max TP is required. "; }
if ($level == "") { $errors++; $errorlist .= "Level is required. "; }
if ($gold == "") { $errors++; $errorlist .= "Gold is required. "; }
if ($experience == "") { $errors++; $errorlist .= "Experience is required. "; }
if ($goldbonus == "") { $errors++; $errorlist .= "Gold Bonus is required. "; }
if ($expbonus == "") { $errors++; $errorlist .= "Experience Bonus is required. "; }
if ($strength == "") { $errors++; $errorlist .= "Strength is required. "; }
if ($dexterity == "") { $errors++; $errorlist .= "Dexterity is required. "; }
if ($attackpower == "") { $errors++; $errorlist .= "Attack Power is required. "; }
if ($defensepower == "") { $errors++; $errorlist .= "Defense Power is required. "; }
if ($weaponid == "") { $errors++; $errorlist .= "Weapon ID is required. "; }
if ($armorid == "") { $errors++; $errorlist .= "Armor ID is required. "; }
if ($shieldid == "") { $errors++; $errorlist .= "Shield ID is required. "; }
if ($slot1id == "") { $errors++; $errorlist .= "Slot 1 ID is required. "; }
if ($slot2id == "") { $errors++; $errorlist .= "Slot 2 ID is required. "; }
if ($slot3id == "") { $errors++; $errorlist .= "Slot 3 ID is required. "; }
if ($weaponname == "") { $errors++; $errorlist .= "Weapon Name is required. "; }
if ($armorname == "") { $errors++; $errorlist .= "Armor Name is required. "; }
if ($shieldname == "") { $errors++; $errorlist .= "Shield Name is required. "; }
if ($slot1name == "") { $errors++; $errorlist .= "Slot 1 Name is required. "; }
if ($slot2name == "") { $errors++; $errorlist .= "Slot 2 Name is required. "; }
if ($slot3name == "") { $errors++; $errorlist .= "Slot 3 Name is required. "; }
if ($dropcode == "") { $errors++; $errorlist .= "Drop Code is required. "; }
if ($spells == "") { $errors++; $errorlist .= "Spells is required. "; }
if ($towns == "") { $errors++; $errorlist .= "Towns is required. "; }
if (!is_numeric($authlevel)) { $errors++; $errorlist .= "Auth Level must be a number. "; }
if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number. "; }
if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number. "; }
if (!is_numeric($difficulty)) { $errors++; $errorlist .= "Difficulty must be a number. "; }
if (!is_numeric($charclass)) { $errors++; $errorlist .= "Character Class must be a number. "; }
if (!is_numeric($currentfight)) { $errors++; $errorlist .= "Current Fight must be a number. "; }
if (!is_numeric($currentmonster)) { $errors++; $errorlist .= "Current Monster must be a number. "; }
if (!is_numeric($currentmonsterhp)) { $errors++; $errorlist .= "Current Monster HP must be a number. "; }
if (!is_numeric($currentmonstersleep)) { $errors++; $errorlist .= "Current Monster Sleep must be a number. "; }
if (!is_numeric($currentmonsterimmune)) { $errors++; $errorlist .= "Current Monster Immune must be a number. "; }
if (!is_numeric($currentuberdamage)) { $errors++; $errorlist .= "Current Uber Damage must be a number. "; }
if (!is_numeric($currentuberdefense)) { $errors++; $errorlist .= "Current Uber Defense must be a number. "; }
if (!is_numeric($currenthp)) { $errors++; $errorlist .= "Current HP must be a number. "; }
if (!is_numeric($currentmp)) { $errors++; $errorlist .= "Current MP must be a number. "; }
if (!is_numeric($currenttp)) { $errors++; $errorlist .= "Current TP must be a number. "; }
if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number. "; }
if (!is_numeric($maxmp)) { $errors++; $errorlist .= "Max MP must be a number. "; }
if (!is_numeric($maxtp)) { $errors++; $errorlist .= "Max TP must be a number. "; }
if (!is_numeric($level)) { $errors++; $errorlist .= "Level must be a number. "; }
if (!is_numeric($gold)) { $errors++; $errorlist .= "Gold must be a number. "; }
if (!is_numeric($experience)) { $errors++; $errorlist .= "Experience must be a number. "; }
if (!is_numeric($goldbonus)) { $errors++; $errorlist .= "Gold Bonus must be a number. "; }
if (!is_numeric($expbonus)) { $errors++; $errorlist .= "Experience Bonus must be a number. "; }
if (!is_numeric($strength)) { $errors++; $errorlist .= "Strength must be a number. "; }
if (!is_numeric($dexterity)) { $errors++; $errorlist .= "Dexterity must be a number. "; }
if (!is_numeric($attackpower)) { $errors++; $errorlist .= "Attack Power must be a number. "; }
if (!is_numeric($defensepower)) { $errors++; $errorlist .= "Defense Power must be a number. "; }
if (!is_numeric($weaponid)) { $errors++; $errorlist .= "Weapon ID must be a number. "; }
if (!is_numeric($armorid)) { $errors++; $errorlist .= "Armor ID must be a number. "; }
if (!is_numeric($shieldid)) { $errors++; $errorlist .= "Shield ID must be a number. "; }
if (!is_numeric($slot1id)) { $errors++; $errorlist .= "Slot 1 ID must be a number. "; }
if (!is_numeric($slot2id)) { $errors++; $errorlist .= "Slot 2 ID must be a number. "; }
if (!is_numeric($slot3id)) { $errors++; $errorlist .= "Slot 3 ID must be a number. "; }
if (!is_numeric($dropcode)) { $errors++; $errorlist .= "Drop Code must be a number. "; }
if ($errors == 0) {
$updatequery = <<Errors:
$errorlist
Please go back and try again.", "Edit Users");
}
}
$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users");
$row = mysql_fetch_array($query);
global $controlrow;
$diff1name = $controlrow["diff1name"];
$diff2name = $controlrow["diff2name"];
$diff3name = $controlrow["diff3name"];
$class1name = $controlrow["class1name"];
$class2name = $controlrow["class2name"];
$class3name = $controlrow["class3name"];
$page = <<Edit Users