Location: PHPKode > projects > Simple Machines Forum > news_readme.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>News Scripting for SMF 2.0/title>
		<style type="text/css">
			body
			{
				background-color: white;
				color: black;
				font: small Verdana, sans-serif;
			}
			h1
			{
				font-size: 18pt;
				margin: 0;
			}
			li
			{
				padding-bottom: 2ex;
			}
		</style>
	</head>
	<body>
		<h1>News Scripting for SMF 2.0</h1>
		<ol>
			<li>
				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.
			</li>
			<li>
				Start with the include to point to SSI.php in your root SMF directory.<br />

				<em>e.g. &lt;?php include('<a href="http://www.simplemachines.org/community/SSI.php">http://www.simplemachines.org/community/SSI.php</a>'); ?&gt;</em>
			</li>
			<li>
				Add ?ssi_function=boardNews;board=<em>n</em> to the end of the URL above.  Make sure you replace the <em>n</em> with the number of the board you want news to appear from.<br />

				<em>e.g. &lt;?php echo file_get_contents('<a href="http://www.simplemachines.org/community/SSI.php?ssi_function=boardNews;board=9">http://www.simplemachines.org/community/SSI.php?ssi_function=boardNews;board=9</a>'); ?&gt;</em>
			</li>
		</ol>

		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 (<strong>;</strong>) between each variable.  These variables aren't needed, but provide better versatility.<br />

		<dl>
			<dt>limit=<em>n</em></dt>
			<dd>Limits the amount of news items to show (the default is <em>5</em>.)</dd>

			<dt>length=<em>n</em></dt>
			<dd>Limits the length of each post to <em>n</em> characters (the default is to impose no limit.)</dd>

			<dt>start=<em>n</em></dt>
			<dd>Starts the news items at a certain offset. (the default is <em>0</em>)</dd>
		</dl>

		<em>e.g. &lt;?php echo file_get_contents('<a href="http://www.simplemachines.org/community/SSI.php?ssi_function=boardNews;board=9;limit=7">http://www.simplemachines.org/community/SSI.php?ssi_function=boardNews;board=9;limit=7</a>'); ?&gt;</em><br />
		<br />
		This shows an example of how one might change the limit on the news items.
		<br /><br />
		Copyright &copy;2013 <a href="http://www.simplemachines.org/about/license.php" title="License" target="_blank">Simple Machines</a>.<br />
	</body>
</html>
Return current item: Simple Machines Forum