Comunque come hai fatto precedentemente, ecco il codice php e del template da usare.
Codice: Seleziona tutto
// INIZIO - Topic più Visto -- by carlino1994
$sql_topicvisto2 = "SELECT topic_id, forum_id, topic_title FROM ".TOPICS_TABLE." ORDER BY topic_time DESC LIMIT 0,5";
$risultato_topicvisto2 = $db->sql_query($sql_topicvisto2);
while ($row_topicvisto = $db->sql_fetchrow($risultato_topicvisto2))
{
if ($auth->acl_get('f_read', $row_topicvisto['forum_id']) == 1) {
$template->assign_block_vars('topicvisto2', array(
'TOPICVISTO_ID' => $row_topicvisto['topic_id'],
'TOPICVISTO_FID' => $row_topicvisto['forum_id'],
'TOPICVISTO_TITOLO' => $row_topicvisto['topic_title'])
);
}
}
$db->sql_freeresult($risultato_topicvisto2);
// FINE
Codice: Seleziona tutto
<!-- IF .topicvisto2 -->
<h3>Topic più visti</h3>
<p><!-- BEGIN topicvisto2 -->• <a href="./viewtopic.php?f={topicvisto2.TOPICVISTO_FID}&t={topicvisto2.TOPICVISTO_ID}">{topicvisto2.TOPICVISTO_TITOLO}</a><br /><!-- END topicvisto2 --></p>
<!-- ENDIF -->