Autor Tópico: Who Viewed The Topic  (Lida 3015 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
Who Viewed The Topic
« em: 21 de Dezembro de 2008, 12:16 »
../Sources/Display.php

Pesquisar
Código: [Seleccione]
fatal_lang_error('smf232', false);
Trocar por:
Código: [Seleccione]
   fatal_lang_error('smf232', false);

   if(!empty($_REQUEST['sa']) && $_REQUEST['sa'] == 'log') {
      DisplayLog();
   }

Pesquisar
Código: [Seleccione]
?>
Adicionar
Código: [Seleccione]
function DisplayLog()
{
   global $context, $scripturl, $db_prefix, $topic;

   isAllowedTo('moderate_forum');

   $request = db_query("
      SELECT
         lt.ID_MEMBER, lt.ID_TOPIC, mem.realName
      FROM {$db_prefix}log_topics AS lt
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lt.ID_MEMBER)
      WHERE ID_TOPIC = $topic", __FILE__, __LINE__);
   while ($row = mysql_fetch_assoc($request))
   {
      // Build the array.
      $context['logs'][] = array(
         'member' => array(
            'id' => $row['ID_MEMBER'],
            'name' => $row['realName'],
            'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
            'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
         ),
      );
   }
   mysql_free_result($request);

   $context['sub_template'] = 'displaylog';
}

?>

../Themes/default/Display.template.php

Pesquisar
Código: [Seleccione]
?>
Adicionar
Código: [Seleccione]
function template_displaylog()
{
   global $context, $settings, $options, $txt, $scripturl, $modSettings;
   
   echo '
   <table border="0" cellpadding="0" cellspacing="0" style="padding-top: 1ex;" align="center">
      <tr class="titlebg">
         <td>Who Viewed The Topic</td>
      </tr>';

   foreach($context['logs'] as $log) {
      echo '
      <tr class="windowbg">
         <td>', $log['member']['link'], '</td>
      </tr>';
   }
   
   echo '
   </table>';
}

?>


Pesquisar
Código: [Seleccione]
<div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>
Alterar por
Código: [Seleccione]
    <div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>';
      if($context['can_moderate_forum'])
         echo '
         <a href="' . $scripturl . '?topic='. $context['current_topic'] . '.0;sa=log">View Topic Log</a>';
      echo '