 |
| Author |
Message |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2973 Location: Germany |
|
How to display some statistics on your homepage |
|
Put this function below the include of head.php in the page which shows your news.
 |  | function stats() {
global $sql;
$stat = array('Users' => 'users', 'News' => 'news', 'Comments' => 'comments', 'Categories' => 'categories');
foreach ($stat as $name => $table) {
echo $name.": ".count($sql->select(array('table' => $table)))."<br>";
}
} |
Then you can show the stats by calling the function: stats();
It will show you something like this:
Users: 1
News: 8
Comments: 4
Categories: 2
|
|
| Thu Nov 24, 2005 8:52 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
 |
 |
 |
|