Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Captcha plugin
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
pstamb
Smarty Rookie


Joined: 29 Jan 2007
Posts: 7

PostPosted: Mon Jan 29, 2007 10:16 pm    Post subject: Captcha plugin Reply with quote

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
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5613
Location: Toronto, Canada

PostPosted: Tue Jan 30, 2007 12:51 am    Post subject: Reply with quote

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
View user's profile Send private message
nec
Smarty n00b


Joined: 30 Jan 2007
Posts: 1
Location: Germany

PostPosted: Tue Jan 30, 2007 5:17 pm    Post subject: Reply with quote

Hi pstamb,

i'm currently working on that topic, too.
Would be great if you can share your knowledge Very Happy

best regards,
nec
Back to top
View user's profile Send private message
pstamb
Smarty Rookie


Joined: 29 Jan 2007
Posts: 7

PostPosted: Sat Feb 03, 2007 12:35 am    Post subject: Published Reply with quote

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
View user's profile Send private message
harryhobbes
Smarty n00b


Joined: 10 May 2007
Posts: 1

PostPosted: Thu May 10, 2007 4:42 am    Post subject: Reply with quote

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. Very Happy
Back to top
View user's profile Send private message
pstamb
Smarty Rookie


Joined: 29 Jan 2007
Posts: 7

PostPosted: Thu May 10, 2007 10:05 am    Post subject: Reply with quote

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
View user's profile Send private message
rob_v
Smarty Rookie


Joined: 19 Jun 2006
Posts: 12

PostPosted: Wed May 23, 2007 3:08 pm    Post subject: Reply with quote

Cant seem to get to this page :
http://smarty.incutio.com/?page=captcha

is it anywhere else?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5613
Location: Toronto, Canada

PostPosted: Wed May 23, 2007 6:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Icehawg
Smarty n00b


Joined: 09 Jun 2007
Posts: 2

PostPosted: Sat Jun 09, 2007 2:51 am    Post subject: Reply with quote

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
View user's profile Send private message
pstamb
Smarty Rookie


Joined: 29 Jan 2007
Posts: 7

PostPosted: Sat Jun 09, 2007 5:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Icehawg
Smarty n00b


Joined: 09 Jun 2007
Posts: 2

PostPosted: Tue Jun 12, 2007 1:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
waveyuk
Smarty n00b


Joined: 27 Aug 2007
Posts: 2

PostPosted: Mon Aug 27, 2007 5:43 pm    Post subject: Can't get it working :( Reply with quote

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
View user's profile Send private message
pstamb
Smarty Rookie


Joined: 29 Jan 2007
Posts: 7

PostPosted: Mon Aug 27, 2007 7:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
waveyuk
Smarty n00b


Joined: 27 Aug 2007
Posts: 2

PostPosted: Mon Aug 27, 2007 8:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
fallenOne
Smarty n00b


Joined: 28 Aug 2007
Posts: 2

PostPosted: Tue Aug 28, 2007 7:13 am    Post subject: Reply with quote

First of all, I'm sorry if my English is bad.. I;m still learning it.. Very Happy

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP