Welcome Guest, Not a member yet? Register   Sign In
Changing the captcha plugin background
#1

[eluser]EEssam[/eluser]
Hi,

Is there a way to change the captcha plugin background?

Thanks.
#2

[eluser]TheFuzzy0ne[/eluser]
No. It's a very simple plugin. If you want more flexibility, check out [url="http://ellislab.com/forums/viewthread/105788/"]my captcha library[/url]. It's based on [url="http://www.phpcaptcha.org/"]SecurImage[/url], and allows a much higher level of customisation.
#3

[eluser]JayTee[/eluser]
The plugins/captcha_pi.php file hard-codes the colors and swirls for the background. You can create your own plugin based on that code and change it yourself. The code for creating the color and swirls starts around line 257:
Code:
// -----------------------------------
    //  Assign colors
    // -----------------------------------
    
    $bg_color        = imagecolorallocate ($im, 255, 255, 255);
    $border_color    = imagecolorallocate ($im, 153, 102, 102);
    $text_color        = imagecolorallocate ($im, 204, 153, 153);
    $grid_color        = imagecolorallocate($im, 255, 182, 182);
    $shadow_color    = imagecolorallocate($im, 255, 240, 240);

    // -----------------------------------
    //  Create the rectangle
    // -----------------------------------
    
    ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color);
    
    // -----------------------------------
    //  Create the spiral pattern
    // -----------------------------------
    
    $theta        = 1;
    $thetac        = 7;
    $radius        = 16;
    $circles    = 20;
    $points        = 32;

    for ($i = 0; $i < ($circles * $points) - 1; $i++)
    {
        $theta = $theta + $thetac;
        $rad = $radius * ($i / $points );
        $x = ($rad * cos($theta)) + $x_axis;
        $y = ($rad * sin($theta)) + $y_axis;
        $theta = $theta + $thetac;
        $rad1 = $radius * (($i + 1) / $points);
        $x1 = ($rad1 * cos($theta)) + $x_axis;
        $y1 = ($rad1 * sin($theta )) + $y_axis;
        imageline($im, $x, $y, $x1, $y1, $grid_color);
        $theta = $theta - $thetac;
    }
You can see where the colors come from and so forth.




Theme © iAndrew 2016 - Forum software by © MyBB