1
leopsyrj
setImageSize() class/captcha/image/scripts/image.php
  • 2010/9/16 15:58

  • leopsyrj

  • Just popping in

  • Posts: 5

  • Since: 2008/8/28


function setImageSize()
{
$MaxCharWidth = 0;
$MaxCharHeight = 0;
$oImage = imagecreatetruecolor(100, 100);
$text_color = imagecolorallocate($oImage, mt_rand(0, 100), mt_rand(0, 100), mt_rand(0, 100));
$FontSize = $this->config["fontsize_max"];
for ($Angle = -30; $Angle <= 30; $Angle++) {
for ($i = 65; $i <= 90; $i++) {
$CharDetails = imageftbbox($FontSize, $Angle, $this->font, chr($i), array());
$_MaxCharWidth = abs($CharDetails[0] + $CharDetails[2]);
if (($_MaxCharWidth > $MaxCharWidth ) && ($_MaxCharWidth < 1000000)) {
$MaxCharWidth = $_MaxCharWidth;
}
$_MaxCharHeight = abs($CharDetails[1] + $CharDetails[5]);
if (($_MaxCharHeight > $MaxCharHeight ) && ($_MaxCharHeight < 1000000)) {
$MaxCharHeight = $_MaxCharHeight;
}
}
}
imagedestroy($oImage);

$this->height = $MaxCharHeight + 2;
$this->spacing = intval( ($this->config["num_chars"] * $MaxCharWidth) / $this->config["num_chars"] );
$this->width = ($this->config["num_chars"] * $MaxCharWidth) + ($this->spacing/2);
}


class/captcha/image/scripts/image.php line 202 and 206
of xoops 2,4,5

$_MaxCharWidth and $_MaxCharHeight get a high values (2147483651 p ex) only on first call of imageftbbox...

making a big loop on function drawBars(), server slow response and no shows the image...

i resolved adding && ($_MaxCharWidth < 1000000)
working fine now...



2
leopsyrj
Portuguese-Brazilian Translation 2.3.2b
  • 2008/12/17 20:47

  • leopsyrj

  • Just popping in

  • Posts: 5

  • Since: 2008/8/28


Hi all,

Im have make a translation for portuguese-brazil,

I would like to provide to the community.

how should I proceed?



3
leopsyrj
Re: Session Control from another Website User Login
  • 2008/9/7 4:21

  • leopsyrj

  • Just popping in

  • Posts: 5

  • Since: 2008/8/28


Hi people,
I have exactly this same problem. XOOPS is located in a subdirectory of project main.
mysite.com/xoops/
and the main site have a login system.

exists some possibility to use the object "global $xoopsUser" integrated?
for identify the user?



4
leopsyrj
Re: this TABLELESS is possible?
  • 2008/8/28 19:10

  • leopsyrj

  • Just popping in

  • Posts: 5

  • Since: 2008/8/28


if somebody to know some example, will be extremely grateful...

Thanks since already



5
leopsyrj
this TABLELESS is possible?
  • 2008/8/28 19:05

  • leopsyrj

  • Just popping in

  • Posts: 5

  • Since: 2008/8/28


Hi all from Brazil, im new at here. (my english is not very good)

I have a problem with tableless.
Im not see exit for this.

I have a confusing layout... (click on link)
http://www.leonardo.carvalho.nom.br/arquivos/exemplos/tableless.gif

My idea is
->each square is a one block.

Its possible with "tableless" (no tables tags)?




TopTop



Login

Who's Online

217 user(s) are online (138 user(s) are browsing Support Forums)


Members: 0


Guests: 217


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits