Autor Tópico: Criar um tópico sobre o Relatório para Moderador  (Lida 7848 vezes)

0 Membros e 3 Visitantes estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5073
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Criar um tópico sobre o Relatório para Moderador
« em: 12 de Dezembro de 2010, 08:01 »
/Sources/SendTopic.php

Código: [Seleccione]
?>
Código: [Seleccione]
function rtm_board($subject, $posterName, $reporterName)
{
global $txt, $scripturl, $db_prefix, $topic, $board, $user_info, $ID_MEMBER, $modSettings, $sourcedir, $language;
loadLanguage('Post');
$subject = $txt['rtm3'] . ': ' . $subject . ' ' . $txt['rtm4'] . ' ' . $posterName;
$body = $posterName . ' ' . $txt['rtm_email2'] . ' ' . $reporterName . ' ' . $txt['rtm_email3'] . ":\n\n" .
$scripturl . '?topic=' . $topic . '.msg' . $_POST['msg'] . '#msg' . $_POST['msg'] . "\n\n" .
$txt['rtm_email_comment'] . ":\n" .
$_POST['comment'];
// prepare it for posting
$body = htmlspecialchars($body, ENT_QUOTES);
$subject = htmlspecialchars($subject);
$reporterName = $reporterName == '' ? 'anonReporter' : htmlspecialchars($reporterName);
$email = htmlspecialchars( $user_info['is_guest'] ? 'anonReporter': $user_info['email'] );
$subject = preg_replace('~&#(\d{4,5}|[3-9]\d{2,4}|2[6-9]\d);~', '&#$1;', $subject);
$msgOptions = array(
'id' => 0,
'subject' => $subject,
'body' => $body,
'icon' => 'xx',
'smileys_enabled' => 0,
'attachments' => array(),
);
$topicOptions = array(
'id' => 0,
'board' => $modSettings['rtm_board'],
'poll' => null,
'lock_mode' => null,
'sticky_mode' => null,
'mark_as_read' => false,
);
$posterOptions = array(
'id' => $ID_MEMBER,
'name' => $reporterName,
'email' => $email,
'update_post_count' => 0,
);
createPost($msgOptions, $topicOptions, $posterOptions);
if ( !empty($modSettings['rtm_override_email']) )
redirectexit('board=' . $board . '.0');
}


Código: [Seleccione]
$subject = un_htmlspecialchars($subject);
Código: [Seleccione]
if ( !empty($modSettings['rtm_board_enable']) && !empty($modSettings['rtm_board']) )
rtm_board($subject, $posterName, $reporterName);



/Sources/ManageBoards.php

Código: [Seleccione]
'recycle_board' => (int) $_POST['recycle_board'],
Código: [Seleccione]
'rtm_board_enable' => empty($_POST['rtm_board_enable']) ? '0' : '1',
'rtm_override_email' => empty($_POST['rtm_override_email']) ? '0' : '1',
'rtm_board' => (int) $_POST['rtm_board'],



/Themes/default/ManageBoards.template.php

Código: [Seleccione]
</tr><tr class="windowbg2">
<td align="right" colspan="2">
<input type="submit" name="save_settings" value="', $txt['mboards_settings_submit'], '" />

Código: [Seleccione]
</tr><tr class="windowbg2">
                                <th width="50%" align="right"><label for="rtm_board_enable_check">', $txt['rtm_board_enable'], '</label>:</th>
                                <td>
                                        <input type="checkbox" name="rtm_board_enable" id="rtm_board_enable_check"', empty($modSettings['rtm_board_enable']) ? '' : ' checked="checked"', ' class="check" onclick="document.getElementById(\'rtm_board_select\').disabled = !this.checked; document.getElementById(\'rtm_override_email_check\').disabled = !this.checked;" />
                                </td>
</tr><tr class="windowbg2">
                                <th width="50%" align="right"><label for="rtm_override_email_check">', $txt['rtm_override_email'], '</label>:</th>
                                <td>
                                        <input type="checkbox" name="rtm_override_email" id="rtm_override_email_check"', empty($modSettings['rtm_override_email']) ? '' : ' checked="checked"', ' class="check" />
                                </td>
                        </tr><tr class="windowbg2">
                                <th align="right">', $txt['rtm_board'], ':</th>
                                <td>
                                        <input type="hidden" name="rtm_board" value="', empty($modSettings['rtm_board']) ? '0' : $modSettings['rtm_board'], '" />
                                        <select name="rtm_board" id="rtm_board_select">
                                                <option></option>';
        foreach ($context['boards'] as $board)
                echo '
                                                <option value="', $board['id'], '"', isset($modSettings['rtm_board']) && $board['id']==$modSettings['rtm_board'] ? ' selected="selected"' : '', '>', $board['category']['name'], ' - ', $board['name'], '</option>';
        echo '
                                        </select>
                                        <script language="JavaScript" type="text/javascript"><!--
document.getElementById("rtm_board_select").disabled = !document.getElementById("rtm_board_enable_check").checked;
document.getElementById("rtm_override_email_check").disabled = !document.getElementById("rtm_board_enable_check").checked; // -->
</script>
</td>


/Themes/default/languages/Modifications.teuidioma.php

Código: [Seleccione]
?>
Código: [Seleccione]
$txt['rtm_board_enable'] = 'Criar um tópico quando um poste é reportado?';
$txt['rtm_override_email'] = 'Não envie e-mails sobre o relatório?';
$txt['rtm_board'] = 'Quadro para criar tópico em?';