Advertisement:

Navigation

SMF Mod Site

Mod Name:
ssi_boardNews Multiple Boards
Created By:
Daniel15
Type:
SSI
First Created:
April 08, 2007, 02:33:18 AM
Last Modified:
August 06, 2007, 02:49:03 AM
Latest Version:
1.0
Compatible With:
1.1.2, 1.1.3
Total Downloads:
31584

Download this mod

ssi_boardNews_1-0.zip (2kB) [31583]
Manual Install Instructions for SMF

Description:

ssi_boardNews Multiple Boards

This mod will modify ssi_boardNews so that multiple board IDs can be passed to it as an array. This allows you to get news from more than one board.

How to use?
Instead of calling ssi_boardNews with a single number, call it with an array. For example:
echo ssi_boardNews(array(1,2,3));
will output the latest news from boards 1, 2 and 3.

Additionally, if the first parameter of ssi_boardNews is left blank, it will try and use the "board" GET variable. Go to ssi_examples.com?board=1,2,3,4,5 for an example of this.

Advanced Use - Example script
Below is an example script, using the ssi_boardNews "array" output method. This allows you to format the output in whatever way you'd like to.
Code: [Select]
<?php
// Require SSI
require('SSI.php');

// Some variables. Change these to test this script :)
$boards = array(123); // 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$numbernull$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%" />'
;
}
?>


Changelog
Version 1.0
 - Initial release