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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.