<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
define("THIS_SCRIPT", 'online_users');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<head>
<title><?php echo $sitename." - ".$lang['online_users']; ?></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript" src="Public/JS/jquery.history.js"></script>
    <link type="text/css" rel="stylesheet" href="Public/Styles/<?php echo $currentstyle ?>/CSS/main.css" />
</head> 
 
<body> 
 
<div class="mainBox"> 
	<?php include("header.php"); ?>
	<?php include("system/homenav.php"); ?>

	<div class="mid" id="midcontent"> 

<div class="column" id="column1">

	<div class="contentBox">
		<div class="boxHeader"><?php echo $lang['online_users']; ?></div>
		<div class="boxContent">
			<?php
			$userq = mysql_query("SELECT * FROM users WHERE online = '1' ORDER BY id ASC");
			while($user = mysql_fetch_array($userq))
			{
				?>
				<div class="StaffBox">
					<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $user['look']; ?>" alt="<?php echo $user['username']; ?>" style="float:left" />
					<div class="Usersname"><a href="home.php?u=<?php echo $user['username']; ?>"><?php echo $user['username']; ?></a></div>
					<div class="Usersmotto"><?php echo $user['motto']; ?></div>
					<img src="./Public/Images/badges/<?php echo $users->RankBadge($user['rank']); ?>.gif" alt="Teen Staff" />
				</div>
            <?php
			}
			?>
		</div>
	</div>
</div>
		
<div class="column" id="column2">
	<?php
	$query = mysql_query("SELECT * FROM cms_news ORDER BY published DESC LIMIT 1");
	$num = mysql_num_rows($query);
	if($num > 0)
	{
		$news = mysql_fetch_array($query);
		echo'<div class="newsHeader">
				<div class="HeadlineStory" id="'.$news["id"].'" style="background: url('.$news["image"].') no-repeat; display:block;">
					<p class="Mainheadline"><a href="articles.php?story='.$news["id"].'">'.stripslashes($news["title"]).'</a></p>
					<p class="Mainstory">'.strip_tags($news["shortstory"], '<br><br/><br />').'</p>
				</div>
		</div>';
		$color = 'odd';
		$query = mysql_query("SELECT * FROM cms_news ORDER BY published DESC LIMIT 5");
		while($news = mysql_fetch_array($query))
		{
			echo'<div class="storybox" id="'.$color.'" ref="'.$news["id"].'">
				<p class="headline"><a href="articles.php?story='.$news["id"].'">'.$news["title"].'</a></p>
				<p class="date">'.@date("d-m-Y", $news['published']).'</p>
			</div>';
			if($color == 'odd')
			$color='even';
			else
			$color='odd';
		}
	}
	?>
		<div class="storyboxEnd">
			<div class="readmore"><a href="articles.php"><?php echo $lang['read_more']; ?></a></div>
		</div>
</div>
		
<?php include("system/sideads.php"); ?>

	</div> 

	<?php include("system/footer.php"); ?>
</div> 

</body> 
</html>