",true);
addnav("","taunt.php?op=save&tauntid=$tauntid");
if ($tauntid!=""){
$sql = "SELECT * FROM " . db_prefix("taunts") . " WHERE tauntid=\"$tauntid\"";
$result = db_query($sql);
$row = db_fetch_assoc($result);
require_once("lib/substitute.php");
$badguy=array('creaturename'=>'Baron Munchausen', 'creatureweapon'=>'Bad Puns');
$taunt = substitute_array($row['taunt']);
$taunt = call_user_func_array("sprintf_translate", $taunt);
output("Preview: %s`0`n`n", $taunt);
} else {
$row = array('tauntid'=>0, 'taunt'=>"");
}
output("Taunt: ");
rawoutput("
");
output("The following codes are supported (case matters):`n");
output("%w = The player's name (also can be specified as {goodguy}`n");
output("%x = The player's weapon (also can be specified as {weapon}`n");
output("%a = The player's armor (also can be specified as {armor}`n");
output("%s = Subjective pronoun for the player (him her)`n");
output("%p = Possessive pronoun for the player (his her)`n");
output("%o = Objective pronoun for the player (he she)`n");
output("%W = The monster's name (also can be specified as {badguy}`n");
output("%X = The monster's weapon (also can be specified as {creatureweapon}`n");
$save = translate_inline("Save");
rawoutput("");
rawoutput("");
}else if($op=="del"){
$sql = "DELETE FROM " . db_prefix("taunts") . " WHERE tauntid=\"$tauntid\"";
db_query($sql);
$op = "";
httpset("op", "");
}else if($op=="save"){
$taunt = httppost('taunt');
if ($tauntid!=""){
$sql = "UPDATE " . db_prefix("taunts") . " SET taunt=\"$taunt\",editor=\"".addslashes($session['user']['login'])."\" WHERE tauntid=\"$tauntid\"";
}else{
$sql = "INSERT INTO " . db_prefix("taunts") . " (taunt,editor) VALUES (\"$taunt\",\"".addslashes($session['user']['login'])."\")";
}
db_query($sql);
$op = "";
httpset("op", "");
}
if ($op == "") {
$sql = "SELECT * FROM " . db_prefix("taunts");
$result = db_query($sql);
rawoutput("
$op | $t | $auth |
"); $edit = translate_inline("Edit"); $del = translate_inline("Del"); $conf = translate_inline("Are you sure you wish to delete this taunt?"); $id = $row['tauntid']; rawoutput("[ $edit | $del ]"); addnav("","taunt.php?op=edit&tauntid=$id"); addnav("","taunt.php?op=del&tauntid=$id"); rawoutput(" | "); output_notl("%s", $row['taunt']); rawoutput(" | "); output_notl("%s", $row['editor']); rawoutput(" |