Prevenire Rinominare il Topic dall'Utente

Forum misto con frammenti di codice
Rispondi
Avatar utente
Galandas
Staff phpBB3World
Staff phpBB3World
Messaggi: 792
Iscritto il: 4 nov 2012, 9:18
Località: phpbb3world
Contatta:

Prevenire Rinominare il Topic dall'Utente

Messaggio da Galandas » 1 nov 2013, 19:26

Prevenire Rinominare il Topic dall'Utente

Autore: 4seven
Descrizione: Con questo Snippet si può impedire rinominare un argomento da parte dell'utente (ad eccezione degli amministratori e moderatori)
Una volta che il primo messaggio di un nuovo Topic viene presentato, non c'è modo di tornare indietro per un utente.
Apri: posting.php

Trova:

Codice: Seleziona tutto

    'TOPIC_TITLE'            => censor_text($post_data['topic_title']), 

Aggiungi dopo:

Codice: Seleziona tutto

    // 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 

Apri: styles/prosilver/template/posting_editor.html

Trova:

Codice: Seleziona tutto

    <!-- 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 --> 

Sostituire con:

Codice: Seleziona tutto

    <!-- 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 --> 


Apri: styles/subsilver2/template/posting_body.html

Trova:

Codice: Seleziona tutto

<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> 

Sostituire con

Codice: Seleziona tutto

<!-- 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 --> 

Cancellare la Cache, lo stile e le cache del browser
Menu Forum ha scritto:

Rispondi

Torna a “Snippets”

Chi c’è in linea

Visitano il forum: Nessuno e 4 ospiti