Page 1 of 1

Another CAPTCHA problem

Posted: 08 Sep 2008, 17:21
by DaPrince
After upgrading from 1.2 (I think) to the latest version the CAPTCHA image is not working. It is just a blank image with a red X.

Worked fine with the old version and the site has GD Support enabled. The html-link to the image is

Code: Select all

<img src="/index.php/guestbook/1?phocasid=650d778acf84ac2b2db2a0643fad6924" alt="" id="phocacaptcha" />
But this doesn't give me any hint to whats wrong. I can see a few others are having CAPTCHA-problems. Solutions anyone?

site : http://www.the-sunflower.com --> Guestbook

Update:

I can see there is a change on the CAPTCHA-part from the old version.

Code: Select all

<td width="5" align="left" valign="middle"><?php echo JHTML::_( 'image.site', 'index.php?option=com_phocaguestbook&view=phocaguestbooki&phocasid='. md5(uniqid(time())), '', '','',JText::_('Captcha Image'), array('id' => 'phocacaptcha')); ?></td>
This part is commented out (when uncommented the images will show fine, but not working) and replaced with this (where it doesn't work)

Code: Select all

<img src="<?php echo JRoute::_('index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.$this->itemid.'&phocasid='. md5(uniqid(time()))) ; ?>" alt="<?php JText::_('Captcha Image'); ?>" id="phocacaptcha" />

SOLVED:Another CAPTCHA problem

Posted: 08 Sep 2008, 22:19
by DaPrince
Here is what I did to solve the problem - maybe not the best way, but it works

Modify the php-file : /components/com_phocaguestbook/views/phocaguestbook/tmpl/default.php

Locate this section (around line 314) copy/ paste this section between the <TD></TD> tags

Code: Select all

    <td width="5" align="left" valign="middle">
    <?php //echo JHTML::_( 'image.site','index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.$this->itemid.'&phocasid='. md5(uniqid(time())), '', '','',JText::_('Captcha Image'), array('id' => 'phocacaptcha')); ?>
    
    <!-- <img src="<?php echo JRoute::_('index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.$this->itemid.'&phocasid='. md5(uniqid(time()))) ; ?>" alt="<?php JText::_('Captcha Image'); ?>" id="phocacaptcha" />
    -->
    <?php echo JHTML::_( 'image.site','index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.$this->itemid.'&phocasid='. md5(uniqid(time())) , '', '','',JText::_('Captcha Image'), array('id' => 'phocacaptcha')); ?>
    </td>

In other words - I just modified the new line <IMG SRC=... with the old one

Code: Select all

<?php echo JHTML::_( 'image.site','index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.$this->itemid.'&phocasid='. md5(uniqid(time())) , '', '','',JText::_('Captcha Image'), array('id' => 'phocacaptcha')); ?>

Re: Another CAPTCHA problem

Posted: 08 Sep 2008, 23:26
by Jan
Hi, the problem is, SEF in Joomla is very problematic... the code is commented, because on some servers, this will cause problems, on some server other solution works ... but no idea why? the linkd is created by JRoute method which should create the right link... but not everywhere :( so if it works for you, then this is great, maybe this solution will help other people too ...

Jan

Re: Another CAPTCHA problem

Posted: 09 Sep 2008, 16:01
by aeng
The solution from DaPrince Works fine here. :D

Re: Another CAPTCHA problem

Posted: 09 Sep 2008, 23:11
by Jan
Ok, I have done two versions

see:
https://www.phoca.cz/documentation/index ... -component

Jan