Um bom mod para aqueles que estão se perguntando quais membros lêem seus tópicos.
/Sources/Display.php
Pesquisar
// What are you gonna display if these are empty?!
if (empty($topic))
fatal_lang_error('no_board', false);
Alterar
// What are you gonna display if these are empty?!
if (empty($topic))
fatal_lang_error('no_board', false);
if(!empty($_REQUEST['sa']) && $_REQUEST['sa'] == 'log') {
DisplayLog();
}
Pesquisar
?>
[/color]
Adicionar
function DisplayLog()
{
global $context, $scripturl, $topic, $smcFunc;
$request = $smcFunc['db_query']('', "
SELECT
lt.ID_MEMBER, lt.id_topic, mem.real_name
FROM {db_prefix}log_topics AS lt
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = lt.id_member)
WHERE id_topic = {int:topic}",
array(
'topic' => $topic,
)
);
while ($row = $smcFunc['db_fetch_assoc']($request))
{
// Build the array.
$context['logs'][] = array(
'member' => array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
),
);
}
$smcFunc['db_free_result']($request);
$context['sub_template'] = 'displaylog';
}
?>
/Themes/default/Display.template.php
Pesquisar
?>
Adicionar
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>Quem leu o tópico</td>
</tr>';
foreach($context['logs'] as $log) {
echo '
<tr class="windowbg">
<td>', $log['member']['link'], '</td>
</tr>';
}
echo '
</table>';
}
?>
Pesquisar
<h3 class="catbg">
<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
<span id="author">', $txt['author'], '</span>
', $txt['topic'], ': ', $context['subject'], ' (', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')
</h3>
Alterar
<h3 class="catbg">
<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
<span id="author">', $txt['author'], '</span>
', $txt['topic'], ': ', $context['subject'], ' (', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')<a style="float: right;" href="' . $scripturl . '?topic='. $context['current_topic'] . '.0;sa=log">Konuyu Okumuş Olanlar</a>
</h3>