News Scripting for SMF 2.0/title>

# News Scripting for SMF 2.0

1. Setup the include statement on the page you wish your news to appear on according to the type of file you will be using (either PHP or SHTML.) This example will use PHP.
2. Start with the include to point to SSI.php in your root SMF directory.
   e.g. <?php include('http://www.simplemachines.org/community/SSI.php'); ?>
3. Add ?ssi_function=boardNews;board=n to the end of the URL above. Make sure you replace the n with the number of the board you want news to appear from.
   e.g. <?php echo file_get_contents('http://www.simplemachines.org/community/SSI.php?ssi_function=boardNews;board=9'); ?>

That is all you need to do to get your basic script running. You can add any of the following to the end of that, but make sure you put a semicolon (;) between each variable. These variables aren't needed, but provide better versatility.

limit=n
  Limits the amount of news items to show (the default is 5.)
length=n
  Limits the length of each post to n characters (the default is to impose no limit.)
start=n
  Starts the news items at a certain offset. (the default is 0)

e.g. <?php echo file_get_contents('http://www.simplemachines.org/community/SSI.php?ssi_function=boardNews;board=9;limit=7'); ?>
This shows an example of how one might change the limit on the news items.
Copyright ©2013 Simple Machines.