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

Размер файла: 2.08Kb
  1. <?php
  2. #-----------------------------------------------------#
  3. # ********* WAP-MOTORS ********* #
  4. # Made by : VANTUZ #
  5. # E-mail : visavi.net@mail.ru #
  6. # Site : http://pizdec.ru #
  7. # WAP-Site : http://visavi.net #
  8. # ICQ : 36-44-66 #
  9. # Вы не имеете право вносить изменения в код скрипта #
  10. #-----------------------------------------------------#
  11. require_once"../template/start.php";
  12. require_once"../template/regglobals.php";
  13. require_once"../template/config.php";
  14. require_once"../template/functions.php";
  15.  
  16.  
  17.  
  18. //-------------------- Вывод статистики ------------------------------//
  19. $str = file_get_contents(BASEDIR."local/online.dat");
  20. $substr_count = substr_count($str,"##");
  21. $bans=BASEDIR."local/online.dat";
  22. $lines=file($bans);
  23. $counter_online=count($lines);
  24. $counter_reg=$counter_online-$substr_count;
  25.  
  26. $count=file(BASEDIR."local/datacounter/host.dat");
  27. $count=explode("#",$count[0]);
  28. $counter_host=$count[1];
  29. $counter_all=$count[2];
  30.  
  31. $hcount=file(BASEDIR."local/datacounter/hits.dat");
  32. $hcount=explode("#",$hcount[0]);
  33. $counter_hits=$hcount[1];
  34. $counter_allhits=$hcount[2];
  35.  
  36. $img = imageCreateFromGIF(BASEDIR.'images/img/counter.gif');
  37. $color = imagecolorallocate($img, 169,169,169);
  38. $color2 = imagecolorallocate($img, 102,102,102);
  39.  
  40. if ($counter_online >= 0 && $counter_online < 10) $pos = 66;
  41. if ($counter_online >= 10 && $counter_online< 100) $pos = 58;
  42. if ($counter_online >= 100 && $counter_online < 1000) $pos = 48;
  43.  
  44.  
  45. if ($counter_online >= 0 && $counter_online < 10) $pos = 66;
  46. if ($counter_online >= 10 && $counter_online< 100) $pos = 54;
  47. if ($counter_online >= 100 && $counter_online < 1000) $pos = 43;
  48.  
  49. ImageString($img, 1, 4, 8, $counter_host, $color);
  50. ImageString($img, 1, 4, 15, $counter_hits, $color);
  51. ImageString($img, 6, $pos, 8, $counter_online, $color2);
  52.  
  53.  
  54. Header("Content-type: image/gif");
  55. ImageGIF($img);
  56. ImageDestroy($img);
  57. ?>