Advertisement:

Author Topic: ssi_recentTopics  (Read 1552 times)

Offline exteeyou

  • Semi-Newbie
  • *
  • Posts: 48
ssi_recentTopics
« on: March 02, 2012, 07:14:31 PM »
I think I am posting this in the right area, forgive me if I didn't...

What's the difference between ssi_recentTopics and ssi_recentPosts? To me there is none.. I am using recentTopics in a PHP parse block, but it shows the latest topic with a new post, rather than whatever the latest topic really is regardless of the last post. In essence, someone could reply in a topic from 4 months ago, which makes it a "recent topic" on my front page again... Is there any way to work around this? Below is my block of code:

Code: [Select]
require("SSI.php");
$array = ssi_recentTopics($num_recent = 5, $exclude_boards = null, $include_boards = 6, $output_method = 'array');

foreach ($array as $news)
{
echo '
<table border="0" width="100%" align="center" class="ssi_table">
<tr>
<td><b>', $news['link'], '</b></td>
</tr>
<tr>
<td>By ', $news['poster']['link'], ' on ', $news['time'], '<br /><br /></td>
</tr>
</table>
<br />';

if (!$news['is_last'])
echo '
<hr width="100%" />
<br />';
}

This is for a "recent classifieds" block on my site, the forum it pulls the recent topics from is a For Sale section, hence why I only want true new topics being shown. I'd also like some help on having this show a thumbnail of any attachment of the first post in that topic being shown (this may be a bit hard and not my primary concern right now).
« Last Edit: March 02, 2012, 07:38:42 PM by exteeyou »

Offline Kays

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: ssi_recentTopics
« Reply #1 on: March 02, 2012, 09:23:10 PM »
Hi, recent topics will show the last topic in which there's a post. Recent posts will show all of the last posts. Slight difference. :)

If it's only the first post in a topic you're wanting to show. Have you looked at using ssi_boardNews?. Or a bit more flexible, look in the mod site for ssi_multiBoardNews. I thinks that's what it's called. It has a number of options including the ability (I think) to show an attachment.


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods