Another CAPTCHA problem

Phoca Guestbook - creating guestbooks in Joomla! CMS
DaPrince
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 08 Sep 2008, 17:14

Another CAPTCHA problem

Post 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" />
DaPrince
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 08 Sep 2008, 17:14

SOLVED:Another CAPTCHA problem

Post 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')); ?>
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48689
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Another CAPTCHA problem

Post 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
If you find Phoca extensions useful, please support the project
aeng
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 06 Sep 2008, 13:44

Re: Another CAPTCHA problem

Post by aeng »

The solution from DaPrince Works fine here. :D
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48689
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Another CAPTCHA problem

Post by Jan »

Ok, I have done two versions

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

Jan
If you find Phoca extensions useful, please support the project
Post Reply