creato file mod_lastpost_32.php con questo contenuto:
Codice: Seleziona tutto
<?php
// MOD Topten Topics : Topics più recenti, Topics più visti e Posts più recenti
// created by Micogian (Bingo)
if (!defined('IN_PHPBB'))
{
exit;
}
// configurazione: numero dei recods da visualizzare nella Lista
$list_rec_32 = 10 ; // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
$list_view_32 = 5 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
//---------- 10 Ultimi posts start -----------//
$sql = "SELECT tt.topic_id, tt.forum_id, tt.topic_moved_id, tt.topic_last_post_id, tt.topic_last_poster_id, tt.topic_last_poster_name, tt.topic_last_poster_colour,
tt.topic_last_post_subject, tt.topic_last_post_time, tt.topic_replies, tt.topic_views, tt.topic_poster, tt.topic_first_poster_name, tt.topic_first_poster_colour,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = 32
AND tt.topic_type = 0
AND tt.topic_moved_id = 0
AND tt.forum_id = ft.forum_id
ORDER BY tt.topic_last_post_time DESC LIMIT 0,$list_rec_32";
$result = $db->sql_query($sql);
$n = 0;
while ($row = $db->sql_fetchrow($result))
{
if ($auth->acl_get('f_read', $row['forum_id']) == 1)
{
if ($n < $list_view_32)
{
// accorcia il titolo se troppo lungo
$post_subject = str_replace("Re: ", "", $row['topic_last_post_subject']) ;
if (strlen($post_subject) > 60)
{
$post_title = substr($post_subject,0,57) . "...";
}else{
$post_title = $post_subject ;
}
// accorcia il nome del Forum se troppo lungo
$forum_title = $row['forum_name'];
if (strlen($forum_title) > 28)
{
$forum_name_short = substr($forum_title,0,25) . "...";
}else{
$forum_name_short = $forum_title ;
}
$last_post_link[$n] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row['forum_id'] . "&t=" . $row['topic_id'] . "&p=" . $row['topic_last_post_id'] . "#p" . $row['topic_last_post_id']);
$last_post_title[$n] = $row['topic_last_post_subject'];
$last_post_title_short[$n] = $post_title;
$last_post_forum_id[$n] = $row['forum_id'];
$last_post_forum_name[$n] = $row['forum_name'];
$last_post_forum_name_short[$n] = $forum_name_short ;
$last_post_last_poster_full[$n] = get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']);
$last_post_replies[$n] = $row['topic_replies'];
$last_post_views[$n] = $row['topic_views'];
$last_post_time[$n] = $user->format_date($row['topic_last_post_time']);
//echo $last_post_title_short[$n] . "<br />";
++$n ;
}else{
break ;
}
}
}
//---------- 10 Ultimi posts end -----------//
// Crea l'array "lastpost_list" che contiene le Variabili per il Template
for ($x = 0; $x < $list_view_32; ++$x)
{
$template->assign_block_vars('lastpost_32',array(
'LAST_POST_LINK' => $last_post_link[$x],
'LAST_POST_TITLE' => $last_post_title[$x],
'LAST_POST_TITLE_SHORT' => $last_post_title_short[$x],
'LAST_POST_FORUM_ID' => $last_post_forum_id[$x],
'LAST_POST_FORUM_NAME' => $last_post_forum_name[$x],
'LAST_POST_FORUM_NAME_SHORT' => $last_post_forum_name_short[$x],
'LAST_POST_LAST_POSTER_FULL' => $last_post_last_poster_full[$x],
'LAST_POST_REPLIES' => $last_post_replies[$x],
'LAST_POST_VIEWS' => $last_post_views[$x],
'LAST_POST_TIME' => $last_post_time[$x],
));
}
?>include($phpbb_root_path . 'mod_lastpost_32.' . $phpEx);
Ho creato il file mod_lastpost32_body.html con il seguente contenuto
Codice: Seleziona tutto
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl>
<dt style="text-align: left; width: 38%;"> Ultimi Posts</dt>
<dd style="text-align: left; width: 14%;"> Nome del Forum</dd>
<dd style="text-align: center; width: 7%;"> {L_REPLIES}</dd>
<dd style="text-align: center; width: 7%;"> {L_VIEWS}</dd>
<dd style="text-align: left; width: 13%;"> Ultimo Messaggio</dd>
<dd style="text-align: left;"> Data</dd>
</dl>
</li>
</ul>
<!-- BEGIN lastpost_32 -->
<ul class="topiclist forums">
<li>
<dl>
<dt style="text-align: left; width: 38%;"><a href="{lastpost_list.LAST_POST_LINK}"><b>{lastpost_list.LAST_POST_TITLE_SHORT}</b></a></dt>
<dd style="text-align: left; width: 14%;"><a href="viewforum.php?f={lastpost_list.LAST_POST_FORUM_ID}">{lastpost_list.LAST_POST_FORUM_NAME_SHORT}</a></dd>
<dd style="text-align: center; width: 7%">{lastpost_list.LAST_POST_REPLIES}</dd>
<dd style="text-align: center; width: 7%;">{lastpost_list.LAST_POST_VIEWS}</dd>
<dd style="text-align: left; width: 13%;">{lastpost_list.LAST_POST_LAST_POSTER_FULL}</dd>
<dd style="text-align: left;">{lastpost_list.LAST_POST_TIME}</dd>
</dl>
</li>
</ul>
<!-- END lastpost_32 -->
<span class="corners-bottom"><span></span></span>
</div>
</div>ho messo <!-- INCLUDE mod_lastpost32_body.html --> nell'overall header dove volevo far apparire la tabella.
La tabella appare ma e' senza contenuto

