if (!$message) { $message = ""; } if ($no == 0) { $sql = "UPDATE kingdoms SET message = '{$message}' WHERE id = '{$acc['kingdom']}'"; $result = $db->query($sql); echo 'Message successfully edited!<br>'; unset($action); } } if ($action == "editmessage") { $sql = "SELECT message FROM kingdoms WHERE id = '{$acc['kingdom']}'"; $result = $db->query($sql); $text = $db->result($result, 0); fTitle("index.php?page=kingdom&action=submiteditmessage"); fTextArea("Message:", "message", $text); fEnd("Edit"); } if ($action == "leavekingdom") { echo '<a href="index.php?page=kingdom&action=leavekingdom2">Are you sure?</a><br>'; } if (!$action) { tBegin("General Information"); $sql = "SELECT k.* FROM kingdoms AS k WHERE k.id = '{$acc['kingdom']}'"; $result = $db->query($sql); $kd = $db->fetch_array($result); if ($kd["type"] == 1) { echo ' You are living in ', $kd["name"], ', the central meeting point of Rodia.<br> Its coordinates are (', $kd["x"], ',', $kd["y"], ').<br> Every new mage in Castle Quest 2 starts here.<br>
fEnd("Change"); } if ($action == "submitchangeinfo") { if (strlen($info) > gdMaxInfoLength && !in_array($acc["id"], $gdProtectedMages)) { echo 'That text is too long.<br>'; } else { $sql = "UPDATE accounts SET info = '{$info}' WHERE id = '{$acc['id']}'"; $result = $db->query($sql); echo 'Personal info successfully changed!<br>'; $acc["info"] = stripslashes($info); unset($action); } } if ($action == "changeprivate") { fTitle("index.php?page=character&action=submitchangeprivate"); fTextArea("Private notes:", "private", $acc["private"]); fEnd("Change"); } if ($action == "submitchangeprivate") { if (strlen($info) > gdMaxPrivateLength) { echo 'That text is too long.<br>'; } else { $sql = "UPDATE accounts SET private = '{$private}' WHERE id = '{$acc['id']}'"; $result = $db->query($sql); echo 'Private notes successfully changed!<br>'; $acc["private"] = stripslashes($private); unset($action); } } if ($action == "raiseskill") { $availablepoints = gGetSkillPointsLeft();
<?php topic("Report Abuse"); if (!$action) { fTitle("index.php?page=reportabuse&action=submitabuse"); fText("Account name of abuser:"******"name"); fTextArea("Abuse Description:", "description"); fEnd("Submit"); echo ' You can report anything abusive you encounter here.<br> Typical abuse can be the use of offensive language or a player with more than one account.<br> '; } if ($action == "submitabuse") { $no = 0; if (!$description) { echo 'You have to enter a description and an account name.<br>'; $no = 1; } $sql = "SELECT id, name FROM accounts WHERE name = '{$name}'"; $result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows != 1) { echo 'You have to enter a valid account name.<br>'; $no = 1; } else { $row = $db->fetch_array($result); $name = "{$row['name']} (" . $cq2url . "index.php?page=playerinfo&action=viewinfo&aid={$row['id']}"; } if ($no == 0) { $date = date("Y-m-d @ H:i");
$sql = "SELECT r.*, a.name, a.id AS aid FROM reports AS r, accounts AS a WHERE r.id = '{$rid}' AND r.reporter = a.id"; $result = $db->query($sql); while ($row = $db->fetch_array($result)) { tBegin(ucfirst($row["type"]) . ' by <a href="index.php?page=playerinfo&action=viewinfo&aid=' . $row["aid"] . '">' . $row["name"] . '</a> on ' . $row["date"]); echo gTags(stripslashes($row["text"])); echo '<br><br><a href="index.php?page=admin&action=editreport&rid=', $row["id"], '">Edit report.</a>'; tEnd(); } } if ($action == "editreport") { $sql = "SELECT r.*, a.name FROM reports AS r, accounts AS a WHERE r.id = '{$rid}' AND r.reporter = a.id"; $result = $db->query($sql); while ($row = $db->fetch_array($result)) { tBegin(ucfirst($row["type"]) . ' by ' . $row["name"] . ' on ' . $row["date"]); fTitle("index.php?page=admin&action=submiteditreport&rid={$rid}"); fTextArea("Description:", "text", stripslashes($row["text"])); fEnd("Edit"); tEnd(); } } if ($action == "submiteditreport") { $sql = "SELECT r.*, a.name FROM reports AS r, accounts AS a WHERE r.id = '{$rid}' AND r.reporter = a.id"; $result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows != 1) { echo 'Invalid report id.<br>'; } else { $sql = "UPDATE reports SET text = '" . addslashes($text) . "' WHERE id = '{$rid}'"; $result = $db->query($sql); echo 'Report modified!<br><br>'; $action = "reports";
<?php topic("Report Bug"); if (!$action) { fTitle("index.php?page=reportbug&action=submitbug"); fTextArea("Bug/Advice Description:", "description"); fEnd("Submit"); echo 'Please describe the bug as accurately as possible.<br>'; } if ($action == "submitbug") { $no = 0; if (!$description) { echo 'You have to enter a description.<br>'; $no = 1; } if ($no == 0) { $date = date("Y-m-d @ H:i"); mail($PhantomMail, "bug report - {$date}", "\r\n{$acc['name']} reported the following bug:\r\n\r\n" . stripslashes($description) . "\r\n\r\n" . $cq2url . "index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\r\n{$acc['email']}\r\n", $mailheaders); echo ' Bug report/advice successfully submitted!<br> Thanks for helping us make CQ2 a better game.<br> '; } }
} if ($type == "bug") { echo ' Please describe the bug as accurately as possible.<br> If you want to give advice, try to be as thoroughly as possible in your description.<br><br> '; fTitle("index.php?page=report&type=bug&action=submit"); fTextArea("Bug/Advice Description:", "description"); fEnd("Submit"); } if ($type == "question") { echo ' You can use this form to ask a general question about the game that is not related to bugs or rule abuse.<br><br> '; fTitle("index.php?page=report&type=question&action=submit"); fTextArea("Question:", "description"); fEnd("Submit"); } } if ($action == "submit") { $no = 0; if (!$description) { echo 'You have to enter a description.<br>'; $no = 1; } // admins can change the reporter if ($acc["admin"] && $reporter) { // check for valid reporter id $sql = "SELECT id FROM accounts WHERE id = '{$reporter}'"; $result = $db->query($sql); $numrows = $db->num_rows($result);
echo 'Announcement successfully deleted!<br>'; } } if ($action == "editannouncement") { $no = 0; if (!$anid) { echo 'Invalid data.<br>'; $no = 1; } if ($no == 0) { $sql = "SELECT topic, text FROM announcements WHERE id = '{$anid}'"; $result = $db->query($sql); $ann = $db->fetch_array($result); fTitle("index.php?page=home&action=submiteditannouncement&anid={$anid}"); fText("Topic:", "topic", $ann["topic"]); fTextArea("Text:", "text", $ann["text"]); fEnd("Edit"); } } if ($action == "submiteditannouncement") { $no = 0; if (!$anid || !$topic || !$text) { echo 'Invalid data.<br>'; $no = 1; } if ($no == 0) { $sql = "UPDATE announcements SET topic = '{$topic}', text = '{$text}' WHERE id = '{$anid}'"; $result = $db->query($sql); echo 'Announcement successfully changed.<br>'; } }