Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 2 Ответов
  • 2240 Просмотров
*

antfrolov

  • Захожу иногда
  • 83
  • 2 / 2
У меня вопрос:
Где корректируются цвета Capcha?
Сам не смог найти :(
*

Yurets

  • Захожу иногда
  • 405
  • 92 / 0
  • Губернатор острова Борнео
Re: Где корректируются цвета Capcha
« Ответ #1 : 07.01.2009, 00:58:24 »
autobb.class.php

Код
	function getImage() {
global $database, $mosConfig_absolute_path;
$bg = array( 0xEA, 0xEE, 0xFF ); //background
$colors = array( //text colors
array( 0x2a, 0x00, 0xFF ),
array( 0x14, 0x42, 0x00 ),
array( 0xFF, 0x00, 0xFF ),
array( 0x47, 0x47, 0x47 ),
);
putenv('GDFONTPATH=' . realpath($mosConfig_absolute_path.'/includes/fonts/'));
$font = $mosConfig_absolute_path.'/components/com_autobb/fonts/arial.ttf';
$font_size = 22;
$letter_width = 18;
$offsetX = 5;

$im = imagecreatetruecolor( 100, 50 );
$background = imagecolorallocate($im, $bg[0], $bg[1], $bg[2] );
imagefill( $im, 1, 1, $background );

for( $i=0; $i<strlen( $this->text ); ++$i ) {
$angle = rand( 0, 60 ) - 30;
$x = $i*$letter_width + $offsetX;
$y = 30 + floor( $angle/3 );
$color_index = rand( 0, count( $colors )-1 );
$color = imagecolorallocate($im, $colors[$color_index][0], $colors[$color_index][1], $colors[$color_index][2] );
imagettftext($im, $font_size, $angle, $x, $y, $color, $font, iconv("cp1251", "utf-8", substr( $this->text, $i, 1 ) ) );
}
unset($i, $angle, $x, $y, $color, $color_index);
return $im;
}
}

« Последнее редактирование: 07.01.2009, 01:06:23 от Yurets »
В комнате с белым потолком
*

antfrolov

  • Захожу иногда
  • 83
  • 2 / 2
Re: Где корректируются цвета Capcha
« Ответ #2 : 07.01.2009, 09:02:03 »
Спасибо! Сделал, теперь даже капча идеальная :)
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Ввод цвета вручную!

Автор seregapr

Ответов: 1
Просмотров: 1816
Последний ответ 21.08.2009, 13:44:37
от Alex Revo