Current Version:
This file is used to demonstrate the capabilities of SSI.php using PHP include functions. The examples show the include tag, then the results of it.
To use SSI.php in your page add at the very top of your page before the <html> tag on line 1 of your php file:
<?php require("is_admin ? realpath(SMF\Config::$boarddir . '/SSI.php') : 'SSI.php'); ?>"); ?>
All the functions have an output method parameter. This can either be "echo" (the default) or "array"
If it is "echo", the function will act normally - otherwise, it will return an array containing information about the requested task. For example, it might return a list of topics for ssi_recentTopics.
This functionality can be used to allow you to present the information in any way you wish.
Need more information on using SSI.php? Check out Using SSI.php article.
<?php SMF\ServerSideIncludes::recentTopics(); ?>
<?php SMF\ServerSideIncludes::recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo'); ?>
<?php SMF\ServerSideIncludes::recentPosts(); ?>
<?php SMF\ServerSideIncludes::recentPoll(); ?>
Shows top boards by the number of posts.
<?php SMF\ServerSideIncludes::topBoards(); ?>
Shows top topics by the number of replies or views.
<?php SMF\ServerSideIncludes::topTopicsViews(); ?>
<?php SMF\ServerSideIncludes::topTopicsReplies(); ?>
Shows the most-voted-in poll.
<?php SMF\ServerSideIncludes::topPoll(); ?>
<?php SMF\ServerSideIncludes::topPoster(); ?>
Shows the latest member's name and profile link.
<?php SMF\ServerSideIncludes::latestMember(); ?>
Shows one random member of the day. This changes once a day.
<?php SMF\ServerSideIncludes::randomMember('day'); ?>
This function shows who are online inside the forum.
<?php SMF\ServerSideIncludes::whosOnline(); ?>
This function logs the SSI page's visitor, then shows the Who's Online list. In other words, this function shows who are online inside and outside the forum.
<?php SMF\ServerSideIncludes::logOnline(); ?>
Shows a login box only when user is not logged in.
<?php SMF\ServerSideIncludes::login(); ?>
Shows a logout link only when user is logged in.
<?php SMF\ServerSideIncludes::logout(); ?>
Greets users or guests, also shows user's messages if logged in.
<?php SMF\ServerSideIncludes::welcome(); ?>
<?php SMF\ServerSideIncludes::todaysCalendar(); ?>
<?php SMF\ServerSideIncludes::todaysBirthdays(); ?>
<?php SMF\ServerSideIncludes::todaysHolidays(); ?>
<?php SMF\ServerSideIncludes::todaysEvents(); ?>
<?php SMF\ServerSideIncludes::recentEvents(); ?>
Shows some basic forum stats: total members, posts, topics, boards, etc.
<?php SMF\ServerSideIncludes::boardStats(); ?>
Shows random forum news.
<?php SMF\ServerSideIncludes::news(); ?>
Shows the latest posts from read only boards, or a specific board.
<?php SMF\ServerSideIncludes::boardNews(); ?>
<?php SMF\ServerSideIncludes::quickSearch(); ?>
<?php SMF\ServerSideIncludes::recentAttachments(); ?>
Shows a poll in the specified topic.
<?php SMF\ServerSideIncludes::showPoll($topicID); ?>
Fetches a post with a particular IDs. By default will only show if you have permission to the see the board in question. This can be overridden by passing the 2nd parameter as true.
<?php SMF\ServerSideIncludes::fetchPosts($postIDs, $isOverride); ?>
Shows the specified member's name and profile link.
<?php SMF\ServerSideIncludes::fetchMember($memberIDs); ?>
Shows all members in a specified group.
<?php SMF\ServerSideIncludes::fetchGroupMembers($groupIDs); ?>