SMF SSI.php Functions
Current Version: 2.1.5
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.
Include Code
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("SSI.php"); ?>
Some notes on usage
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.
Additional Guides & FAQ
Need more information on using SSI.php? Check out Using SSI.php article.
Recent Topics Function
Code (simple mode)
<?php ssi_recentTopics(); ?>
Code (advanced mode)
<?php ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo'); ?>
Result
[Modifications and Packages] | Download System by vbgamer45 | Today at 08:41:33 PM |
[Theme Site Themes] | Elementary by TwitchisMental | Today at 07:34:26 PM |
[SMF 2.0.x Support] | IP address by kim_c | Today at 06:29:51 PM |
[SMF 2.1.x Support] | Cron error by Sir Osis of Liver | Today at 05:10:19 PM |
[SMF 2.1.x Support] | Error 'WIRELESS_PROTOCOL_boardindex'. by Kindred | Today at 11:05:31 AM |
[SMF 2.1.x Support] | https in registration mail, http in notification mail -- Why? by Wolpo | Today at 04:20:33 AM |
[SMF 2.1.x Support] | Login forever by Sir Osis of Liver | Yesterday at 09:22:14 PM |
[SMF 2.1.x Support] | "You were unable to login. Please check your cookie settings." by Wolpo | Yesterday at 06:52:57 PM |
Recent Posts Function
Code
<?php ssi_recentPosts(); ?>
Result
[Modifications and Packages] | Re: Download System by vbgamer45 | Today at 08:41:33 PM |
[Theme Site Themes] | Re: Elementary by TwitchisMental | Today at 07:34:26 PM |
[SMF 2.0.x Support] | Re: IP address by kim_c | Today at 06:29:51 PM |
[SMF 2.0.x Support] | Re: IP address by dodos26 | Today at 05:33:16 PM |
[SMF 2.1.x Support] | Re: Cron error by Sir Osis of Liver | Today at 05:10:19 PM |
[SMF 2.0.x Support] | Re: IP address by kim_c | Today at 12:05:43 PM |
[SMF 2.0.x Support] | Re: IP address by Doug Heffernan | Today at 11:24:26 AM |
[Modifications and Packages] | Re: Download System by Peteracs | Today at 11:18:50 AM |
Top Boards Function
Shows top boards by the number of posts.
Code
<?php ssi_topBoards(); ?>
Result
Board | Topics | Posts |
---|---|---|
SMF Online Manual | 0 | 5,893,236 |
Srpski (Serbian) | 0 | 2,959,230 |
Bosanski (Bosnian) | 0 | 2,955,565 |
Hrvatski (Croatian) | 0 | 2,932,376 |
Bugtracker (Github) | 0 | 2,869,357 |
SMF 1.1.x Support New | 82,894 | 521,019 |
SMF 2.0.x Support New | 50,048 | 376,196 |
Modifications and Packages New | 2,792 | 348,156 |
Arşiv New | 31,575 | 228,763 |
Español (Spanish) New | 29,779 | 177,754 |
Top Topics
Shows top topics by the number of replies or views.
Code (show by number of views)
<?php ssi_topTopicsViews(); ?>
Result
Views | Replies | |
---|---|---|
Simple Machines Forum Conference Survey | 3,732,133 | 52 |
PHP security warning | 3,677,351 | 21 |
倡议:成立SMF简体中文翻译团队 | 3,334,170 | 30 |
SMF 1.0 Beta 1 Released! | 3,025,107 | 152 |
SMF 2.0.3, 1.1.17 and 1.0.23 security patches released | 2,947,091 | 181 |
End of life of SMF 1.0 | 2,895,138 | 59 |
General support topic for Aeva Media (Latest release: July 28, 2010) | 2,865,071 | 7,172 |
SMF Big Boards | 2,811,549 | 45 |
Pretty URLs | 2,593,195 | 8,413 |
SMF 2.0.1 and 1.1.15 critical security patches released | 2,567,682 | 175 |
Code (show by number of replies)
<?php ssi_topTopicsReplies(); ?>
Result
Views | Replies | |
---|---|---|
AjaxChat Integration (latest version 3.2.1) | 2,552,880 | 9,111 |
Pretty URLs | 2,593,195 | 8,413 |
Ad Management mod | 2,105,934 | 8,099 |
General support topic for Aeva Media (Latest release: July 28, 2010) | 2,865,071 | 7,172 |
Off Topic - Svaštara | 1,562,574 | 6,620 |
nneonneo's Shoutbox | 2,550,829 | 6,121 |
SimplePortal | 1,735,674 | 5,746 |
SMF Media Gallery (SMG) - 2.0.5 is out! (December 2) | 1,425,567 | 5,532 |
SMF Arcade | 1,841,060 | 5,235 |
Aeva 6.9.99 and earlier (old) | 295,118 | 5,030 |
Top Poster Function
Shows the top poster's name and profile link.Code
<?php ssi_topPoster(); ?>
Result
Latest Member Function
Shows the latest member's name and profile link.
Code
<?php ssi_latestMember(); ?>
Result
Member of the Day
Shows one random member of the day. This changes once a day.
Code
<?php ssi_randomMember('day'); ?>
Result
Who's Online Function
This function shows who are online inside the forum.
Code
<?php ssi_whosOnline(); ?>
Result
Log Online Presence
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.
Code
<?php ssi_logOnline(); ?>
Result
Login Function
Shows a login box only when user is not logged in.
Code
<?php ssi_login(); ?>
Result
Logout Function
Shows a logout link only when user is logged in.
Code
<?php ssi_logout(); ?>
Result
Welcome Function
Greets users or guests, also shows user's messages if logged in.
Code
<?php ssi_welcome(); ?>
Result
Today's Calendar Function
Code
<?php ssi_todaysCalendar(); ?>
Result
Today's Birthdays Function
Code
<?php ssi_todaysBirthdays(); ?>
Result
Today's Holidays Function
Code
<?php ssi_todaysHolidays(); ?>
Result
Today's Events Function
Code
<?php ssi_todaysEvents(); ?>
Result
Forum Stats
Shows some basic forum stats: total members, posts, topics, boards, etc.
Code
<?php ssi_boardStats(); ?>
Result
Total Posts: 3,940,538
Total Topics: 466,968
Total Categories: 13
Total Boards: 223
News Function
Shows random forum news.
Code
<?php ssi_news(); ?>
Result
Board News Function
Shows the latest posts from read only boards, or a specific board.
Code
<?php ssi_boardNews(); ?>
Result
SMF 2.1.4 Released
Simple Machines is pleased to announce a new patch for the 2.1.x line of SMF, which pushes the version number to 2.1.4.
Notable changes in SMF 2.1.4
- Attachments Upload UI enhancements - The UI used for uploading attachments is now easier to use, and a tad more aesthetic also.
- Cron enhancements - When running cron as a crontab in unix, it will now check for scheduled tasks and possibly flush the mail queue, in addition to acting on background tasks.
- jQuery upgrade - jQuery upgraded to 3.6.3.
- Notifications bug - Fixed a bug where certain notifications were not getting delivered if a user subscribed to both a board and a topic within the board.
- Editor bug - Fixed a bug where the cursor position may behave erratically when mentions exist in WYSIWYG mode.
- Search bug - Fixed a bug caused by some non-backwards compatible behavior in PHP 8.0+ that might result in incomplete results.
- Subscriptions bug - Fixed a bug where subscriptions with multi-byte utf8 characters in the description might cause errors.
- Subscriptions bug - Fixed an undefined constant CURLOPT_POSTFIELDSIZE bug.
- Package Manager bug - Fixed a bug where invalid default value errors were generated.
- Custom Fields Search bug - Fixed a bug which prevented custom field searches from working on the member list under some circumstances.
- Autolinker bug - Fixed a bug where the autolinker might get a match on partial names.
- Upgrader bug - Fixed a bug where certain notification settings were not brought forward properly from 2.0.
- Hooks bugs - Fixed bugs where hooks might not be removed properly when mods were deleted, and also where duplicate hooks might be created upon mod reinstall. Also, enabling & disabling of hooks in the admin console works cleanly now.
- Fixed a bug where admin-only boards might be visible on the board index.
- Fixed a bug where users might get kicked out with erroneous verification question errors.
- Fixed a bug where membergroup adds may not get logged properly.
- Fixed a bug where you may get cache errors in the logs.
- Fixed a bug where long user agents might cause various errors in the SMF error log.
- Fixed a bug where MariaDB users might see a "Subject isn't in GROUP BY" error when removing a topic.
- Fixed a bug where the SSI Recent Topics call did not show the original topic title.
- Numerous minor bug fixes, e.g., to address undefined vars.
- Numerous tweaks to enhance the UI.
Please see the change list on GitHub for more information.
How to update to 2.1.4
If you are currently using version 2.1.3, you can perform the update using the Package Manager (Administration Center > Package Manager). There you should see a notification about 2.1.4, including a "update your forum" link. If you do not see this notification in the Package Manager, please run "Fetch Simple Machines files" from the Scheduled Tasks page (Administration Center > Maintenance > Scheduled Tasks), and then try again.
If you are currently using any version from 2.1.0 to 2.1.3, you can use the process described above to apply previous update patches successively until you reach version 2.1.4.
If you are currently using any older version of SMF (including SMF 1.x, SMF 2.0.x, or one of the SMF 2.1 Betas or RCs), you can upgrade directly to 2.1.4 from whichever version you are currently using by using the "Large Upgrade" package from the Download page. Be aware that using this upgrade method will require you to reinstall any customizations that you have added to your forum, so if you are running SMF 2.1.0 or higher, it is recommended that you apply the successive patches instead of using the Large Upgrade.
If you are having problems downloading the patch from the admin panel, you can download the patch package from the Package Manager Updates page and install it via the Package Manager, as you would any other mod package.
Please refer to the Online Manual for more details about patching and upgrading.
Finally, as always, please do not use this topic for support requests. You will receive a much quicker and better response by posting in the 2.1.x Support Board.
Thank you for using SMF!
Regards,
Simple Machines
- 50 people like this.
SMF 2.1.3 Released
Simple Machines is pleased to announce a new patch for the 2.1.x line of SMF, which pushes the version number to 2.1.3.
Notable changes in SMF 2.1.3
- Unicode support enhancements - SMF unicode support now matches the latest published standard, Unicode 15, published in Sept 2022 (https://unicode.org/versions/Unicode15.0.0/). Staying current is important for proper capitalization across alphabets, and also with non-printable character detection.
- Attachments enhancement - Honor SMF-specified attachment limitations. SMF was restricting attachment uploads based on the underlying php configuration; however, given the .js approach used, this limitation did not apply.
- Attachments enhancement - Automatically delete inserted img tags when the corresponding attachments are deleted.
- Notification enhancement - Cleanup unread notifications after post approvals, after closing moderation reports, and after unlikes.
- Notification enhancement - Cleanup unread orphan alerts, created by message or topic deletions or permission changes.
- Notification enhancement - Cleanup unread quote and mention alerts if they were removed during a post edit.
- Upgrader enhancements - Issue warnings if attachment or avatar directories are not found. Also, a new option was added to allow the user to rerun the attachment conversion.
- Enhanced timezone support - SMF now supports all current timezones (https://www.iana.org/time-zones).
- Attachments bug - Fixed a bug where attachments might disappear with a "Not a Valid Attachment ID" message.
- Notification bug - Fixed a bug where the alert count displayed was incorrect.
- Email bug - Fixed a bug where emails with a mail type of PHP did not work properly in PHP 8.x in linux environments. (SMTP was OK.)
- Postgresql support - Fixed numerous issues causing mod installs to behave differently across Postgresql and MySQL. It is much easier now to develop a mod that supports both.
- Fixed a bug where PHP 8.1 was being persnickety and did not like implicit float to int conversions.
- Fixed a bug where the sql_mode was not being properly set in MySQL 8.x. This would result in slightly different DB query behavior across MySQL 5.x and MySQL 8.x.
- Fixed a bug where explicitly "Not Following" a topic resulted in it showing up in your unread list, and not going away...
- Improved support for spaces in URLs... Not per any RFC or spec, but SMF supported them in 2.0, so that support should have been carried forward to 2.1...
- Fixed a bug where errors appeared in the SMF error log when crawlers attempted to access now-moved avatars. During the 2.1 migration, avatars and attachments may be relocated; external crawlers referencing defunct links should not generate SMF errors.
- Fixed a bug in Postgresql syntax when deleting fulltext indexes.
- Fixed a bug where "Trying to access array offset on value of type null" showed up in the log.
- Fixed a bug where the editor would drop links if copied and pasted.
- Fixed a bug where right-to-left languages could not be specified and displayed properly.
- Fixed a bug where sorting PMs did not work properly.
- Fixed a bug where the BBC url setting erroneously affected signature and topic behavior.
- Fixed a bug where hidden members were hidden from admins, too...
- Fixed a bug where the wrong icon was used for profile links in PMs.
- Fixed a bug where robot_no_index might be set incorrectly, potentially affecting SEO.
- Fixed a bug with CORS headers were not being built properly.
- Fixed a bug where custom themes might load empty styles.
- Fixed a bug where permissions were not properly retained when boards were moved. Moved boards might disappear...
- Fixed a bug with using wildcards in IP tracking.
- Fixed multiple errors with caching - better reporting of the cache engine not loading, and better handling when not getting a hit on cached info.
- Improved edits on profile info, e.g., website urls too long.
- Fixed a bug where page numbers in lengthy lists might show decimals...
- Improved the message when verification questions were missing.
- Enhanced support for passwords for myBB converted users.
- Fixed an upgrader bug where 1.1 migrations might fail with Too few arguments to function smf_mysql_insert_id().
- Numerous minor enhancements and tweaks to layout.
Please see the change list on GitHub for more information.
How to update to 2.1.3
If you are currently using version 2.1.2 you can perform the update using the Package Manager (Administration Center > Package Manager). There you should see a notification about 2.1.3, including a "update your forum" link. If you do not see this notification in the Package Manager, please run "Fetch Simple Machines files" from the Scheduled Tasks page (Administration Center > Maintenance > Scheduled Tasks), and then try again.
If you are currently using version 2.1.0 - 2.1.1, you can use the process described above to apply previous update patches successively until you reach version 2.1.3.
If you are currently using any older version of SMF (including SMF 1.x, SMF 2.0.x, or one of the SMF 2.1 Betas or RCs), you can upgrade directly to 2.1.3 from whichever version you are currently using by using the "Large Upgrade" package from the Download page. Be aware that using this upgrade method will require you to reinstall any customizations that you have added to your forum, so if you are running SMF 2.1.0 or higher, it is recommended that you apply the successive patches instead of using the Large Upgrade.
If you are having problems downloading the patch from the admin panel, you can download the patch package from the Package Manager Updates page and install it via the Package Manager, as you would any other mod package.
Please refer to the Online Manual for more details about patching and upgrading.
Finally, as always, please do not use this topic for support requests. You will receive a much quicker and better response by posting in the 2.1.x Support Board.
Thank you for using SMF!
Regards,
Simple Machines
- 37 people like this.
SMF 2.1.2 Released
Simple Machines is pleased to announce a new patch for the 2.1.x line of SMF, which pushes the version number to 2.1.2.
We consider this patch to be of crucial importance, as it includes security updates.
Notable changes in SMF 2.1.2
- Fixes errors when attempting to view the profile of a non-existent user.
- Fixes minor issues with the editor toolbar when certain BBCodes are disabled.
- Fixes a bug where the admin panel incorrectly showed the image proxy settings as editable when Settings.php was read-only.
- Correctly formats the gender string in profile exports.
- Correctly formats the custom profile field names and values in the Buddies list.
- Fixes a minor bug when displaying size limits in the attachments restrictions information.
- Large image thumbnails now display with the the correct aspect ratio when viewed on small devices.
- Video attachments no longer overflow the window on small devices.
- Fixes errors about undefined variables when switching between different cache accelerator options.
- Fixes an error about invalid dates when a comma was used under certain circumstances while creating a calendar event.
- Correctly handles uppercase non-ASCII characters in the answers to verification questions.
- Fixes a bug that could allow a topic to be moved into a redirection board under certain circumstances.
- Fixes a error that could be generated when sending notifications about guest posts.
- Fixes a bug where certain pages could fail to load if the set_time_limit() function was disabled on PHP 8+.
- Fixes a bug where attachments might not download correctly if the "Enable compressed output" setting was enabled on PHP 8.0.17+ and 8.1.4+.
- Fixes some rare Unicode character handling issues.
- Security improvements.
Please see the change list on GitHub for more information.
How to update to 2.1.2
If you are currently using version 2.1.1 you can perform the update using the Package Manager (Administration Center > Package Manager). There you should see a notification about 2.1.2, including a "update your forum" link. If you do not see this notification in the Package Manager, please run "Fetch Simple Machines files" from the Scheduled Tasks page (Administration Center > Maintenance > Scheduled Tasks), and then try again.
If you are currently using version 2.1.0, you can use the process described above to apply previous update patches successively until you reach version 2.1.2.
If you are currently using any older version of SMF (including SMF 1.x, SMF 2.0.x, or one of the SMF 2.1 Betas or RCs), you can upgrade directly to 2.1.2 from whichever version you are currently using by using the "Large Upgrade" package from the Download page. Be aware that using this upgrade method will require you to reinstall any customizations that you have added to your forum, so if you are running SMF 2.1.0 or higher, it is recommended that you apply the successive patches instead of using the Large Upgrade.
If you are having problems downloading the patch from the admin panel, you can download the patch package from the Package Manager Updates page and install it via the Package Manager, as you would any other mod package.
Please refer to the Online Manual for more details about patching and upgrading.
Finally, as always, please do not use this topic for support requests. You will receive a much quicker and better response by posting in the 2.1.x Support Board.
Thank you for using SMF!
Regards,
Simple Machines
- 30 people like this.
SMF 2.1.1 Released
Simple Machines has released our first patch to the 2.1.x line of SMF, bringing our latest release version to 2.1.1.
- Restores support for PHP 7.0–7.2
- Fixes a minor bug in the Package Manager
How to update to 2.1.1
If you are running version 2.1.0, you can update your forum to the latest version by using the package manager. You should see the update notification in the admin panel notifications and in the package manager, which will allow you to download and install the patch seamlessly. If you do not see the notification about the patch, please run the scheduled task "Fetch Simple Machines files" from the Scheduled Tasks page (Admin > Maintenance > Scheduled Tasks).
For other install and upgrade options, please see below.
Since SMF 2.1.1 comes soon after SMF 2.1.0, which was released only a few days ago, we are including a copy the SMF 2.1.0 release announcement for your convenience:
Simple Machines is pleased to announce the official release of the long awaited SMF 2.1.
This release marks the transition of SMF 2.1 into the current stable release of SMF. This means that:
- SMF 2.1 is now the recommended version for use on live production forums. We encourage everyone to start planning for an upgrade to SMF 2.1.
- SMF 2.0 remains supported and will continue to receive security updates for the foreseeable future, but this release officially marks the end of further 2.0 development. We will release a separate announcement for any future changes to SMF 2.0's status.
Notable changes in 2.1
The changes between SMF 2.0.x and SMF 2.1 are too many to count, but here are a few highlights:
- New features for users
- A new WYSIWYG editor, SCEditor
- Real-time alerts in addition to email notifications
- A new default theme with full support for mobile devices
- Draft messages (you can save & resume later)
- Mentions using @name syntax
- Drag & drop attachments
- Attachments can be embedded directly into post text
- New features for moderators and administrators
- An improved Administrator Control Panel
- Support for moderator groups, not just individuals
- Many security enhancements, including support for optional Two Factor Authentication.
- IPv6 support
- Designed with GDPR support
- New features for modification and theme authors
- A massive expansion of the number of integration hooks available
- More powerful BBCode possibilities
- Background tasks
- New capabilities in the Package SDK
You can learn more about the many new features and changes in SMF 2.1 here.
How to install a new SMF 2.1 forum
You can install SMF 2.1 using the "Full Install" package from the Download page.
Please refer to the Online Manual for more details about installing.
How to upgrade to SMF 2.1
You can upgrade to SMF 2.1 from any previous version using the "Large Upgrade" package from the Download page.
Be aware that upgrading to SMF 2.1 will remove any modifications you may have installed on your existing SMF forum, and that SMF 2.1 is incompatible with custom themes designed for earlier versions of SMF. You will need to install new versions of those modifications and/or themes after upgrading. Many modifications and themes have already been updated by their authors to support SMF 2.1, but you may wish to check the status of individual modifications or themes before proceeding.
Please refer to the Online Manual for more details about upgrading.
With this release we'd like to take the opportunity to recognize the effort and dedication of all the people who have volunteered their time to help the SMF project. We would like to thank everyone, past and present, who has contributed to the development of SMF over the past years.
Finally, as always, please do not use this topic for support requests. You will receive a much quicker and better response by asking for help in the SMF 2.1.x Support board.
Thank you for using SMF!
Regards,
Simple Machines
- 26 people like this.
SMF 2.1.0 Released
Simple Machines is pleased to announce the official release of the long awaited SMF 2.1.
This release marks the transition of SMF 2.1 into the current stable release of SMF. This means that:
- SMF 2.1 is now the recommended version for use on live production forums. We encourage everyone to start planning for an upgrade to SMF 2.1.
- SMF 2.0 remains supported and will continue to receive security updates for the foreseeable future, but this release officially marks the end of further 2.0 development. We will release a separate announcement for any future changes to SMF 2.0's status.
Notable changes in 2.1
The changes between SMF 2.0.x and SMF 2.1 are too many to count, but here are a few highlights:
- New features for users
- A new WYSIWYG editor, SCEditor
- Real-time alerts in addition to email notifications
- A new default theme with full support for mobile devices
- Draft messages (you can save & resume later)
- Mentions using @name syntax
- Drag & drop attachments
- Attachments can be embedded directly into post text
- New features for moderators and administrators
- An improved Administrator Control Panel
- Support for moderator groups, not just individuals
- Many security enhancements, including support for optional Two Factor Authentication
- IPv6 support
- Designed with GDPR support
- New features for modification and theme authors
- A massive expansion of the number of integration hooks available
- More powerful BBCode possibilities
- Background tasks
- New capabilities in the Package SDK
You can learn more about the many new features and changes in SMF 2.1 here.
How to install a new SMF 2.1 forum
You can install SMF 2.1 using the "Full Install" package from the Download page.
Please refer to the Online Manual for more details about installing.
How to upgrade to SMF 2.1
You can upgrade to SMF 2.1 from any previous version using the "Large Upgrade" package from the Download page.
Be aware that upgrading to SMF 2.1 will remove any modifications you may have installed on your existing SMF forum, and that SMF 2.1 is incompatible with custom themes designed for earlier versions of SMF. You will need to install new versions of those modifications and/or themes after upgrading. Many modifications and themes have already been updated by their authors to support SMF 2.1, but you may wish to check the status of individual modifications or themes before proceeding.
Please refer to the Online Manual for more details about upgrading.
With this release we'd like to take the opportunity to recognize the effort and dedication of all the people who have volunteered their time to help the SMF project. We would like to thank everyone, past and present, who has contributed to the development of SMF over the past years.
Finally, as always, please do not use this topic for support requests. You will receive a much quicker and better response by asking for help in the SMF 2.1.x Support board.
Thank you for using SMF!
Regards,
Simple Machines
- 61 people like this.
Recent Attachments Function
Code
<?php ssi_recentAttachments(); ?>
Result
File | Posted by | Downloads | Filesize |
---|---|---|---|
![]() |
mickjav | 84 | 3548.8KB |
![]() |
mickjav | 423 | 609.35KB |
![]() |
mickjav | 422 | 818.21KB |
![]() |
mickjav | 437 | 58.4KB |
![]() |
mickjav | 455 | 32.91KB |
![]() |
mickjav | 461 | 196.07KB |
![]() |
mickjav | 481 | 157.18KB |
![]() |
Kindred | 549 | 720.13KB |
![]() |
Kindred | 535 | 826.25KB |
![]() |
lostr | 235 | 58.91KB |
Show Single Poll
Shows a poll in the specified topic.
Code
<?php ssi_showPoll($topicID); ?>
Result
Show Single Post
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.
Code
<?php ssi_fetchPosts($postIDs, $isOverride); ?>
Result
Show Single Member
Shows the specified member's name and profile link.
Code
<?php ssi_fetchMember($memberIDs); ?>
Result
Show Group Members
Shows all members in a specified group.
Code
<?php ssi_fetchGroupMembers($groupIDs); ?>
Result
Home Page Sample
This sample uses the following features: ssi_recentTopics(), ssi_logOnline(), ssi_welcome(), and ssi_boardNews(). ssi_recentTopics() is fetched using the array method, to allow further customizations on the output.Code
<?php require("SSI.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title>SSI.php example for home page</title>
<style>
body { font-family: Arial, Tahoma, sans-serif; font-size: 80%; background: #DFDFDF; color: #FFFFFF; margin: 0 }
ul,ol { padding-left: 19px; margin: 0; }
li { font-size: 11px; }
h1,h2,h3 { margin: 0; padding: 0; }
h3 { font-size: 15px; }
a:link,a:visited { color: #FF9000; text-decoration: none; }
a:hover { text-decoration: underline; }
#container { background: #52514E; width: 100%; border: 1px solid midnightblue; line-height: 150%; margin: 0; }
#header,#footer { color: lightgray; background-color: #2A2825; clear: both; padding: .5em; }
#leftbar { background: #DF7E00; float: left; width: 160px; margin: 0; padding: 1em; }
#leftbar a { color: #000000; text-decoration: underline; }
#content { margin-left: 190px; padding: 1em; }
#navigation { float: right; }
#navigation a:link,#navigation a:visited { color: #FF9000; }
</style>
</head>
<body>
<div id="container">
<div id="header">
<div id="navigation">
<a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link</a>
</div>
<h1 class="header">YourWebsite.com</h1>
</div>
<div id="leftbar">
<h3>Recent Forum Topics</h3>
<ul>
<?php
// Using array method to show shorter display style.
$topics = ssi_recentTopics(8, null, null, 'array');
foreach ($topics as $topic)
{
// Uncomment the following code to get a listing of array elements that SMF provides for this function.
// echo '<pre>', print_r($topic), '</pre>';
echo '
<li><a href=\"', $topic['href'], '\">', $topic['subject'], '</a> ', $txt['by'], ' ', $topics[$i]['poster']['link'], '</li>';
}
unset($topics);
?>
</ul><br>
<h3>Online Users</h3>
<?php ssi_logOnline(); ?>
</div>
<div id="content">
<?php ssi_welcome(); ?><br><br>
<h2>News</h2>
<?php ssi_boardNews(); ?>
</div>
<div id="footer">
<a target="_blank" rel="noopener" rel="license" href="https://creativecommons.org/licenses/publicdomain/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/publicdomain/88x31.png"></a>
This sample website layout is dedicated to the <a target="_blank" rel="noopener" rel="license" href="https://creativecommons.org/licenses/publicdomain/">Public Domain</a>.
</div>
</div>
</body>
</html>