I would like that only the last posts of specific forums to appear there.
I guess the code involved is the following:
Code: Select all
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="<?php echo $moduleclass_sfx; ?>content" align="center">
<tr>
<td>
<!-- begin topic content -->
<?
$link = ($component == 1) ? '' : '2';
$query="SELECT DISTINCT t.topic_id, t.topic_title, p.post_id, p.post_time, p.poster_id AS poster_id, u.name AS poster
FROM phpbb_topics t
LEFT JOIN phpbb_posts p ON p.post_id = t.topic_last_post_id
LEFT JOIN phpbb_forums f ON t.forum_id = f.forum_id
LEFT JOIN #__users u ON p.poster_id = u.id
WHERE f.auth_read <= $forum_access
ORDER BY post_time DESC LIMIT 0, $number";
//echo $query;
$database->setQuery($query);
$rows = $database->loadObjectList();
//check if there is result
if(count($rows) > 0){
for($i=0,$n=count($rows);$i<$n;$i++){
$row = &$rows[$i];
$topic_title = $row->topic_title;
if(strlen($topic_title) > $titlelenght){
$topic_title = substr($topic_title, 0, ($titlelenght - 2)) . "...";
}
$topic_id = $row->topic_id;
echo '<font class="cross">+</font> ';
echo '<a target="'.$linktarget.'" href="'.sefRelToAbs('index'.$link.'.php?option=com_forum&Itemid='.$menuitem.'&page=viewtopic&t=' . $row->topic_id . '#' . $row->post_id) . '" title="'.$row->topic_title.'">'.$topic_title."</a>";
if($display_time == 1){
if(!empty($title_time_separator)){
echo " " . $title_time_separator;
}
echo " " . strftime($time_format, $row->topic_time);
}
if($display_user == 1){
if(!empty($time_user_separator)){
echo " " . $time_user_separator;
}
echo ' <a target="'.$linktarget.'" href="'.sefRelToAbs('index'.$link.'.php?option=com_forum&Itemid='.$menuitem.'&page=profile&mode=viewprofile&u=' . $row->poster_id) . '" title="'.$row->poster.'">'.$row->poster."</a>";
}
echo "<br />\n";
}
}
else {
echo '<font class="cross">+</font> <a target="'.$linktarget.'" href="'.sefRelToAbs('index'.$link.'.php?option=com_forum&Itemid='.$menuitem).'">No topics found</a><br>';
}
?>
</tr>
</table>
Thank you