Счетчик просмотров!
-
<?
if($_GET['top'] == ''){die("Exit");}
$mask = "*.txt";
foreach(glob($mask ) as $filename){
if(strlen($filename) < 32){
$str = file_get_contents($filename);
if($str != '0'){
$count[str_replace('.txt','',$filename)] = $str;}}}
arsort($count);
$resultat = explode('top',$_GET['top']);
$_GET['top'] = $resultat[1];
$resultat = explode('.png', $_GET['top']);
$resultat = $resultat[0];
$resultat = intval($resultat);
if($resultat != ''){
$fds = $count;
unset($count);
$f = 0;
foreach ($fds as $key => $value){
if($f < $resultat)
$count[$key] = $value;
$f++;}}
$font = 'AGPRESB.ttf';
$fontsize = 10;
$angle = 0;
$height = 0;
foreach ($count as $key => $value){
$w[$key] = 'Topic'.$key.' - '.$value.' просмотров';
$tex = imagettfbbox($fontsize,$angle,$font,$w[$key]);
$sd[$key] = $tex;
$text[$key] = $tex[2];
$height = $height + 16;}
arsort($text);
foreach ($text as $key => $value){
if($s == ''){$s=$value+4;}}
header('Content-type: image/png');
$im = imagecreatetruecolor($s, $height);
imagesavealpha($im,false);
$bg = imagecolorallocate($im,255,255,255);
imagefill($im,0,0,$bg);
putenv('GDFONTPATH='. realpath('.'));
$y = 12;
foreach ($count as $key => $value){
$text_x = $s - $text[$key];
$text_x = $text_x / 2;
$text_y = $y;
switch ($_GET['color']){
case 'r':imagettftext($im,$fontsize,$angle,$text_x,$text_y,imagecolorallocate($im,255,0,0), $font, $w[$key]);break;
case 'g':imagettftext($im,$fontsize,$angle,$text_x,$text_y,imagecolorallocate($im,0,255,0), $font, $w[$key]);break;
case 'b':imagettftext($im,$fontsize,$angle,$text_x,$text_y,imagecolorallocate($im,0,0,255), $font, $w[$key]);break;
case '0':imagettftext($im,$fontsize,$angle,$text_x,$text_y,imagecolorallocate($im,0,0,0), $font, $w[$key]);break;
default:imagettftext($im,$fontsize,$angle,$text_x,$text_y,imagecolorallocate($im,0,0,0), $font, $w[$key]);break;};
$y=$y+16;}
imagepng($im);
imagedestroy($im);
?> -
Упс, случайно поднял тему.
-
%(red)[Not Found
The requested URL /img/txt/top.png was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
]
Apache/2 Server at telonko.guru-hosting.ru Port 80 -
%(red)[Not Found
The requested URL /img/txt/top.png was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
]
Apache/2 Server at telonko.guru-hosting.ru Port 80%(red)[Not Found The requested URL /img/txt/top.png was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. ] Apache/2 Server at telonko.guru-hosting.ru Port 80Ошибка исправлена.
Ответ поддержки:Здравствуйте! Спасибо за сообщение - это было из-за встраиваемой рекламы хостинга. Поправили - теперь все работает. С уважением, Guru-Host -
