*

Recent

Author Topic: not showing statistics?  (Read 4448 times)

Trasion

  • Guest
not showing statistics?
« on: September 04, 2009, 01:22:19 PM »
Check the attachment.

I took the statistics box out of the templates/default/footer.php page and added it in the templates/default/header.php page, but now it doesn't show the information.

Here's my templates/default/header.php code...

Code: [Select]
<html>
<head>
<meta name="keywords" content="flash games,free flash games,games,arcade games¸sonic,nintendo,online" />
<meta name="description" content="Take a break play some free games,facebook games" />
<link href="<?=$domain?>/templates/default/styles.css" rel="stylesheet" type="text/css">
<?php
include ("js/rating_update.php");

?>

</head>
<body>
<table width="900" border="0" align="center" class="maintable" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3">
<img src="<?=$domain?>/templates/default/images/banner.png" width="900"></img>

<?php


echo ' <div class=\'menutop\'>';
if($seo_on == 1){
echo ' <ul>
<li><a href=\''
.$domain.'\' title=\'Home\'>Home</a></li>
<li><a href=\''
.$domain.'/mostplayed/\' title=\'Most Played\'>Most Played</a></li>
<li><a href=\''
.$domain.'/newest/\' title=\'Newest\'>Newest</a></li><li><a href="'.$domain.'/memberslist/" title="Member List">Member List</a></li>
<li><a href=\''
.$domain.'/search/\' title=\'Search\'>Search</a></li>
<li><a href=\''
.$domain.'/links/\' title=\'Links\'>Links</a></li>
<li><a href=\''
.$domain.'/fineprint/\' title=\'Fine Print\'>Fine Print</a></li>

'
;
if(!isset($suserid)){
$mymenu1 ' <li ><a href=\''.$domain.'/login/\'>Login</a></li>
<li ><a href=\''
.$domain.'/signup/\'>Signup</a></li>';
}else{
$mymenu1 '
<li ><a href=\''
.$domain.'/myaccount/\'>My Account</a></li>
<li ><a href=\''
.$domain.'/logout/\'>Logout</a></li>';
}
            if (
$showblog == 1) { echo '<li><a href=\''.$domain.'/blog/\' title=\'blog\'>Blog</a></li>'; };

echo '
                  
</ul>'
;
}else{
echo ' <ul>
<li><a href=\''
.$domain.'\' title=\'Homepage\'>Homepage</a></li>
<li><a href=\''
.$domain.'/community/index.php\' title=\'Community\'>Community</a></li>
<li style="float:right;"><a href=\''
.$domain.'/index.php?action=mostplayed\' title=\'Popular Games\'>Popular Games</a></li>
<li style="float:right;"><a href=\''
.$domain.'/index.php?action=newest\' title=\'Newest Games\'>Newest Games</a></li>
<li style="float:right;"><a href=\''
.$domain.'/index.php?action=allgames\' title=\'All Games\'>All Games</a></li>
'
;


echo '
                  
</ul>'
;
}







echo ' </div>';

?>

<br />
<br />
<br />
</td>
</tr>
<tr>
<td valign="top" width="170" >
<table width="100%" >


<tr>
<td class="header2">My Menu</td>
</tr>

<tr>
<td class="content2">
<?php
                              
echo '<ul class=\'catmenu\'>';
                                     echo 
$mymenu1;
                         if($usrdata['user_level'] == 2){echo '<li><a href=\''.$domain.'/index.php?action=admin\'>Admin</a></li>';
   
                                       };
                                     if(
$usrdata['bloglevel'] >= 2) {echo '<li><a href=\''.$domain.'/index.php?action=blogadmin\'>Blog Admin</a></li>';};
                                     echo 
'<p>';


                                     
submenu1();

echo '</ul>';
?>

</td>
</tr>
</table>



<table width="100%">
<tr>
<td class="header2">Top Members</td>
</tr>

<tr>
<td class="content2">

<?php
echo '<ul class=\'catmenu\'>';

$tur $db->query('SELECT username, userid, plays FROM dd_users ORDER BY plays DESC LIMIT 0,10');
while($r $db->fetch_row($tur)){
echo '
<li><b>'
.$r['username'].'</b> ('.$r['plays'].' Plays)</li>';
}
echo '

</ul>'
;
?>

<p>

</td>

</tr>



</tr>
</table>

<table width="100%">
<tr>
<td class="header2">Stats</td>
</tr>
<tr>
<td class="content2" style="padding:5px">
Total Games: <?php echo $totalgames?><br />
Total Users: <?php echo $totalusers?><br />
Total Categories: <?php echo $totalcats?><br />
Total Comments: <? echo $totalcomments; ?>
                              <div style="float:right;"><a href="<?php echo $domain?>/rss-arcade.php"><img src="<? echo $domain; ?>/templates/default/images/rss.gif"  border="0" ></img></a></div>
                           


</tr>
</table>
</td>
<td valign="top" width="660">

Why won't it display the information?

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: not showing statistics?
« Reply #1 on: September 04, 2009, 02:17:39 PM »
The variables need to be defined before echoing them.
add:
Code: [Select]
<?php
$totalgames $db->num_rows($db->query(sprintf('SELECT ID FROM dd_games')));
$totalusers $db->num_rows($db->query(sprintf('SELECT userid FROM dd_users')));
$totalcats $db->num_rows($db->query(sprintf('SELECT ID FROM dd_categories')));
$totalcomments $db->num_rows($db->query(sprintf('SELECT ID FROM dd_comments')));
$year date('Y');
?>

anywhere before:
Code: [Select]
<table width="100%">
<tr>
<td class="header2">Stats</td>
</tr>
<tr>
<td class="content2" style="padding:5px">
Total Games: <?php echo $totalgames?><br />
Total Users: <?php echo $totalusers?><br />
Total Categories: <?php echo $totalcats?><br />
Total Comments: <? echo $totalcomments; ?>
                              <div style="float:right;"><a href="<?php echo $domain?>/rss-arcade.php"><img src="<? echo $domain; ?>/templates/default/images/rss.gif"  border="0" ></img></a></div>
                           


</tr>
</table>