Network Statistics [code]

this is the code for network statistics:
Code//## display network statistics.
$res = sql_query("SELECT count(*) as num from `".tb()."accounts`");
$row = sql_fetch_array($res);
$stats['members'] = $row['num'];
$res = sql_query("SELECT count(*) as num from `".tb()."friends`");
$row = sql_fetch_array($res);
$stats['friendships'] = $row['num']/2;
$res = sql_query("SELECT count(*) as num from `".tb()."comments`");
$row = sql_fetch_array($res);
$stats['comments'] = $row['num'];
$res = sql_query("SELECT count(*) as num from `".tb()."streams`");
$row = sql_fetch_array($res);
$stats['activities'] = $row['num'];
$theme_default_cache_left .= '
<div>
<strong>'.t('Network Statistics').':</strong><br />
<strong>'.$stats['activities'].'</strong> '.t('Activities').'<br />
<strong>'.$stats['members'].'</strong> '.t('Members').'<br />
<strong>'.$stats['friendships'].'</strong> '.t('Friendships').'<br />
<strong>'.$stats['comments'].'</strong> '.t('Comments').'
</div>';

add this to the section of 'page.tpl.php' that displays if the user is not logged in
INFORMAQTION SUPPLIED BY SHIFTY
http://shiftysplayground.co.cc

0 komentar:

Posting Komentar

 

© 3 Columns Newspaper Copyright by risky rionaldy | Template by Blogger Templates | Blog Trick at Blog-HowToTricks