forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: pawelfoto on December 12, 2009, 05:00:00 pm

Title: [Solved]: How do I make " I agree" checkbox on the bottom of disclaimer?
Post by: pawelfoto on December 12, 2009, 05:00:00 pm
I want to force users to click on " I agree" checkbox on the page with disclaimer,  before they will continue  registration process.

I dont know html/javascript at all,  so this is big problem for me.

Would anybode help me with this?


My gallery: www.pawelfoto.com

Title: Re: How do I make " I agree" checkbox on the bottom of disclaimer?
Post by: Joe Carver on December 12, 2009, 05:14:02 pm
The default behavior is for the disclaimer to be shown. But since you don't have "Allow new user registrations" set to yes it is hard to see what you have now.........
Title: Re: How do I make " I agree" checkbox on the bottom of disclaimer?
Post by: pawelfoto on December 12, 2009, 05:22:10 pm
Ok, It is solved

I just copied some scripts form modifyalb.php...
Title: Re: How do I make " I agree" checkbox on the bottom of disclaimer?
Post by: Joachim Müller on December 14, 2009, 10:37:34 am
Post what you actually did for the benefit of others with similar questions.
Title: Re: How do I make " I agree" checkbox on the bottom of disclaimer?
Post by: pawelfoto on December 15, 2009, 04:27:54 pm
Ok, it is quite Simple.

Edit register.php file. Make sure you done backup first.


Find
Code: [Select]
<form method="post" action="{$_SERVER['PHP_SELF']}">
Past into new line before

Code: [Select]
<script>
var checkobj

function agreesubmit(el){
    checkobj=el
    if (document.all||document.getElementById){
        for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
            var tempobj=checkobj.form.elements[i]
            if(tempobj.type.toLowerCase()=="submit")
                tempobj.disabled=!checkobj.checked
        }
    }
}

function defaultagree(el){
    if (!document.all&&!document.getElementById){
        if (window.checkobj&&checkobj.checked)
            return true
        else{
            alert("I am sure")
            return false
        }
    }
}
</script>

Next find

Code: [Select]
echo <<<EOT
                </td>
        </tr>
        <tr>
                <td colspan="2" align="center" class="tablef">
                        <input type="submit" name="agree" value="{$lang_register_php['i_agree']}" class="button" />
                </td>
        </tr>

EOT;

and replace it with this code below

Code: [Select]
echo <<<EOT
 
                </td>
                 
        </tr>
        <tr>
        <td colspan="1" align="left" class="tablef">
               
                                      <input name="agreecheck" id="agreecheck" type="checkbox" onClick="agreesubmit(this)" /><label for="agreecheck"><b>I Agree</b></label>
                </td>

        </tr>
        <tr>
                <td colspan="1" align="center" class="tablef">
                        <input type="submit" name="agree" value="{$lang_register_php['i_agree']}" class="button" disabled="disabled" />
                </td>
        </tr>

EOT;

Thats it !
Title: Re: How do I make " I agree" checkbox on the bottom of disclaimer?
Post by: Joachim Müller on December 16, 2009, 08:30:36 am
Thanks for your readiness to share.