MyBB Community Forums

Full Version: Checkbox before Registration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
With this small plugin (or better: code snippet) it is possible to allow the registration process only if a checkbox is activated. The button "I agree" only appears when the checkbox is set. The plugin also checks if the checkbox is set on the server side. So if someone tries to "cheat" with the browser inspector, this will be intercepted / checked on the server side.

Tutorial:
1. download the plugin
2. upload the plugin (all files) completely to your server
3. activate the plugin in the forum (acp)
4. edit the member template "member_register_agreement"
5. Insert this variable BEFORE </body>
{$acceptedScript}
6. Change the following line 
from
<input type="submit" class="button" name="agree" value="{$lang->i_agree}" />
to
{$acceptTerms}<br/>
<input type="submit" class="button" style="display: none" name="agree" id="agree" value="{$lang->i_agree}" />

(Important is that the button gets the id "agree" and the CSS property display: none. Also the variable {$acceptTerms} must be inserted above the button.)

Have fun!

Preview:


[attachment=42917]
-------------------------------------------------

Mit diesem kleinen Plugin (Code-Snippet) ist es möglich, den Registrierungsprozess nur zu erlauben, wenn eine Checkbox aktiviert wurde. Der Button "Ich akzeptiere" erscheint erst, wenn die Checkbox gesetzt ist. Das Plugin überprüft auch, ob die Checkbox serverseitig gesetzt wurde. Sollte jemand also versuchen mit dem Browser-Inspektor zu "schummeln", wird dies serverseitig abgefangen / überprüft.

Tutorial:

1. Lade das Plugin herunter
2. Lade alle Dateien des Plugins auf deinen Server hoch
3. Aktiviere das Plugin im Forum-ACP
4. Editiere das Member Template "member_register_agreement"
5. Füge folgende Variable VOR</body> ein
{$acceptedScript}
6. Ändere folgende Zeile von
<input type="submit" class="button" name="agree" value="{$lang->i_agree}" />
zu
{$acceptTerms}<br/>
<input type="submit" class="button" style="display: none" name="agree" id="agree" value="{$lang->i_agree}" />

(Wichtig ist, dass der Button die id "agree" bekommt und die CSS Eigenschaft "display: none". Ebenfalls muss die Variable{$acceptTerms} über dem Button verfügbar sein.)
Viel Spaß!

Preview:
[attachment=42916]

Exclamation  Download:
https://community.mybb.com/mods.php?acti...w&pid=1377
Thank you for your contribution.
Well, it's a plugin... So why doesn't it modify the template ?
(2020-05-25, 07:18 PM)itsmeJAY Wrote: [ -> ]With this small plugin (or better: code snippet) it is possible to allow the registration process only if a checkbox is activated. The button "I agree" only appears when the checkbox is set. The plugin also checks if the checkbox is set on the server side. So if someone tries to "cheat" with the browser inspector, this will be intercepted / checked on the server side.

Tutorial:
1. download the plugin
2. upload the plugin (all files) completely to your server
3. activate the plugin in the forum (acp)
4. edit the member template "member_register_agreement"
5. Insert this variable BEFORE </body>
{$acceptedScript}
6. Change the following line 
from
<input type="submit" class="button" name="agree" value="{$lang->i_agree}" />
to
{$acceptTerms}<br/>
<input type="submit" class="button" style="display: none" name="agree" id="agree" value="{$lang->i_agree}" />

(Important is that the button gets the id "agree" and the CSS property display: none. Also the variable {$acceptTerms} must be inserted above the button.)

Have fun!

Preview:



-------------------------------------------------

Mit diesem kleinen Plugin (Code-Snippet) ist es möglich, den Registrierungsprozess nur zu erlauben, wenn eine Checkbox aktiviert wurde. Der Button "Ich akzeptiere" erscheint erst, wenn die Checkbox gesetzt ist. Das Plugin überprüft auch, ob die Checkbox serverseitig gesetzt wurde. Sollte jemand also versuchen mit dem Browser-Inspektor zu "schummeln", wird dies serverseitig abgefangen / überprüft.

Tutorial:

1. Lade das Plugin herunter
2. Lade alle Dateien des Plugins auf deinen Server hoch
3. Aktiviere das Plugin im Forum-ACP
4. Editiere das Member Template "member_register_agreement"
5. Füge folgende Variable VOR</body> ein
{$acceptedScript}
6. Ändere folgende Zeile von
<input type="submit" class="button" name="agree" value="{$lang->i_agree}" />
zu
{$acceptTerms}<br/>
<input type="submit" class="button" style="display: none" name="agree" id="agree" value="{$lang->i_agree}" />

(Wichtig ist, dass der Button die id "agree" bekommt und die CSS Eigenschaft "display: none". Ebenfalls muss die Variable{$acceptTerms} über dem Button verfügbar sein.)
Viel Spaß!

Preview:


Exclamation  Download:
https://community.mybb.com/mods.php?acti...w&pid=1377

this can be of good use against registration bots? Wink  

(2020-05-25, 10:56 PM)Crazycat Wrote: [ -> ]Well, it's a plugin... So why doesn't it modify the template ?

i like this idea  Big Grin
Hi,

the plugin was written so that the user agrees to the declaration of consent and cannot register before. By default MyBB has only the button "I agree". This checkbox makes sure that the user "actively" confirms that he/she agrees.  Especially in Germany/Europe there are often problems concerning the DSGVO (GDPR). Whether it helps against spambots, I do not know. Whether it complies with the DSGVO (GDPR), I do not know either. But there are many websites that do so.

@Crazycat: I originally wrote the plugin for myself. I had little time the last days. Nevertheless I didn't want to withhold it from the community. It must be said that it is also difficult to find the "input field" in the plugin and to integrate the class and ID. Many users use other themes and could have a completely different input field. That's why I wrote in the first post that it is a plugin or HOMER A "code snippet". The user can make 2 changes in a template if he already runs a forum.  He should be able to do this.

Thanks,
JAY
(2020-05-26, 06:14 AM)itsmeJAY Wrote: [ -> ]It must be said that it is also difficult to find the "input field" in the plugin and to integrate the class and ID. Many users use other themes and could have a completely different input field. That's why I wrote in the first post that it is a plugin or HOMER A "code snippet".
I can understand this reason, but you can do the two: alter the template (if it works, depending on the theme) and give explanations to alter manualy.

(2020-05-26, 06:14 AM)itsmeJAY Wrote: [ -> ]The user can make 2 changes in a template if he already runs a forum.  He should be able to do this.
Used to read and answer in support forum, I won't bet my head on this point. should is a really relative notion Big Grin
(2020-05-26, 06:40 AM)Crazycat Wrote: [ -> ]I can understand this reason, but you can do the two: alter the template (if it works, depending on the theme) and give explanations to alter manualy.

What should I look for to replace the field?

Imagine the user has in his theme for example the input field with the class "class_check" (any individual class).

I can't just replace the complete "input field" with my own. Then classes or other parameters that the user needs for his theme are missing.
What I mean is that your plugin may alter original MyBB templates and those which are not too much different (using the same submit button than the original), nothing else.
If the submit button has been modified, the user will have to correct by himself the template.