Location: PHPKode > scripts > WH Social > wh_social/admin/handler/statistic.php
<?php

    function stat_visits() {
        $inquiry = "SELECT id, SUM(visits) AS allVI FROM members";
        $result = mysql_query($inquiry) or die(mysql_error());
        $row = mysql_fetch_assoc($result);
        echo '<strong>' . (int)$row['allVI'] . '</strong>';
        }

    function stat_browsers() {
        $inquiry = "SELECT id, browser FROM counter LIMIT 6";
        $result = mysql_query($inquiry) or die(mysql_error());

        while($row = mysql_fetch_assoc($result)) {

            $text = ((strlen($row['browser']) < 6) ? $row['browser'] : substr($row['browser'], 0, 50).'...');

            echo '<p>' . htmlentities($text, ENT_QUOTES) . '</p>';
            }
        }

    function stat_ips() {
        $inquiry = "SELECT id, ip FROM counter LIMIT 6";
        $result = mysql_query($inquiry) or die(mysql_error());

        while($row = mysql_fetch_assoc($result)) {

            echo '<p>' . htmlentities($row['ip'], ENT_QUOTES) . '</p>';
            }
        }

    function stat_lvis() {
        $inquiry = "SELECT id, time FROM counter LIMIT 6";
        $result = mysql_query($inquiry) or die(mysql_error());

        while($row = mysql_fetch_assoc($result)) {

            echo '<p>' . date('d.m.Y - H:i', ($row['time'])) . '</p>';
            }
        }

?>
Return current item: WH Social