MyBB Community Forums

Full Version: Stop members to change the "Prefixe & Subject" of their thread by edit the 1st post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello ,

In this tutorial i will show you how can you stop the register members to edit themselves their thread Prefixe & Subject .

Requirement :- Template conditionals

Step 1:

Install template conditionals

Step 2:

Log into your acp and head over to your templates.


Step 3: Go to the editpost  template and click edit .

1. if you want to stop them edit from only Prefixe then remove all the codes from box and paste it.
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
{$headerinclude}
{$post_javascript}
</head>
<body>
{$header}
{$preview}
{$post_errors}
{$attacherror}
{$moderation_notice}
{$deletebox}
<form id="editpost" action="editpost.php?pid={$pid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<if $GLOBALS['mybb']->user['usergroup'] == 2 then>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
</tr>
{$loginbox}
<tr>
<td class="trow2"><strong>{$lang->subject}</strong></td>
<td class="trow2"><strong>Report To Change Prefixe</strong><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="2" /></td>
</tr>
{$posticons}
<tr>
<td class="trow2" valign="top"><strong>{$lang->your_message}</strong><br /><div style="text-align: center;">{$smilieinserter}</div></td>
<td class="trow2">
<textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
{$codebuttons}
</td>
</tr>
{$editreason}
{$postoptions}
{$subscriptionmethod}
{$pollbox}
</table>
{$attachbox}
<br />
<div align="center"><input type="submit" class="button" name="submitbutton" value="{$lang->update_post}" tabindex="3" accesskey="s" /> <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
<input type="hidden" name="action" value="do_editpost" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
</form>
{$footer}
<br />
<else>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
</tr>
{$loginbox}
<tr>
<td class="trow2"><strong>{$lang->subject}</strong></td>
<td class="trow2">{$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
</tr>
{$posticons}
<tr>
<td class="trow2" valign="top"><strong>{$lang->your_message}</strong><br /><div style="text-align: center;">{$smilieinserter}</div></td>
<td class="trow2">
<textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
{$codebuttons}
</td>
</tr>
{$editreason}
{$postoptions}
{$subscriptionmethod}
{$pollbox}
</table>
{$attachbox}
<br />
<div align="center"><input type="submit" class="button" name="submitbutton" value="{$lang->update_post}" tabindex="3" accesskey="s" /> <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
<input type="hidden" name="action" value="do_editpost" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
</form>
{$footer}
</if>
</body>
</html>

2. if you want to stop them edit from both subject and Prefixe then remove all the codes and paste it there.
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
{$headerinclude}
{$post_javascript}
</head>
<body>
{$header}
{$preview}
{$post_errors}
{$attacherror}
{$moderation_notice}
{$deletebox}
<form id="editpost" action="editpost.php?pid={$pid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<if $GLOBALS['mybb']->user['usergroup'] == 2 then>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
</tr>
{$loginbox}
<tr>
<td class="trow2"><strong>{$lang->subject}</strong></td>
<td class="trow2"><strong>Report To Change Thread Prefixe & Title</strong></td>
</tr>
{$posticons}
<tr>
<td class="trow2" valign="top"><strong>{$lang->your_message}</strong><br /><div style="text-align: center;">{$smilieinserter}</div></td>
<td class="trow2">
<textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
{$codebuttons}
</td>
</tr>
{$editreason}
{$postoptions}
{$subscriptionmethod}
{$pollbox}
</table>
{$attachbox}
<br />
<div align="center"><input type="submit" class="button" name="submitbutton" value="{$lang->update_post}" tabindex="3" accesskey="s" /> <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
<input type="hidden" name="action" value="do_editpost" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
</form>
{$footer}
<br />
<else>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
</tr>
{$loginbox}
<tr>
<td class="trow2"><strong>{$lang->subject}</strong></td>
<td class="trow2">{$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
</tr>
{$posticons}
<tr>
<td class="trow2" valign="top"><strong>{$lang->your_message}</strong><br /><div style="text-align: center;">{$smilieinserter}</div></td>
<td class="trow2">
<textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
{$codebuttons}
</td>
</tr>
{$editreason}
{$postoptions}
{$subscriptionmethod}
{$pollbox}
</table>
{$attachbox}
<br />
<div align="center"><input type="submit" class="button" name="submitbutton" value="{$lang->update_post}" tabindex="3" accesskey="s" /> <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
<input type="hidden" name="action" value="do_editpost" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
</form>
{$footer}
</if>
</body>
</html>


Make sure the register member group id is " 2" .

You are done.
Thank you for your contribution.

Please note that this won't stop users from changing the subject or prefix if they know how to insert the form data.