[Snippet] Prevent Topic Renaming by User (en)

Snippet-Area for phpBB 3.0.x

[Snippet] Prevent Topic Renaming by User (en)

Postby 4seven » Wed 19. May 2010, 22:27 | Userzeit: +1.00 / Mi 19. Mai 2010, 23:27

Prevent Topic Renaming by User

With this Snippet u prevent the renaming of topics by User (except Admins and Moderators)
Once the first Post of a new Topic is submitted, there is no way back for a User.

Request by: Bash
Request Thread: http://www.phpbb.com/community/viewtopi ... &t=2091604



Instruction

open

posting.php

find

Code: Select all
    'TOPIC_TITLE'            => censor_text($post_data['topic_title']), 


after add

Code: Select all
    // Prevent Topic Renaming by User / 4seven / 2010
    'S_TOPIC_TITLE_EXIST'   => (empty($post_data['topic_title'])) ? true : false,
    // Prevent Topic Renaming by User / 4seven / 2010     


open

styles/prosilver/template/posting_editor.html

find

Code: Select all
    <!-- IF S_POST_ACTION or S_PRIVMSGS or S_EDIT_DRAFT -->
    <dl style="clear: left;">
        <dt><label for="subject">{L_SUBJECT}:</label></dt>
        <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /> {ALLOW_FOR_GROUPS}</dd>
    </dl>
    <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
        <!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
        <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
        <!-- ENDIF -->
    <!-- ENDIF --> 


replace with

Code: Select all
    <!-- IF S_POST_ACTION or S_PRIVMSGS or S_EDIT_DRAFT -->
    <!-- IF S_TOPIC_TITLE_EXIST or (not S_TOPIC_TITLE_EXIST and (U_ACP or M_ACP)) -->
    <dl style="clear: left;">
        <dt><label for="subject">{L_SUBJECT}:</label></dt>
        <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /> {ALLOW_FOR_GROUPS}</dd>
    </dl>
    <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
        <!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
        <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
        <!-- ENDIF -->
      <!-- ENDIF -->
    <!-- ENDIF --> 


open

styles/subsilver2/template/posting_body.html

find

Code: Select all
<tr>
    <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
    <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
</
tr> 


replace with

Code: Select all
<!-- IF S_TOPIC_TITLE_EXIST or (not S_TOPIC_TITLE_EXIST and (U_ACP or M_ACP)) -->
<
tr>
    <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
    <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
</
tr>
<!--
 ENDIF --> 


clear all board-, style and browser-caches
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Wed 19. May 2010, 22:27 +1.00
Userzeit: Mi 19. Mai 2010, 23:27

Return to [Snippet] for 3.0.x



Who is online

Users browsing this forum: No registered users and 1 guest

cron