View Full Version : CAPTCHA customization
Jon Gibson
04-28-2009, 07:17 PM
Hello:
I was wondering if there was a way to reduce the noise level in the CAPTCHA. Or is there a way to add a custom 'screen'? I did see in the help PDF that there is a noise variable, but I tried using a few different colors with no success.
Thank you,
Jon
conmolbry
04-28-2009, 08:22 PM
Jon, I think you just have to keep playing with it until you get the look that works for you. I'm going through the same thing right now experimenting with it and the advice from tech support was to just follow customization instructions in the supporting doc.
Ray Borduin
04-29-2009, 07:41 AM
The avalable captcha settings, set through the src url are:
width = (width of captcha in pixels)
height = (height of captcha in pixels)
characters = (number of characters)
bgcolor = (hex color of background, do not include #)
textcolor = (hex color of text, do not include #)
noisecolor = (hex color of random noise, do not include #)
font = (path to .tff file that defines the font to use)
transparent = (1 or 0 to identify whether the background should be transparent, bgcolor is used as transparent color in this case)
bgimage = (path to image to be repeated for background of captcha)
gridfreq = ( 0- 99 amount of grid lines where 0 = none and 99 = completely covered)
gridcolor = (hex color of grid lines, do not include #)
gridorder = ("in front of text" to move in front, otherwise will be behind)
noisefreq = ( 0- 99 amount of white noise where 0 = none and 99 = completely covered)
noiseorder = ("in front of text" to move in front, otherwise will be behind)
charheight = (hieght of text in pixels... text will still automatically be shrunk if it will not fit based on the width and number of characters so this setting can only be effectively used to shrink text and not make it larger since it will always shrink to fit)
so if you add or alter their values in the image src you should be able to get the effect you want. Looks like you would want to lower the noisefreq value to reduce white noise.
conmolbry
04-29-2009, 05:02 PM
Jon sorry to commandeer your thread but have to ask Ray, what do you mean the src url and how does one access that? Dumb question I'm sure but the answer will be of great value!
Ray Borduin
04-30-2009, 08:13 AM
Where the <img src=""> tag is located for the captcha image. You will see some of those values are already there with the values from WA Globals referenced for allowing you to edit some of these properties directly within the WA_Globals.php file. You can override the globals settings or add new settings in the individual <img> tags for the captcha on the page.
conmolbry
04-30-2009, 07:26 PM
Here is the code from my file:
<img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=<?php echo $WAGLOBAL_Captcha_Noise; ?>&bgcolor=<?php echo $WAGLOBAL_Captcha_BG; ?>&textcolor=<?php echo $WAGLOBAL_Captcha_Text; ?>&transparent=<?php echo $WAGLOBAL_Captcha_BG_transparent; ?>&characters=<?php echo $WAGLOBAL_Captcha_Characters; ?>&width=<?php echo $WAGLOBAL_Captcha_Width; ?>&height=<?php echo $WAGLOBAL_Captcha_Height; ?>&font=<?php echo $WAGLOBAL_Captcha_Font; ?>" alt="security code" />
I don't see too many values reflecting my changes to the WA_Globals.php file. So not terribly clear how one changes this code as one way to modify the Captcha image.
Ray Borduin
05-01-2009, 04:51 AM
What have you changed? What updates to the CAPTCHA do you think aren't working?
Add a second one to the page, or play around with it on a new page to see how it works.
Start with:
<img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php">
That will give it the default values. Then try changing them. Try:
<img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?bgcolor=ff0000">
To make it update from a global you would do:
<img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?bgcolor=<?php echo $WAGLOBAL_Captcha_BG; ?>">
and now the value would come from WAGLOBAL_Captcha_BG. You can remove the globals and add the code inline if that is easier for you, or add more globals to handle more of the available configuration options.
If you find one that doesn't work the way you would expect, copy and paste the resulting <img> tag by viewing the source code on the resulting CAPTCHA image. I will be able to use that to reproduce the problem and I can try to help from there.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.