예제 #1
0
<?php

include_once 'includes/news.php';
// Prepare newsitems
$news = get_news();
// Prepare community headlines
$cnews = get_community_news();
// Prepare forum posts
$news_forum = get_forum_posts();
// Compose the frontpage
$fptemplate = file_get_contents('templates/news.html');
$fpkeys = array('#NEWSITEMS#', '#CNEWSITEMS#', '#FORUMPOSTS#');
$fpitems = array($news, $cnews, $news_forum);
$fp = str_replace($fpkeys, $fpitems, $fptemplate);
// Compose the final page
$headertemplate = file_get_contents('templates/header.html');
$starttemplate = file_get_contents('templates/pagestart.html');
$html = $starttemplate;
//$html .= str_replace('{PAGE_TITLE}', '<img src="/images/homie.gif" width="11" height="10" border="0"/>&nbsp;Home', $headertemplate);
$html .= $fp;
//$html .= file_get_contents('templates/footer.html');
$html .= file_get_contents('templates/pageend.html');
print $html;
function forum_posts($forum_id = 0)
{
    echo apply_filters('forum_posts', get_forum_posts($forum_id), $forum_id);
}
예제 #3
0
<script type="text/javascript">
	/*var url = "<?php 
bloginfo('stylesheet_directory');
?>
/data/forum.json";*/
	var postPerPage=<?php 
echo get_option('forumPostPerPage');
?>
;
	/*$(document).ready(function(){
		app.forum.populate(url);
		});*/
</script>

<?php 
$forum_posts = get_forum_posts();
$forum_items = $forum_posts->channel->item;
$nr_of_forum_posts = count($forum_items);
$postPerPage = get_option('forumPostPerPage');
?>
<article class="forumPosts">
	<div class="container">
		<h2>
			Recent Forum Posts <small>(<?php 
echo $nr_of_forum_posts;
?>
 posts)</small>
		</h2>
		<div class="forumList">
			<?php 
for ($i = 0; $i < $nr_of_forum_posts / 5; $i++) {