display recent threads/posts on another page/site

Started by reves, August 30, 2008, 08:49:49 AM

Previous topic - Next topic

reves

Hi guys. Is there any way possible that would allow me to show on the front page of my site, an RSS feed style display of what currently active threads are going on in my forum? I know that smf outputs an rss feed, but every parser I've tried spits it out as invalid xml or something...
I know that this feature is possible with various forum scripts out there as I've seen it before, but would love to achieve this?
Any help or suggestions would be greatly appreciated.

thank you in advance! :)

Nathaniel

You can use the SSI.php functions to show information about your forum on another page in your website.

Have a read of the SSI.php documentation:
SSI Readme
How do I integrate SMF into my PHP coded website?

You will want the 'ssi_recenttopics()' or 'ssi_recentPosts()' functions. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

reves

this is exactly what I was after. thank you very much for your quick reply!

reves

does anybody know how to alter the font properties of what SSI outputs to my external pages?

Nathaniel

You can completely customize the output of a 'SSI.php' function by passing the last option variable which will tell SMF to return the data to you instead of actually showing it. Below is an example for the 'ssi_recentTopics()' function. Please note that I took all of the 'echo' code from the ssi function, you can repeat this process for every function, to get a similar output, but then customize it how you want to. ;)

require("SSI.php");
$posts = ssi_recentTopics(8, null, '');
echo '
<table border="0" class="ssi_table" style="font-size:20px;">';
foreach ($posts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Advertisement: