Affix Posted January 21, 2013 Report Share Posted January 21, 2013 Heres a snippet I use to get the last 5 posts from phpBB to display in my side bar <?php require_once('/path/to/forum/config.php'); $link = mysql_connect($dbhost,$dbuser,$dbpasswd); mysql_select_db($dbname, $link); $result = mysql_query("SELECT * FROM `phpbb_posts` ORDER BY `post_id` DESC LIMIT 5", $link); while($r = mysql_fetch_array($result)) { echo "<a href=\"http://www.domain.tld/forum/viewtopic.php?p=" . $r['post_id'] . "\">" . $r['post_subject'] . "</a><br />"; } ?> Quote Link to comment Share on other sites More sharing options...
CPC900 Posted January 24, 2013 Report Share Posted January 24, 2013 Does anyone have a similiar thing for SMF? Quote Link to comment Share on other sites More sharing options...
Affix Posted January 24, 2013 Author Report Share Posted January 24, 2013 CPC900, You can modify the SQL Query to do SMF. If you post the SMF Post table schema here I would be happy to modify it for you. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 25, 2013 Administrators Report Share Posted January 25, 2013 SMF has a ready to go API that you can use to display posts among other things. There is a lot of good information here -> http://www.simplemachines.org/community/ssi_examples.php Quote Link to comment Share on other sites More sharing options...
Ariel Posted April 3, 2013 Report Share Posted April 3, 2013 actually with a few changes obviously it works...but...its pulling up the subjects of the post but when i click on a subject it takes me to the error page that says the post doesnt exists....what could be possibly wrong? Quote Link to comment Share on other sites More sharing options...
ahughes3 Posted June 25, 2013 Report Share Posted June 25, 2013 This is a great script and I've managed to get as far as Vanity above. But when I click on one of the post links it takes me to a page not found. I'm guessing its the last domain link in the script that I need to change, only I don't know what to. Any suggestions? Does this need to be a path relative to somewhere on my forum? Quote Link to comment Share on other sites More sharing options...
joeholden Posted June 29, 2013 Report Share Posted June 29, 2013 Is there a way were we can only display posts from a specific forum, E.G. if i wanted to use it to display NOTAMs, so i would have a specific forum/thread for NOTAMs? 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.