Jump to content

  • twitter
  • youtube
  • googleplus
  • facebook
  • rss
  • newsletter


Tutorial info Visit support topic

  • Added on: Jan 08 2009 06:16 PM
  • Date Updated: Mar 10 2010 08:13 PM
  • Views: 3362
 


[IPBSDK] Display forum posts

This tutorial will allow you to display a whole forum post.

Posted by Michael on Jan 08 2009 06:16 PM
This tutorial will allow you to display a whole forum post, with your latest forum news. Using inbuilt IPBSDK functions.

<?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='&gt;' />&nbsp;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 information 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 styling, editing may be necessary for your own site. And you can edit the date() layout by going here.

Powered by Tutorials 1.4.1 © 2012, by Michael McCune