BoltZ Posted November 22, 2008 Share Posted November 22, 2008 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? Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted November 22, 2008 Share Posted November 22, 2008 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.) Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 22, 2008 Author Share Posted November 22, 2008 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. :/ Quote Link to comment Share on other sites More sharing options...
achaikos Posted November 22, 2008 Share Posted November 22, 2008 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. Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 22, 2008 Author Share Posted November 22, 2008 Ah thank you sir. A promising young lad I can tell you will be. Thanks alot. I'll post back if I get stuck ^^ Quote Link to comment Share on other sites More sharing options...
achaikos Posted November 22, 2008 Share Posted November 22, 2008 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. Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 22, 2008 Author Share Posted November 22, 2008 What bracket. you forgot a ; but anyway after some error debugging I got it to work. Thanks man Quote Link to comment Share on other sites More sharing options...
dmsameeram Posted November 5, 2011 Share Posted November 5, 2011 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, Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 5, 2011 Share Posted November 5, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.