-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssi_examples.php~
190 lines (128 loc) · 5.37 KB
/
ssi_examples.php~
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
require(dirname(__FILE__) . '/SSI.php');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> << :: SMF SSI.php 1.1 :: >> </title><?php
echo '
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/style.css" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<style type="text/css">
body
{
margin: 1ex;
}';
if ($context['browser']['needs_size_fix'])
echo '
@import(', $settings['default_theme_url'], '/fonts-compat.css);';
echo '
</style>';
?>
</head>
<body>
<h1>SMF SSI.php Functions</h1>
Current Version: 1.1<br />
<br />
This file is used to demonstrate the capabilities of SSI.php using PHP include functions.<br />
The examples show the include tag, then the results of it. Examples are separated by horizontal rules.<br />
<hr />
<br />
To use SSI.php in your page add at the very top of your page before the <html> tag on line 1:<br />
<div style="font-family: monospace;">
<?php require("<?php echo addslashes($user_info['is_admin'] ? realpath($boarddir . '/SSI.php') : 'SSI.php'); ?>"); ?>
</div>
<br />
<hr />
<h3>Recent Topics Function: <?php ssi_recentTopics(); ?></h3>
<?php ssi_recentTopics(); flush(); ?>
<hr />
<h3>Recent Posts Function: <?php ssi_recentPosts(); ?></h3>
<?php ssi_recentPosts(); flush(); ?>
<hr />
<h3>Recent Poll Function: <?php ssi_recentPoll(); ?></h3>
<?php ssi_recentPoll(); flush(); ?>
<hr />
<h3>Top Boards Function: <?php ssi_topBoards(); ?></h3>
<?php ssi_topBoards(); flush(); ?>
<hr />
<h3>Top Topics by View Function: <?php ssi_topTopicsViews(); ?></h3>
<?php ssi_topTopicsViews(); flush(); ?>
<hr />
<h3>Top Topics by Replies Function: <?php ssi_topTopicsReplies(); ?></h3>
<?php ssi_topTopicsReplies(); flush(); ?>
<hr />
<h3>Top Poll Function: <?php ssi_topPoll(); ?></h3>
<?php ssi_topPoll(); flush(); ?>
<hr />
<h3>Top Poster Function: <?php ssi_topPoster(); ?></h3>
<?php ssi_topPoster(); flush(); ?>
<hr />
<h3>Topic's Poll Function: <?php ssi_showPoll($topic); ?></h3>
<?php ssi_showPoll(); flush(); ?>
<hr />
<h3>Latest Member Function: <?php ssi_latestMember(); ?></h3>
<?php ssi_latestMember(); flush(); ?>
<hr />
<h3>Board Stats: <?php ssi_boardStats(); ?></h3>
<?php ssi_boardStats(); flush(); ?>
<hr />
<h3>Who's Online Function: <?php ssi_whosOnline(); ?></h3>
<?php ssi_whosOnline(); flush(); ?>
<hr />
<h3>Log Online Presence + Who's Online Function: <?php ssi_logOnline(); ?></h3>
<?php ssi_logOnline(); flush(); ?>
<hr />
<h3>Welcome Function: <?php ssi_welcome(); ?></h3>
<?php ssi_welcome(); flush(); ?>
<hr />
<h3>News Function: <?php ssi_news(); ?></h3>
<?php ssi_news(); flush(); ?>
<hr />
<h3>Board News Function: <?php ssi_boardNews(); ?></h3>
<?php ssi_boardNews(); flush(); ?>
<hr />
<h3>Menubar Function: <?php ssi_menubar(); ?></h3>
<?php ssi_menubar(); flush(); ?>
<hr />
<h3>Quick Search Function: <?php ssi_quickSearch(); ?></h3>
<?php ssi_quickSearch(); flush(); ?>
<hr />
<h3>Login Function: <?php ssi_login(); ?></h3>
<?php ssi_login(); flush(); ?>
<hr />
<h3>Log Out Function: <?php ssi_logout(); ?></h3>
<?php ssi_logout(); flush(); ?>
<hr />
<h3>Today's Birthdays Function: <?php ssi_todaysBirthdays(); ?></h3>
<?php ssi_todaysBirthdays(); flush(); ?>
<hr />
<h3>Today's Holidays Function: <?php ssi_todaysHolidays(); ?></h3>
<?php ssi_todaysHolidays(); flush(); ?>
<hr />
<h3>Today's Events Function: <?php ssi_todaysEvents(); ?></h3>
<?php ssi_todaysEvents(); flush(); ?>
<hr />
<h3>Today's Calendar Function: <?php ssi_todaysCalendar(); ?></h3>
<?php ssi_todaysCalendar(); flush(); ?>
<hr />
<h3>Recent Calendar Events Function: <?php ssi_recentEvents(); ?></h3>
<?php ssi_recentEvents(); flush(); ?>
<hr />
<h3>Some notes on usage</h3>
All the functions have an output method parameter. This can either be "echo" (the default) or "array".<br />
If it is "echo", the function will act normally - otherwise, it will return an array containing information about the requested task.<br />
For example, it might return a list of topics for ssi_recentTopics.<br />
<br />
<span onclick="if (getInnerHTML(this).indexOf('Bird') == -1) setInnerHTML(this, getInnerHTML(this) + '<br /><img src="http://www.simplemachines.org/images/chocobo.jpg" title="Bird-san" alt="Chocobo!" />'); return false;">This functionality can be used to allow you to present the information in any way you wish.</span>
<hr />
<br />
<br />
<span style="color: #CCCCCC; font-size: smaller;">
<?php
echo 'This page took ', round(array_sum(explode(' ', microtime())) - array_sum(explode(' ', $time_start)), 4), ' seconds to load.<br />';
?>
*ssi_examples.php last modified on <?php echo date('m/j/y', filemtime(__FILE__)); ?>
</span>
</body>
</html>