<?php
require"config.php";

$link = @mysql_connect( @$DB_HOST, @$DB_USER, @$DB_PASS );
@mysql_select_db( @$DB_NAME );
$q = @mysql_query( @"SELECT id FROM users WHERE onl>'".@intval( @time( ) - 300 )."'" );
$count = @mysql_num_rows( @$q );
if ( 0 <= $count && $count < 10 )
{
$pos = 20;
}
if ( 10 <= $count && $count < 100 )
{
$pos = 25;
}
if ( 100 <= $count && $count < 1000 )
{
$pos = 30;
}
$im = @imagecreate( @$pos, 15 );
$background_color = imagecolorallocate( $im, 255, 255, 255 );

$col = imagecolorallocate( $im, 0, 0, 0 );
imagestring( $im, 2, 1, 1, "[".$count."]", $col );
header( "Content-Type: image/png" );
header( "Cache-control: no-cache, no-store" );
imagepng( $im );
@mysql_close( @$link );
?>