Display forum posts
This tutorial will allow you to display a whole forum post.
<?php
require_once "sdk/ipbsdk_class.inc.php";
$SDK =& new IPBSDK();
$posts = $SDK->list_forum_topics ("2", array("limit" => "3", "start" => "0", "order" => "desc", "orderby" => "last_post"), "1");
foreach($posts as $i)
{
$i[start_date] = date("jS F Y", $i[start_date]);
?>
<div class='borderwrap'>
<div class='maintitle'><img src='images/nav_m.gif' border='0' alt='>' /> News: <? echo $i[title]; ?></div>
<table class='ipbtable' cellspacing="1">
<tr><td class="row2">
<div style="float: left;"><span class="postdetails"> <img src='images/to_post_off.gif' alt='post' border='0' style='padding-bottom:0px' /> <? echo $i[start_date]; ?></span> </div>
<div align="right"> <span class="postdetails">Posted by: <a href="<? echo $SDK->board_url ?>/index.php?showuser=<? echo $i[starter_id]; ?>"> <? echo $i[starter_name]; ?></a></span> </div></td></tr>
<tr><td class="post1" width="100%" valign="top"><div style="padding:5px;"><? echo $i[post]; ?><br /><div align="right"><b><font size="2px"><a href="<? echo $SDK->board_url ?>/index.php?showtopic=<? echo $i[tid]; ?>">Views News Topic</a></font></b></div></div></td></tr>
</table></div>
<br />
<?
}
?>
Note this is using list_forums_topics but it has been altered to display post infomation and date etc..
The above coding basically, pulls 3 topics, bypassing permissions from our announcements forum id 2.
Please note however the above coding does use our css and images stlying, editing may be neccassary for your own site. And you can edit the date() layout by going here.
Company News