Счетчик просмотров!
Жизнь сайта
210
Сообщения
118
Участники
464
Просмотры
-
Кому хочется посмеяться над кодом

<? 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); ?> -

Добавлено через 00:30 мин.
<? 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); ?> -
не вижу смысла вообще от этого счётчика
не вижу смысла вообще от этого счётчикаНе вижу смысла твоего сообщения.
Внимание, спойлер!
Так же как и своего. -
<? 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); ?> -

-

-
-
http://vk.com/im?sel=95692952&z=photo177241567_322726257%2Fmail41134а х у е н н о
-
-
Спасибо, пользуюсь.

