Location: PHPKode > projects > 427BB > fourtwosevenbb/menu.php
<?php
/*************************************************************************
 * 427BB - PHP & MySQL Forum                                             *
 * Copyright (C) 2003-2006 Ben Brown                                     *
 *                                                                       *
 * This program is free software; you can redistribute it and/or modify  *
 * it under the terms of the GNU General Public License as published by  *
 * the Free Software Foundation; version 2 of the License.               *
 *                                                                       *
 * This program is distributed in the hope that it will be useful,       *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 * GNU General Public License for more details.                          *
 *                                                                       *
 * A Copy of the GNU General Public License can be found in the file     *
 * 'liscence.txt' in the root of the forum directory.                    *
 *************************************************************************/

echo "<div class=menutop>Menu</div>
<div class=menu>
<a href=\"./\" class=black>Forum Home</a><br>";


if ($auth != TRUE) {
	echo "<a href=\"register.php\" class=black>Register</a><br>";
} else {
	echo "<a href=\"profile.php?user=$uid\" class=black>My Profile</a><br>
<a href=\"private.php?user=$uid\" class=black>Private Messages</a><br>
<a href=\"addresses.php\" class=black>Address Book</a><br>
<a href=\"ignorelist.php\" class=black>Ignore List</a><br>";
}

echo "<a href=\"search.php\" class=black>Search</a><br>
<a href=\"online.php\" class=black>Who's Online</a><br>
<a href=\"./?markall\" class=black>Mark all Read</a><br>";

if ($auth == TRUE) {
	echo "<a href=\"./?logout=y\" class=black>Log out</a><br>";
}

echo "</div>";

if ($usertype == "admin") {
	echo "<div class=menutop>Admin</div>
<div class=menu>
<a href=\"admin.php?page=users\" class=black>User Admin</a><br>
<a href=\"admin.php?page=group\" class=black>Group Admin</a><br>
<a href=\"admin.php?page=forum\" class=black>Forum Admin</a><br>
<a href=\"admin.php?blockip\" class=black>Blocked IPs</a><br>
<a href=\"admin.php?page=forum_info\" class=black>Forum Info</a><br>
<a href=\"admin.php?page=message\" class=black>Change Message</a><br>
<a href=\"admin.php?page=smilies\" class=black>Smiley Admin</a><br>
<a href=\"admin.php?page=avatars\" class=black>Update Avatars</a><br>
</div>";
}

if ($auth == TRUE) {
	echo "<div class=menutop>$username</div>
<div class=menu>";

	$uname = addslashes($username);

	$sql = "SELECT Avatar, Posts, Status FROM " . $t_prefix . "Personal WHERE UserName='$uname'";
	$res = mysql_query($sql);
	$row = mysql_fetch_row($res);

	$avatar = $row[0];
	$postcount = $row[1];
	if ($postcount == 0 || $postcount  == NULL) {
		$postcount = "No";
	}
	$status = stripslashes($row[2]);

	echo "<span class=small>$status
<br>$avatar<br>
$postcount Post";

	if ($postcount != 1) {
		echo "s";
	}

	$sql = "SELECT COUNT(*) FROM " . $t_prefix . "PriMess WHERE ToUser='$uid' && UNIX_TIMESTAMP(ReadAt)=0";
	$res = mysql_query($sql);
	$count = mysql_result($res, 0);

	if ($count > 0) {
		echo "<br>You have $count unread <a href=\"private.php?user=$uid\">private message";
		if ($count != 1) {
			echo "s";
		}
		echo "</a>.";
	}

	echo "</span>
</div>";

} else {

	echo "<div class=menutop>Log In</div>
<div class=menu>
	<form action=\"login.php\" method=post>
	User Name:<br>
	<input type=text name=user style=\"width:100%\"><br>
	Password:<br>
	<input type=password name=pass style=\"width:100%\"><br>
	Remember Details: <input type=checkbox name=remember><br>
	<input type=submit name=login value=\"Log In\">
	</form>
	</div>";
}

?>
Return current item: 427BB