Просмотр файла admin/icons/last_ver.php

Размер файла: 1.19Kb
  1. <?php
  2. //include '../engine/includes/start.php';
  3.  
  4. // if (!$creator)
  5. // Core::stop();
  6.  
  7. if (file_exists($_SERVER['DOCUMENT_ROOT'].'/style/themes/last_ver.png') && filemtime($_SERVER['DOCUMENT_ROOT'].'/style/themes/last_ver.png') > (time() - 100000))
  8. {
  9. $im = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].'/style/themes/last_ver.png');
  10. }
  11. else
  12. {
  13. $last_version = @json_decode(file_get_contents('http://secwind.ru/?act=get_last_version'), true);
  14. if (empty($last_version) || (function_exists('json_last_error') && json_last_error()))
  15. {
  16. $last_version['last_version'] = '0.0';
  17. $last_version['status'] = 'n/a';
  18. }
  19. $im = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].'/admin/icons/screen.png');
  20. imagestring($im, 3 , 6 , 10 , $last_version['last_version'] , imagecolorallocate($im, 0, 0, 0));
  21. imagestring($im, 2 , 6 , 20 , $last_version['status'] , imagecolorallocate($im, 0, 0, 0));
  22. imagepng($im, $_SERVER['DOCUMENT_ROOT'].'/style/themes/last_ver.png');
  23. }
  24. header('Content-type: image/png');
  25.  
  26. imagepng($im);
  27. imagedestroy($im);