Additional Info |
---|
Type
|
Package ID
Daniel15:SSINewsMultiBoards
|
First Created
April 08, 2007, 02:33:18 AM
|
Last Updated
August 06, 2007, 02:49:03 AM
|
<?php
// Require SSI
require('SSI.php');
// Some variables. Change these to test this script :)
$boards = array(1, 2, 3); // Boards to use
$number = 10; // Number of items to return
$length = 300; // Return this number of characters, followed by "...".
// Get the news
$news_items = ssi_boardNews($boards, $number, null, $length, 'array'); // array(boards), number of items, item to start at, number of characters, output method
// Loop through all items
foreach ($news_items as $news)
{
// Output this item
echo '
<div>
<a href="', $news['href'], '">', $news['icon'], '</a> <b>', $news['subject'], '</b>
<div class="smaller">', $news['time'], ' by ', $news['poster']['link'], ' in ', $news['board']['link'], '</div>
<div class="post" style="padding: 2ex 0;">', $news['body'], '</div>
', $news['link'], $news['locked'] ? '' : ' | ' . $news['comment_link'], '
</div>';
// If it isn't the last item, output a <hr />
if (!$news['is_last'])
echo '
<hr style="margin: 2ex 0;" width="100%" />';
}
?>