If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
AG: Captcha is not shown  XML
Forum Index » Advanced Guestbook Forum
Author Message
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

Seems to be calling the createPixel function when creating the 1x1 image. This happens if the test for GD support returns false or the createImage function fails. there are so many places it could be failing it's mad as is why it keeps failing randomly. You could either add a message saying if the captcha doesn't show to refresh the page but as you are using frames that's not the best idea or I could give you some JavaScript to add to let them refresh the image.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

OK try this

Open templates/captcha.php and change

<img src="$GB_PG[base_url]/image.php?id=$VARS[gbtoken]" border="0">

to

<img src="$GB_PG[base_url]/image.php?id=$VARS[gbtoken]" border="0" id="gbCaptcha">

Now save that and open templates/form.php and after </form> add

<script type="text/javascript">
theImg = document.getElementById('gbCaptcha');
while(theImg.clientHeight == 1) {
// Create a random number between 1 and 1000
var randomnumber=Math.floor(Math.random()*1001);
// Change the image
theImg.src = theImg.src + '&rand=' + randomnumber;
}
</script>


Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
llsastre
Beginner

Joined: 26/04/2011 23:17:09
Messages: 26
Offline

I've modified both pages (captcha.php and form.php), but it does the same (take a look to page code. It seems doesn't add the parameter &rand=xxx to src=image.php?...).
Refreshing can show captcha image.
Can you pass me the javascript code to refresh the addentry page clicking a button inside the form? I must to use iframes to integrate into web site.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

I was hoping that would automatically reload it.

Then simply add a link like <a href="#" onclick="refreshCaptcha(); return false;">Reload Captcha</a>

This message was edited 2 times. Last update was at 28/04/2011 17:35:11


Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
llsastre
Beginner

Joined: 26/04/2011 23:17:09
Messages: 26
Offline

I've made changes on templates/form.php (for javascript code) and captcha.php (for image link code). Now, a guest can post comments if click the refresh icon until captcha image is showed, but it is not an elegant solution. However, this code can be used for next updates of AG to reload a captcha image if it is difficult to read.
llsastre
Beginner

Joined: 26/04/2011 23:17:09
Messages: 26
Offline

I've tried two alternate guestbook scripts with captcha generator images and work fine (both), but AG it's much better (configuration settings, design, language options, admin tools, etc).
I've revised the code and the environment variables of my server, but I'm unable to find why doesn't display CAPTCHA image. Do you think it is a server configuration problem or it is some bug of AG script? Is it possible to implement another captcha generator?
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

Short of my having access to your server and working through the script step by step I couldn't say for sure. I might make a test script for you when I get a spare moment.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
llsastre
Beginner

Joined: 26/04/2011 23:17:09
Messages: 26
Offline

If you need access to my server by ftp, I can create an username/password/folder for you and upload a copy of AG in. If agree I'll send you a pm with data.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

I'll do a test script first that will use the same test functions that AG captcha uses and output what they returned.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
llsastre
Beginner

Joined: 26/04/2011 23:17:09
Messages: 26
Offline

Ok.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

Upload the two attached files to the guestbook folder then let me know.
 Filename test.zip [Disk] Download
 Description Test Files
 Filesize 1 Kbytes
 Downloaded:  1 time(s)


Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
llsastre
Beginner

Joined: 26/04/2011 23:17:09
Messages: 26
Offline

The files are uploaded. Test.php had a (little) syntax error on line 3 which I've corrected. Now is working. You can run at www.ranchocanpicafort/gbook. All seems work well with this test. What about image2.php?

This message was edited 1 time. Last update was at 30/04/2011 11:02:44

Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

Everything is ok in the image.php file so now we move on to captcha.class.php. Replace your existing two files with the two in here. They should not affect your guestbook as it requires an extra input in the url to make it debug.
 Filename test2.zip [Disk] Download
 Description More test files
 Filesize 4 Kbytes
 Downloaded:  1 time(s)


Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
llsastre
Beginner

Joined: 26/04/2011 23:17:09
Messages: 26
Offline

Uploaded done. You can test it now.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

And you definitely replaced image.php and captcha.class.php with the new files because debug=1 is having no effect.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
 
Forum Index » Advanced Guestbook Forum
Go to:   
Based on the open source JForum