- Joined
- Aug 7, 2010
- Messages
- 16
- Reaction score
- 8
Hi, im sorry for my bad englisch i'm from Germany.
I've coded for you a community page, with some hotel stats and a random user avatar code.
screen:
Please thanks if you like it.
I've coded for you a community page, with some hotel stats and a random user avatar code.
screen:
PHP:
<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
include('random-community.php');
define("THIS_SCRIPT", 'community');
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $sitename." - ".$lang['community']; ?></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/communitynav.php"); ?>
<div class="mid" id="midcontent">
<div class="column" id="column1">
<div class="contentBox">
<div class="boxHeader"><?php echo $lang['community_welcome']; ?></div>
<?php
$random = mysql_query("SELECT * FROM users ORDER BY RAND() DESC LIMIT 7");
while($randomusers = mysql_fetch_array($random)){
echo '<img src="http://www.habbo.com.es/habbo-imaging/avatarimage?figure=' . $randomusers['look'] . '"title="'.$randomusers['username'].'" >';
}
?>
</div></div></div></div>
<div class="contentBox">
<div class="boxHeader"><?php echo $lang['server_stats']; ?></div>
<div class="boxContent" align="left">
<b><?php
/* HERE BEGINS THE SERVER VERSION STAT */
$sql = "SELECT server_ver
FROM server_status";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["server_ver"];
}
mysql_free_result($result);
/*HERE ENDS THE SERVER VERSION STAT */
?></b>
<br /><br />
<?php
/* HERE BEGINS THE USER STAT */
echo mysql_num_rows(mysql_query("SELECT * FROM users"));
/* HERE ENDS THE USER STAT */
?> <b>users a registered in the hotel.</b>
<br />
<?php
/* HERE BEGIN THE USER ONLINE STAT */
$sql = "SELECT users_online
FROM server_status";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["users_online"];
}
mysql_free_result($result);
/* HERE ENDS THE USER ONLINE STAT */
?> <b>users are now online.</b>
<br />
<?php
/* HERE BEGIN THE USER PEAK STAT */
$sql = "SELECT userpeak
FROM server_status";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["userpeak"];
}
mysql_free_result($result);
/* HERE ENDS THE USER PEAK STAT */
?> <b>users online is the record.</b>
<br /><br />
<?php
/* HERE BEGINS THE ROOMS STAT */
echo mysql_num_rows(mysql_query("SELECT * FROM rooms"));
/* HERE ENDS THE ROOMS STAT */
?> <b>rooms are in the hotel.</b>
<br />
<?php
/* HERE BEGIN THE ROOMS LOADED STAT */
$sql = "SELECT rooms_loaded
FROM server_status";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["rooms_loaded"];
}
mysql_free_result($result);
/* HERE ENDS THE ROOMS LOADED STAT */
?> <b>rooms are now activ.</b>
<br /><br />
<b>At the moment you get all </b><?php
/* HERE BEGINS THE TIMER STAT */
$sql = "SELECT timer
FROM server_settings";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["timer"];
}
mysql_free_result($result);
/*HERE ENDS THE TIMER STAT */
?> <b>seconds</b>
<?php
/* HERE BEGINS THE CREDITS STAT */
$sql = "SELECT credits
FROM server_settings";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["credits"];
}
mysql_free_result($result);
/*HERE ENDS THE CREDITS STAT */
?> <b>credits</b>
<b>and </b><?php
/* HERE BEGINS THE PIXELS STAT */
$sql = "SELECT pixels
FROM server_settings";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["pixels"];
}
mysql_free_result($result);
/*HERE ENDS THE PIXELS STAT */
?> <b>pixel.</b>
</div></div></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>
Please thanks if you like it.
Last edited:

