Jump to content

Display SMF latest posts


BoltZ

Recommended Posts

hey I am not usually in this php forum, I am usually around html/css but a task arose and I figure since this forum uses smf it would be a perfect place to ask. Not saying you are all smf experts though.

 

My question is how do I display the latest posts for smf in a page thats not a forum page. Like  On my index page I want to display the latest posts on the forum. Help anyone?

Link to comment
https://forums.phpfreaks.com/topic/133729-display-smf-latest-posts/
Share on other sites

I'm sure scripts out there exist that do just what you describe, but it would also be fairly trivial to write if you do not want a lot of fancy features. It's just an issue of selecting from the posts ordered descending and limit however many you want. (I don't know anything about SMF so I'm just speculating, but I couldn't see it being any more difficult than this.)

The problem is those scripts write it directly into the page of the forum. I want it to display on a non forum section of the site. I don't know the mysql code for displaying the last 5 posts of table posts or whatever in chronological order. :/

For recent posts, do something along the lines of:

 

<?php
require("yourdomain/yourforum/ssi.php")
ssi_recentposts();
?>

 

Go into your SMF folder and look for a file called ssi_examples.shtml to see some examples of what SSI can do.

 

I missed the brackets off the end of ssi_recentposts();

 

Hope it works for you.

  • 2 years later...

What bracket. you forgot a ; but anyway after some error debugging I got it to work. Thanks man

 

hay How did u got it done. can you post the correct code for this,

 

Perhaps you didn't notice, but this thread is 3 years old. You should probably start  a new thread with your question.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.