Location: PHPKode > scripts > WH Board > wh_board/functions/statistic.php
<?php

    function stat_posts() {
        $inquiry = mysql_query("SELECT post_id FROM posts");
        $total = intval(mysql_num_rows($inquiry));
        echo '<strong>' . (int)$total . '</strong>';
        }

    function stat_topics() {
        $inquiry = mysql_query("SELECT topic_id FROM topics");
        $total = intval(mysql_num_rows($inquiry));
        echo '<strong>' . (int)$total . '</strong>';
        }

    function stat_categories() {
        $inquiry = mysql_query("SELECT cat_id FROM categories");
        $total = intval(mysql_num_rows($inquiry));
        echo '<strong>' . (int)$total . '</strong>';
        }

    function stat_user() {
        $inquiry = mysql_query("SELECT user_id FROM users");
        $total = intval(mysql_num_rows($inquiry));
        echo '<strong>' . (int)$total . '</strong>';
        }

    function stat_blog() {
        $inquiry = mysql_query("SELECT blog_id FROM articles");
        $total = intval(mysql_num_rows($inquiry));
        echo '<strong>' . (int)$total . '</strong>';
        }

    function stat_com() {
        $inquiry = mysql_query("SELECT com_id FROM comments");
        $total = intval(mysql_num_rows($inquiry));
        echo '<strong>' . (int)$total . '</strong>';
        }

    function stat_today() {
        $sql_today = "SELECT * FROM counter";
        $erg_today = mysql_query($sql_today);
        $today = intval(mysql_num_rows($erg_today));
        echo '<strong>' . (int)$today . '</strong>';
        }

    function stat_total() {
        $sql_entire = "SELECT * FROM counter ORDER BY count_id DESC";
        $erg_entire = mysql_query($sql_entire) OR die(mysql_error());
        $row = mysql_fetch_array($erg_entire);
        $entire = $row['count_id'];
        echo '<strong>' . (int)$entire . '</strong>';
        }

    function stat_online() {
        $timeon = "900";
        $time = time();
        $timeon = $time-$timeon;
        $sql_online = "SELECT * FROM counter WHERE count_timed > '" . $timeon . "'";
        $erg_online = mysql_query($sql_online) OR die(mysql_error());
        $online = intval(mysql_num_rows($erg_online));
        echo '<strong>' . (int)$online . '</strong>';
        }

?>
Return current item: WH Board