<?php
/**
Template Name: xffrontpage
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<div id="mainstory">
<?php
$threadModel = XenForo_Model::create( 'XenForo_Model_Thread' );
$conditions = array();
$fetchOptions = array(
'join' => XenForo_Model_Thread::FETCH_FIRSTPOST,
'order' => 'post_date',
'orderDirection' => 'desc',
'limit' => 5);
$threads = $threadModel->getThreadsInForum( 2, $conditions, $fetchOptions ); // 2 is the node
foreach ( $threads AS $threadId => $thread ) {
if ( $threadModel->canViewThread( $thread, $thread ) ) {
$formatter = XenForo_BbCode_Formatter_Base::create();
$parser = new XenForo_BbCode_Parser($formatter);
$html = $parser->render($thread['message']);
echo $html .'<br /><br /><hr>';
}
}
?>
</div><!-- #mainstory -->
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>