예제 #1
0
									<li><a href="viewforum.php?forum=<?php 
echo $f . '&page=' . $next;
?>
">next &gt;</a></li>
									<li><a href="viewforum.php?forum=<?php 
echo $f . '&page=' . $pages;
?>
">last &gt;&gt;</a></li>
								</ul>
							</form>
						</td>
						<td class="commands">
							<ul class="flat">
								<li><a href=""><img src="../img/forum/refresh.gif" alt=""> Refresh</a></li>
								<?php 
if ($user->isLoggedIn() && $forum->canCreate($f, $rank) && !$user->checkMute($username)) {
    echo '<li><a href="create.php?forum=' . $f . '"><img src="../img/forum/new_thread.gif" alt=""> Create a New Thread</a></li>';
}
?>
															</ul>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
			<div id="content" class="border">
				<table id="t_holder">
					<tr height="20px">
						<td width="63%"></td>
						<td width="15%" class="title num">Posts</td>
						<td width="22%" class="title">Last Post</td>
예제 #2
0
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$forum = new forum($database);
$user->updateLastActive();
//make sure the user is logged in and required data is set
if (!ctype_digit($_REQUEST['forum']) || !$user->isLoggedIn()) {
    $base->redirect('index.php');
}
//set some variables that are used a lot throughout the page
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$f = $_REQUEST['forum'];
//make sure they are posting in a forum where they have permission
if ($user->checkMute($username) || !$forum->canView($f, $rank) || !$forum->canCreate($f, $rank)) {
    $base->redirect('index.php');
}
//floodlimit time
$flood_limit = $database->processQuery("SELECT `floodlimit` FROM `config` LIMIT 1", array(), true);
//get the user's last post (time)
$last_post = $database->processQuery("SELECT `lastpost` FROM `users` WHERE `username` = ? LIMIT 1", array($username), true);
if (isset($_POST['cancel'])) {
    $base->redirect('viewforum.php?forum=' . $f);
}
if (isset($_POST['message']) && isset($_POST['title'])) {
    $message = nl2br($_POST['message']);
    $title = $_POST['title'];
    //make sure the title and message meet the standards
    if (strlen($message) > 2000 && $rank < 3) {
        $content = '<div class="frame e">Your post can\'t be larger than 2000 characters.</div>';