<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $msgcenter = new msgcenter($database); $user = new user($database); if (!$user->isLoggedIn()) { $base->redirect('../index.php'); } $user->updateLastActive(); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $id = $_GET['id']; if (!$msgcenter->canCreate($username, $rank) || $user->checkMute($username)) { $content = 'You can\'t create a new conversation. <input type="button" class="button" value="Back" onclick="goBack()" />'; } elseif (!isset($_POST['title']) || !isset($_POST['reply'])) { $content = ' <form action="create.php" method="POST"> <table> <tr><td>Title</td><td align="left"><input type="text" class="button" name="title" maxlength="50"></td></tr>'; if ($rank > 3) { $content .= '<tr><td>Mass Message</td><td align="left"><input type="checkbox" name="mass_message" id="mass"></td></tr><tr><td>Receiver</td><td align="left"><input type="text" class="button" name="receiver" id="receiver" maxlength="12"></td></tr>'; } $content .= ' <tr><td>Message</td><td><textarea name="reply" class="button" cols="45" rows="20" maxlength="2000"></textarea></td></tr> <tr><td></td><td align="left"><input type="submit" class="button" value="Create"></td></tr>
<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $msgcenter = new msgcenter($database); $user = new user($database); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $id = $_GET['id']; if (!$user->isLoggedIn()) { $base->redirect('../index.php'); } if ($rank < 4) { $base->redirect('viewmessage.php?id=' . $id); } $user->updateLastActive(); if (!$msgcenter->canView($id, $username, $rank)) { $content = 'You can\'t edit a non-existent message. <input type="button" class="button" value="Back" onclick="goBack()" />'; } elseif (!isset($_POST['message']) || !isset($_POST['title']) || !isset($_POST['receiver'])) { //get current data $data = $database->processQuery("SELECT `title`,`message`,`receiver` FROM `messages` WHERE `id` = ? LIMIT 1", array($id), true); $content = ' <form action="editmessage.php?id=' . $id . '" method="POST"> <table> <tr><td>Title</td><td align="left"><input type="text" class="button" name="title" maxlength="50" value="' . stripslashes($data[0]['title']) . '"></td></tr> <tr><td>Receiver</td><td align="left"><input type="text" class="button" name="receiver" maxlength="12" value="' . stripslashes($data[0]['receiver']) . '"></td></tr>
<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $msgcenter = new msgcenter($database); $user = new user($database); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $id = $_GET['id']; if (!$user->isLoggedIn()) { $base->redirect('../index.php'); } if ($rank < 4) { $base->redirect('viewmessage.php?id=' . $_GET['convo']); } $user->updateLastActive(); if (!$msgcenter->canView($_GET['convo'], $username, $rank)) { $content = 'You can\'t edit a reply to a non-existent message. <input type="button" class="button" value="Back" onclick="goBack()" />'; } elseif (!isset($_POST['content'])) { //get current data $data = $database->processQuery("SELECT `content` FROM `replies` WHERE `id` = ? LIMIT 1", array($id), true); $content = ' <form action="editreply.php?id=' . $id . '&convo=' . $_GET['convo'] . '" method="POST"> <table> <tr><td>Message</td><td><textarea name="content" cols="45" rows="20" class="button" maxlength="2000">' . htmlentities($base->remBr(stripslashes($data[0]['content']))) . '</textarea></td></tr> <tr><td>Done?</td><td><input type="submit" class="button" value="Update Message"></td></tr>
<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $msgcenter = new msgcenter($database); $user = new user($database); if (!$user->isLoggedIn()) { $base->redirect('../index.php'); } $user->updateLastActive(); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $id = $_GET['id']; if (!$msgcenter->canReply($id, $username, $rank)) { $content = 'You can\'t reply to this conversation. Some possible reasons is that you\'re attempting to post a reply when no response has been made, or the conversation has been marked as solved. <input type="button" class="button" value="Back" onclick="goBack()" />'; } elseif (!isset($_POST['reply'])) { $content = ' <form action="reply.php?id=' . $id . '" method="POST"> <textarea name="reply" cols="45" rows="20" class="button" maxlength="2000"></textarea><br/> <input type="submit" class="button" value="Reply"> </form>'; } elseif (strlen($_POST['reply']) > 2000) { $content = 'Your reply cannot be greater than 2000 characters.'; } else { //retrieve some details $data = $database->processQuery("SELECT `creator` FROM `messages` WHERE `id` = ?", array($id), true);
<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $user = new user($database); $msgcenter = new msgcenter($database); $user->updateLastActive(); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); if ($rank < 4 || !$msgcenter->canView($_GET['id'], $username, $rank)) { $base->redirect('viewmessage.php?id=' . $_GET['id']); } else { $database->processQuery("DELETE FROM `replies` WHERE `conversation` = ?", array($_GET['id']), false); $database->processQuery("DELETE FROM `messages` WHERE `id` = ?", array($_GET['id']), false); $base->redirect('index.php'); }
<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $msgcenter = new msgcenter($database); $user = new user($database); $user->updateLastActive(); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $id = $_GET['id']; if (!$user->isLoggedIn()) { $base->redirect('../index.php'); } if (!$msgcenter->canView($_GET['id'], $username, $rank)) { $base->redirect('index.php'); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:IE> <head> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta name="MSSmartTagsPreventParsing" content="TRUE"> <title><?php echo $data['wb_title'];
<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $msgcenter = new msgcenter($database); $user = new user($database); $user->updateLastActive(); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); if (!$user->isLoggedIn()) { $base->redirect('../index.php'); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:IE> <head> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta name="MSSmartTagsPreventParsing" content="TRUE"> <title><?php echo $data['wb_title']; ?> </title> <link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all"> <link href="../css/msgcenter.css" rel="stylesheet" type="text/css" media="all">
<?php require '../includes/config.php'; require '../structure/database.php'; require '../structure/base.php'; require '../structure/user.php'; require '../structure/msgcenter.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $user = new user($database); $msgcenter = new msgcenter($database); $user->updateLastActive(); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); if ($rank < 4 || !$msgcenter->canView($_GET['id'], $username, $rank)) { $base->redirect('viewmessage.php?id=' . $_GET['id']); } else { $msgcenter->toggleSolve($_GET['id']); $base->redirect('viewmessage.php?id=' . $_GET['id']); }