} elseif (time() - $last_post[0]['lastpost'] < $flood_limit[0]['floodlimit'] && $rank < 3) { $content = '<div class="frame e">You\'re attempting to post too soon.</div>'; } else { //auto-hiding? $data = $database->processQuery("SELECT `autohiding` FROM `threads` WHERE `id` = ?", array($thread), true); $status = $data[0]['autohiding'] == 1 ? 1 : 0; //insert post $database->processQuery("INSERT INTO `posts` VALUES (null, ?, ?, ?, NOW(), ?, '', ?, ?)", array($username, nl2br($_POST['message']), $thread, $status, $_SERVER['REMOTE_ADDR'], time()), false); $creation_id = $database->getInsertId(); //update thread $database->processQuery("UPDATE `threads` SET `lastposter` = ?, `lastpost` = NOW() WHERE `id` = ?", array($username, $thread), false); //update their last post and lastip fieldss $database->processQuery("UPDATE `users` SET `lastpost` = ?, `lastip` = ? WHERE `username` = ? LIMIT 1", array(time(), $_SERVER['REMOTE_ADDR'], $username), false); //if the lock option was set, lock the thread! if ($_POST['lock'] == 1) { $thread_obj->lock($thread, $rank); } $base->appendToFile('logs.txt', array($username . ' locked the thread ' . $thread)); //send them to the thread they posted on $base->redirect('viewthread.php?forum=' . $f . '&id=' . $thread . '&goto=' . $creation_id); } } else { $chars = $rank > 2 ? $chars = 100000 : ($chars = 2000); if (isset($_GET['quote']) && isset($_GET['qt']) && $rank > 3) { $quote = $_GET['qt'] == 1 ? $database->processQuery("SELECT `content`,`username` FROM `posts` WHERE `id` = ?", array($_GET['quote']), true) : $database->processQuery("SELECT `content`,`username` FROM `threads` WHERE `id` = ?", array($_GET['quote']), true); $text = $base->remBr('[quote=' . $quote[0]['username'] . ']' . $quote[0]['content'] . '[/quote]'); } $content = ' <div id="nocontrols" class="phold"></div> <div id="command"> <form method="post" action="reply.php">
require '../../structure/forum.php'; require '../../structure/forum.thread.php'; require '../../structure/base.php'; require '../../structure/user.php'; $database = new database($db_host, $db_name, $db_user, $db_password); $thread = new thread($database); $base = new base($database); $user = new user($database); $user->updateLastActive(); //useful variables $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $id = $_GET['id']; //take action then log it if ($thread->checkExistence($id) && $thread->canView($id, $username, $rank) && $rank > 2) { $thread->lock($id, $rank); $base->appendToFile('../logs.txt', array($username . ' locked the thread ' . $id)); } else { $base->redirect('../viewthread.php?forum=' . $_GET['forum'] . '&id=' . $id . '&goto=start'); } $redirect = 'http://' . $path . 'forums/viewthread.php?forum=' . $_GET['forum'] . '&id=' . $id . '&goto=start'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:IE> <!-- LeeStrong Runescape Website Source --!> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"><!-- /Added by HTTrack --> <head> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta name="MSSmartTagsPreventParsing" content="TRUE">
} else { foreach ($threads as $thread) { moveThread($thread, $_GET['moveto'], $database); $base->appendToFile('logs.txt', array($username . ' moved the thread ' . $thread . ' to ' . $_GET['moveto'])); } $base->redirect('viewforum.php?forum=' . $_GET['moveto']); } } else { foreach ($threads as $thread) { switch ($action) { case 1: $forum_thread->hideThread($thread, $rank); $base->appendToFile('logs.txt', array($username . ' hid/un-hid the thread ' . $thread)); break; case 2: $forum_thread->lock($thread, $rank); $base->appendToFile('logs.txt', array($username . ' locked the thread ' . $thread)); break; case 4: setAutoHide($thread, $database, $rank); $base->appendToFile('logs.txt', array($username . ' toggled auto-hide hide on the thread ' . $thread)); break; case 5: setSticky($thread, $database, $rank); $base->appendToFile('logs.txt', array($username . ' stickied the thread ' . $thread)); break; case 6: delete($thread, $database, $rank); $base->appendToFile('logs.txt', array($username . ' deleted the thread ' . $thread)); break; }