PhoenixPHP Community Page

Status
Not open for further replies.
Newbie Spellweaver
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:
Rhinodanny - PhoenixPHP Community Page - RaGEZONE Forums



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:
Thanks for the Random Users - I'll check the code over and re-release it without the Hotel stats; obviously all the credit goes to you.
 
#Hotel stats updatated.
Sorry on the image you can only see the german texts but in the code theres english.

@brendan90 here is a sitebar addon with most credits.

PHP:
<div class="contentBox" align="center">
	<div class="habblet-container "><div class="boxHeader">The 10 richest User <?php echo $sitename ?>s</div>
<div class="box-content">
<table>
<?php
$datosTop = mysql_query("SELECT * FROM users WHERE rank <3 AND 1 ORDER BY credits DESC LIMIT 7 AND rank < 5");

while($datosTop10 = mysql_fetch_array($datosTop)){
echo '
<tr><td width="5px"></td>
<td width="20px">';

echo '<img src="http://www.habbo.com.es/habbo-imaging/avatarimage?figure=' . $datosTop10['look'] . '&direction=3&head_direction=3&gesture=sml&action=crr=2&size=s" align="left"></td> <td width="195px"><a href="%www%/home/'.$datosTop10['username'].'">'.$datosTop10['username'].'</a><br />'.$datosTop10['credits'].' Credits';

echo '</td>
           
          ';
}
?>
</table>

</div>

</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
 
Last edited:
Just random user's thingy is nice :)
 
PHP:
<?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'].'">';  
} 
?>

Here's the updated version of your Random Users. ^ ^
 
Yea that's all I want from it, i'll test it.
 
PHP:
<?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'].'">';  
} 
?>

Here's the updated version of your Random Users. ^ ^

Here is a updated update of your update version:

Code:
<?php  
$random = mysql_query("SELECT `username`,`look` FROM `users` ORDER BY RAND() DESC LIMIT 7");  

while($randomusers = mysql_fetch_array($random, MYSQL_ASSOC)){  

echo '<img src="http://www.habbo.com.es/habbo-imaging/avatarimage?figure=' . $randomusers['look'] . '" alt="'.$randomusers['username'].'" />';   
}  
?>
 
I have a problem to this :/
look for the print


*sorry for my bad english Im portuguese
 
lmao Mithex, what you on about run install.

The install file is for the errors on the homepage to do with the navigation bar.

For this error you need to remove the include random-community at the top of the page which i have fixed and already done for this guy.
 
#Hotel stats updatated.
Sorry on the image you can only see the german texts but in the code theres english.

@brendan90 here is a sitebar addon with most credits.

PHP:
<div class="contentBox" align="center">
	<div class="habblet-container "><div class="boxHeader">The 10 richest <?php echo $sitename ?>s</div>
<div class="box-content">
<table>
<?php
$datosTop = mysql_query("SELECT * FROM users WHERE 1 ORDER BY credits DESC LIMIT 7");

while($datosTop10 = mysql_fetch_array($datosTop)){
echo '
<tr><td width="5px"></td>
<td width="20px">';

echo '<img src="http://www.habbo.com.es/habbo-imaging/avatarimage?figure=' . $datosTop10['look'] . '&direction=3&head_direction=3&gesture=sml&action=crr=2&size=s" align="left"></td> <td width="195px"><a href="%www%/home/'.$datosTop10['username'].'">'.$datosTop10['username'].'</a><br />'.$datosTop10['credits'].' Crediti';

echo '</td>
           
          ';
}
?>
</table>

</div>

</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

Ty Dude i test it now any way 9/10
 
Status
Not open for further replies.
Back