"._WARNINGS."

"; if($_GET["delete"]) { $wid = $_GET["delete"]; if($_GET["confirm"] == "yes") { $result5 = dbquery("SELECT warning FROM ".TABLEPREFIX."fanfiction_warnings WHERE wid = '$wid'"); $warnings = dbassoc($result5); $newquery5 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_stories WHERE FIND_IN_SET($wid, wid) > 1"); while($warningresult = dbassoc($newquery5)) { $tok = strtok($warningresult['wid'], ", ");// tokenize the old list of names $newString = "";// the new list of good names while($tok) { if( $tok != $warnings['warning'] )// oldname is the thing that is going away { // It's a keeper, so decide if it is first or not for comma-age, then add it in if( $newString != "" ) $newString .= ", "; $newString .= $tok; } $tok = strtok(", "); //advance to the next token } dbquery("UPDATE ".TABLEPREFIX."fanfiction_stories SET wid = '$newString' WHERE sid = '".$warningresult['sid']."'"); } dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_warnings where wid = '$wid'"); $output .= "
"._ACTIONSUCCESSFUL."
"; } else if ($_GET["confirm"] == "no") { $output .= "
"._ACTIONCANCELLED."
"; } else { $output .= "
"._CONFIRMDELETE."

"; $output .= "[ "._YES." | "._NO." ]
"; return $output; } } if ($_POST['submit']) { if($_GET['warning'] == "new") dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_warnings (warning) VALUES ('".addslashes(stripinput(strip_tags($_POST['warning'])))."')") or die(_FATALERROR."Query: INSERT INTO ".TABLEPREFIX."fanfiction_warnings (warning) VALUES ('".addslashes(strip_tags($_POST['warning']))."')
Error: (". $dbconnect->errno.") ".$dbconnect->error); else dbquery("UPDATE ".TABLEPREFIX."fanfiction_warnings set warning = '".addslashes(stripinput(strip_tags($_POST['warning'])))."' WHERE wid = '".$_GET['warning']."'") or die(_FATALERROR."Query: UPDATE ".TABLEPREFIX."fanfiction_warnings set warning = '".addslashes(strip_tags($_POST['warnings']))."' WHERE wid = '".$_GET['warning']."'
Error: (". $dbconnect->errno.") ". $dbconnect->error); $output .= "
"._ACTIONSUCCESSFUL."
"; } else { if(isset($_GET['warning'])) { if($_GET['warning'] != "new") { $warnquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_warnings WHERE wid = '".$_GET['warning']."' LIMIT 1") or die(_FATALERROR."Query: SELECT * FROM ".TABLEPREFIX."fanfiction_warnings WHERE wid = '".$_GET['warning']."' LIMIT 1
Error: (". $dbconnect->errno.") ". $dbconnect->error); $warning = dbassoc($warnquery); } $output .= "
".($_GET['warning'] == "new" ? _NEWWARNING : _EDITWARNING)."
"._WARNING.": [?]
"; } else { $result = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_warnings"); //List of current warnings $output .= ""; while ($warningresults = dbassoc($result)) { $output .= ""; } $output .= "
"._WARNINGS."
"._ADDWARNING."
".$warningresults['warning']; $output .= ""._EDIT." | "._DELETE."
"; } } return $output; } // end warnings function ?>