View previous topic :: View next topic |
Author |
Message |
pstamb Smarty Rookie
Joined: 29 Jan 2007 Posts: 7
|
Posted: Mon Jan 29, 2007 10:16 pm Post subject: Captcha plugin |
|
|
Hello, all.
I' m brand new at the forum and I have made a CAPTCHA plugin that I would be happy to share.
I do not know if someone has already done something like that, whether and how I should publish that, so that more people can make use of it and make it better.
Greetings,
pstamb |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Jan 30, 2007 12:51 am Post subject: |
|
|
Hi.
Feel free to add it to the plugins area of the wiki: http://smarty.incutio.com/?page=SmartyPlugins
If you do so, you may want to include a link back from your wiki page to this thread so that people can discuss your plugin.
Best regards! |
|
Back to top |
|
nec Smarty n00b
Joined: 30 Jan 2007 Posts: 1 Location: Germany
|
Posted: Tue Jan 30, 2007 5:17 pm Post subject: |
|
|
Hi pstamb,
i'm currently working on that topic, too.
Would be great if you can share your knowledge
best regards,
nec |
|
Back to top |
|
pstamb Smarty Rookie
Joined: 29 Jan 2007 Posts: 7
|
Posted: Sat Feb 03, 2007 12:35 am Post subject: Published |
|
|
Have a look at this:
http://smarty.incutio.com/?page=captcha
(Boots thank you for your help with the wiki)
Any ideas or modifications more than welcome! |
|
Back to top |
|
harryhobbes Smarty n00b
Joined: 10 May 2007 Posts: 1
|
Posted: Thu May 10, 2007 4:42 am Post subject: |
|
|
Just found this over on the German forum. If you are having 'tag not found' errors when you run this plugin then use this:
Quote: | Code: | {captcha name="captcha" length=4} |
|
Not sure why, but it worked for me. |
|
Back to top |
|
pstamb Smarty Rookie
Joined: 29 Jan 2007 Posts: 7
|
Posted: Thu May 10, 2007 10:05 am Post subject: |
|
|
Oh, and by the way, if anyone has the time to put the code inside the wiki, instead of having it on a zip file on my site, they are more than welcome. |
|
Back to top |
|
rob_v Smarty Rookie
Joined: 19 Jun 2006 Posts: 12
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed May 23, 2007 6:19 pm Post subject: |
|
|
The page loads here just fine. Ask Google if you don't have any luck -- just add "cache:" in front of the url as your Google query, eg: Code: | cache:http://smarty.incutio.com/?page=captcha |
|
|
Back to top |
|
Icehawg Smarty n00b
Joined: 09 Jun 2007 Posts: 2
|
Posted: Sat Jun 09, 2007 2:51 am Post subject: |
|
|
I get the following error every time I try to use captcha plugin.
Code: | The image “http://localhost/captcha.php?cap=167a62e266e1aa18a7153fb5a2f6eb5c” cannot be displayed, because it contains errors. |
I am using the latest xampp install on my dev machine(Windows XPSP2) with gd2 extension enabled in php. The broken image placeholder appears in firefox, and the error message above is what I get when I try to open the image through firefox directly.
I can, however, look at the image that was created with any regular image program.
Little help? Thanks.
edit : this is the code I am using in the TPL file.
Code: | {captcha name="captcha" length=4} |
|
|
Back to top |
|
pstamb Smarty Rookie
Joined: 29 Jan 2007 Posts: 7
|
Posted: Sat Jun 09, 2007 5:50 pm Post subject: |
|
|
This is weird.
Since you see the image from programs, it is safe to assume that the image gets created OK.
Normally, the captcha.php script should delete an image after displaying it. So it basically should work just once.
In captcha.php uncomment the line that sets the header (line 6) and see where php is generating an error, or right click on "Save Image As.." and see the saved file in a text editor. Also see if commenting line 10 (where it deletes the file) makes any difference to you and handle accordingly.
After writing this reply, I believe it has to do with the script captcha.php for some reason not having the proper rights or the proper path to read the image. |
|
Back to top |
|
Icehawg Smarty n00b
Joined: 09 Jun 2007 Posts: 2
|
Posted: Tue Jun 12, 2007 1:47 pm Post subject: |
|
|
Got it sorted out mate. Thanks for the suggestions. Had to do with my Windows dev box and my RedHat prod box and the differing paths. I was using $_SERVER["SERVER_NAME"] originally to distinguish between the two and now I reworked my constants to define the path to the file based on the IP address of the box.
Thanks again. |
|
Back to top |
|
waveyuk Smarty n00b
Joined: 27 Aug 2007 Posts: 2
|
Posted: Mon Aug 27, 2007 5:43 pm Post subject: Can't get it working :( |
|
|
Hi All.
I am trying to get this working. I've done everything stated, but when I put the {captcha} tag in my smarty template, it causes just a blank page to load.
I'm using a highly modified version of osDate script, but it uses the smarty template and all other functions work just fine. If I take out the {captcha} tag out of the template, the page loads fine.
Is there something I've missed? I've checked that the directories exist and that they are writable etc.
Any help appreciated.
Thanks
Dave |
|
Back to top |
|
pstamb Smarty Rookie
Joined: 29 Jan 2007 Posts: 7
|
Posted: Mon Aug 27, 2007 7:21 pm Post subject: |
|
|
Looks like a very low memory limit. PHP 5.2 has an increased need and if it runs out of memory, I have gotten blank pages.
I assume you normally are viewing errors from your scripts. What I would do, would be to place some
die('I am here');
statements in the code until I get the blank page.
Really it's hard to tell what's going wrong in your case. |
|
Back to top |
|
waveyuk Smarty n00b
Joined: 27 Aug 2007 Posts: 2
|
Posted: Mon Aug 27, 2007 8:04 pm Post subject: |
|
|
Hmmm... think is, everything else works just fine. I am PHP 5.02 I think. The site does quite a bit of in-graphic rendering just fine, pics on the fly etc, so I don't think it's a memory issue, but thanks anyway.
pstamb wrote: | Looks like a very low memory limit. PHP 5.2 has an increased need and if it runs out of memory, I have gotten blank pages.
I assume you normally are viewing errors from your scripts. What I would do, would be to place some
die('I am here');
statements in the code until I get the blank page.
Really it's hard to tell what's going wrong in your case. |
|
|
Back to top |
|
fallenOne Smarty n00b
Joined: 28 Aug 2007 Posts: 2
|
Posted: Tue Aug 28, 2007 7:13 am Post subject: |
|
|
First of all, I'm sorry if my English is bad.. I;m still learning it..
Second of all, I want to ask about captcha plugin..
I'm still new to Smarty and I want to add captcha to my site..
I put captcha tag in the template, but it returns an error message :
Code: | Fatal error: Call to undefined function imageCreate() in D:\Programming\PHP\Biotrop\include\smarty\plugins\captcha.class.php on line 50 |
What does it mean?? What I should do??
Thanks before... |
|
Back to top |
|
|