Просмотр файла gallery/count.php

Размер файла: 1.57Kb
<?php
// mod by Golem http://veplog.ru

require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";



//-------------------- Вывод статистики ------------------------------//
$str = file_get_contents(BASEDIR."local/online.dat");
$substr_count = substr_count($str,"##");
$bans=BASEDIR."local/online.dat";
$lines=file($bans);
$counter_online=count($lines);
$counter_reg=$counter_online-$substr_count;

$count=file(BASEDIR."local/datacounter/host.dat");
$count=explode("#",$count[0]);
$counter_host=$count[1];
$counter_all=$count[2];

$hcount=file(BASEDIR."local/datacounter/hits.dat");
$hcount=explode("#",$hcount[0]);
$counter_hits=$hcount[1];
$counter_allhits=$hcount[2];

$img = imageCreateFromGIF(BASEDIR.'images/img/counter.gif');
$color = imagecolorallocate($img, 169,169,169);
$color2 = imagecolorallocate($img, 102,102,102);

if ($counter_online >= 0 && $counter_online < 10) $pos = 66;
if ($counter_online >= 10 && $counter_online< 100) $pos = 58;
if ($counter_online >= 100 && $counter_online < 1000) $pos = 48;


if ($counter_online >= 0 && $counter_online < 10) $pos = 66;
if ($counter_online >= 10 && $counter_online< 100) $pos = 54;
if ($counter_online >= 100 && $counter_online < 1000) $pos = 43;

ImageString($img, 1, 4, 8, $counter_host, $color);
ImageString($img, 1, 4, 15, $counter_hits, $color);
ImageString($img, 6, $pos, 8, $counter_online, $color2);


Header("Content-type: image/gif");
ImageGIF($img);
ImageDestroy($img);
?>