MyBB Community Forums

Full Version: Require users to agree that this is the best section for their topic
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This modification will require users to agree that the believe this forum is the best section for their topic.

1. Go to the newthread template and find:

<td class="trow2">{$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>

2. Replace it with this:

<td class="trow2">{$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /><input type="checkbox" class="input_control"  value="subject" /><strong>I believe {$forum['name']} is the best section for this topic.</strong></td>

3. Insert this at the end right before </body>:

<script type="text/javascript">
$(document).ready(function () {
    	$('.input_control').change(function () {
        	$('input[name=' + this.value + ']')[0].disabled = !this.checked;
    	}).change();
	});
</script>
<style type="text/css">
	input.textbox:disabled {
		background: #DDD;
   	}
</style>

4. All done! Smile

[attachment=33872]
[attachment=33873]
so they cannot submit if not checked?
(2015-02-27, 10:25 AM)expat Wrote: [ -> ]so they cannot submit is not checked?

Yes.
this is very useful .
(2015-02-27, 04:48 PM)iturdu Wrote: [ -> ]this is very useful .

Thank you. Smile
might be better to have it next to the button Toungue
This tutorial gave me the the idea of using a label to remind users to use a prefix when possible, and the location to edit.
Thank you for posting Smile.
that was cool..
I use that for announce member who posted will banned, if posting in wrong section Smile
thanks mathew for share, i'll try compatability with my forum theme