Customizing SMF > SMF Coding Discussion

ssi_recentTopics

(1/1)

exteeyou:
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: ---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 />';
}

--- End code ---

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).

Kays:
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.

Navigation

[0] Message Index

Go to full version