-
Notifications
You must be signed in to change notification settings - Fork 0
/
news_readme.html
60 lines (53 loc) · 2.45 KB
/
news_readme.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!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. <?php include('<a href="http://www.simplemachines.org/community/SSI.php">http://www.simplemachines.org/community/SSI.php</a>'); ?></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. <?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>'); ?></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. <?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>'); ?></em><br />
<br />
This shows an example of how one might change the limit on the news items.
<br /><br />
Copyright ©2013 <a href="http://www.simplemachines.org/about/license.php" title="License" target="_blank">Simple Machines</a>.<br />
</body>
</html>