Autor Tópico: Enhanced PM Warning Message  (Lida 4527 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Enhanced PM Warning Message
« em: 09 de Janeiro de 2011, 18:40 »
Link Original: http://custom.simplemachines.org/mods/index.php?mod=1604
Mod Name:   Enhanced PM Warning Message
Created By: Duncan85
Última versão: 1.0
Versão compatíveis: 1.1.7, 1.1.8, 2.0 Beta 4, 2.0 RC1
instalação Manual: Sim / / Candidosa2

./Sources/Load.php

Código: [Seleccione]
?>
Código: [Seleccione]
//Pm Warning...
function loadPmWarning()
{
   global $scripturl, $db_prefix, $context, $user_info, $smcFunc;

   //Gimme the newest pm, if we have.
   if(!empty($user_info['unread_messages'])) {
      $request = $smcFunc['db_query']('', '
         SELECT
            pm.id_pm, pm.id_member_from, pm.from_name, pm.msgtime, pm.subject, pm.body
         FROM {db_prefix}personal_messages AS pm
            LEFT JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm)
         WHERE pmr.is_new = 1 AND pmr.id_member = {int:current_member}
         ORDER BY pm.msgtime DESC
         LIMIT 1',
         array(
            'current_member' => $user_info['id'],
         )
      );
      $context['pm_informer'] = array();
      while ($row = $smcFunc['db_fetch_assoc']($request))
      {
         //You can't be so looongggg. He he. :)
         if ($smcFunc['strlen']($row['body']) > 250)
            $row['body'] = $smcFunc['substr']($row['body'], 0, 250) . '<a href="' . $scripturl . '?action=pm#msg' . $row['id_pm'] . '">...</a>';

         // Build the array.
         $context['pm_informer'] = array(
            'from' => $row['id_member_from'],
            'sender' => $row['from_name'],
            'msgtime' => timeformat($row['msgtime'], false),
            'subject' => $row['subject'],
            'body' => parse_bbc($row['body']),
         );
      }
      $smcFunc['db_free_result']($request);
   }
}


./index.php

Código: [Seleccione]
   // Check if the user should be disallowed access.
   is_not_banned();

Código: [Seleccione]
   // Check if the user should be disallowed access.
   is_not_banned();

./Themes/default/index.template.php

Código: [Seleccione]
      if (confirm("' . $txt['show_personal_messages'] . '"))
Código: [Seleccione]
      if (confirm("' . $txt['from'] . ' ' . $context['pm_informer']['sender'] . '\\n' . $txt['subject'] . ' ' . $context['pm_informer']['subject'] . '\\n' . $txt['show_personal_messages'] . '"))