Location: PHPKode > scripts > WH Board > wh_board/admin/management/admin_functions/overview.php
<?php

    $inquiry = mysql_query("SELECT topic_id FROM topics");
    $total = intval(mysql_num_rows($inquiry));
    echo (int)$total . ' ' . $lang['blank_topics'] . '';

    echo '&nbsp;&nbsp;&nbsp;&nbsp;';

    $inquiry = mysql_query("SELECT post_id FROM posts");
    $total = intval(mysql_num_rows($inquiry));
    echo (int)$total . ' ' . $lang['posts'] . '';

    echo '&nbsp;&nbsp;&nbsp;&nbsp;';

    $inquiry = mysql_query("SELECT blog_id FROM articles");
    $total = intval(mysql_num_rows($inquiry));
    echo (int)$total . ' ' . $lang['blank_article'] . '';

    echo '&nbsp;&nbsp;&nbsp;&nbsp;';

    $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 (int)$online . ' Online';

    if(!isset($_SESSION['signed_in'])) {

    $sql = "DELETE FROM
    		  online
    	    WHERE
    		  DATE_SUB(NOW(), INTERVAL 5 MINUTE) > online_timed";

    mysql_query($sql) OR die(mysql_error());

    $sql = "SELECT
    		  COUNT(*) as allon
    	    FROM
    		  online";

    $result = mysql_query($sql) OR die(mysql_error());
    $row = mysql_fetch_assoc($result);

    echo ' ' . $lang['thereof'] . ' ' . (int)$row['allon'] . ' ' . $lang['registered'] . '';

        }else{

        $sql = "SELECT
        		  COUNT(*) as allon
        	    FROM
        		  online
        	    WHERE
        		  online_ip = '" . $_SERVER['REMOTE_ADDR'] . "'";

        $result = mysql_query($sql) OR die(mysql_error());
        $row = mysql_fetch_assoc($result);

    if($row['allon']) {

    $sql = "UPDATE
    		online
    	SET
    		online_timed = NOW()
    	WHERE
    		online_ip = '" . $_SERVER['REMOTE_ADDR'] . "'";

    mysql_query($sql) OR die(mysql_error());

        }else{

        $sql = "INSERT INTO online
        			(online_ip, online_timed)
        		VALUES
        			('" . $_SERVER['REMOTE_ADDR'] . "', NOW())";

        mysql_query($sql) OR die(mysql_error());
        }

    $sql = "DELETE FROM
    		  online
    	    WHERE
    		  DATE_SUB(NOW(), INTERVAL 5 MINUTE) > online_timed";

    mysql_query($sql) OR die(mysql_error());

    $sql = "SELECT
    		  COUNT(*) as allon
    	    FROM
    		  online";

    $result = mysql_query($sql) OR die(mysql_error());
    $row = mysql_fetch_assoc($result);

    echo ' ' . $lang['thereof'] . ' ' . (int)$row['allon'] . ' ' . $lang['registered'] . '';
    }

?>
Return current item: WH Board