SMF SSI.php Functions

Current Version: 2.1.6

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:

Code: [Select]
<?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)

Code: [Select]
<?php ssi_recentTopics(); ?>

Code (advanced mode)

Code: [Select]
<?php ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo'); ?>

Result

Recent Posts Function

Code

Code: [Select]
<?php ssi_recentPosts(); ?>

Result

Recent Poll Function

Code

Code: [Select]
<?php ssi_recentPoll(); ?>

Result

Top Boards Function

Shows top boards by the number of posts.

Code

Code: [Select]
<?php ssi_topBoards(); ?>

Result

Board Topics Posts
SMF Online Manual 0 5,967,163
Srpski (Serbian) 0 2,964,095
Bosanski (Bosnian) 0 2,960,624
Hrvatski (Croatian) 0 2,937,466
Bugtracker (Github) 0 2,877,488
SMF 1.1.x Support New 82,893 521,018
SMF 2.0.x Support New 50,070 376,347
Modifications and Packages New 2,794 348,321
Arşiv New 31,575 228,763
Español (Spanish) New 29,784 177,767

Top Topics

Shows top topics by the number of replies or views.

Code (show by number of views)

Code: [Select]
<?php ssi_topTopicsViews(); ?>

Result

Code (show by number of replies)

Code: [Select]
<?php ssi_topTopicsReplies(); ?>

Result

Top Poll Function

Shows the most-voted-in poll.

Code

Code: [Select]
<?php ssi_topPoll(); ?>

Result

Top Poster Function

Shows the top poster's name and profile link.

Code

Code: [Select]
<?php ssi_topPoster(); ?>

Result

Latest Member Function

Shows the latest member's name and profile link.

Code

Code: [Select]
<?php ssi_latestMember(); ?>

Result

Please welcome faisalitebtools, our newest member.

Member of the Day

Shows one random member of the day. This changes once a day.

Code

Code: [Select]
<?php ssi_randomMember('day'); ?>

Result

Who's Online Function

This function shows who are online inside the forum.

Code

Code: [Select]
<?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

Code: [Select]
<?php ssi_logOnline(); ?>

Result

Login Function

Shows a login box only when user is not logged in.

Code

Code: [Select]
<?php ssi_login(); ?>

Result

 
 

Logout Function

Shows a logout link only when user is logged in.

Code

Code: [Select]
<?php ssi_logout(); ?>

Result

Welcome Function

Greets users or guests, also shows user's messages if logged in.

Code

Code: [Select]
<?php ssi_welcome(); ?>

Result

Welcome to Simple Machines Community Forum. Please log in or sign up.

Today's Calendar Function

Code

Code: [Select]
<?php ssi_todaysCalendar(); ?>

Result

Today's Birthdays Function

Code

Code: [Select]
<?php ssi_todaysBirthdays(); ?>

Result

Today's Holidays Function

Code

Code: [Select]
<?php ssi_todaysHolidays(); ?>

Result

Today's Events Function

Code

Code: [Select]
<?php ssi_todaysEvents(); ?>

Result

Recent Calendar Events Function

Code

Code: [Select]
<?php ssi_recentEvents(); ?>

Result

Forum Stats

Shows some basic forum stats: total members, posts, topics, boards, etc.

Code

Code: [Select]
<?php ssi_boardStats(); ?>

Result

Total Members: 460,554
Total Posts: 3,942,807
Total Topics: 467,249
Total Categories: 13
Total Boards: 223

News Function

Shows random forum news.

Code

Code: [Select]
<?php ssi_news(); ?>

Result

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Board News Function

Shows the latest posts from read only boards, or a specific board.

Code

Code: [Select]
<?php ssi_boardNews(); ?>

Result

xx SMF 2.1.6 released

June 26, 2025, 11:38:28 AM by Sesquipedalian
Dear Members,

Simple Machines has released a new patch to the 2.1.x line of SMF, bringing our latest release version to 2.1.6.

This patch contains fixes for a few bugs that were introduced in 2.1.5, some of which could be frustrating to those who were affected by them:

  • Fixes "Undefined variable $sid" errors when a user with cookies disabled visited the forum while queryless URLs were enabled.
  • Fixes a database query error that affected MariaDB while trying to search inside a topic.
  • Fixes a BBCode parsing bug.

SMF 2.1.6 is a minor hotfix for 2.1.5, and since 2.1.5 was released only a few days ago, we're including the release notes for 2.1.5 as well for your convenience.

  • PHP support:
    • Raises the minimum supported PHP version from 7.0 to 7.1.
    • Adds support for PHP 8.4.
  • Security:
    • Fixes some security issues. For this reason, upgrading is strongly recommended.
  • User profiles:
    • Fixes errors when profile fields using the "nohtml" mask are given values with Unicode characters or quotation marks.
    • Adds a new, separate permission for using Gravatars.
  • Attachments:
    • Several fixes and improvements for the attachment upload UI.
    • Sets Content-Disposition header correctly for attachments for mobile browsers.
    • Improves handling of SVG image attachments
    • Adds support for WEBP images.
  • Editor and BBCode:
    • The "Quote Selected Text" button is now more tolerant of "messy" selection ranges.
    • Shows "Last Edit" info (if applicable) when editing a post.
    • Improves smileys popup behavior.
    • Improves image quality of previews for embedded attachments in the WYSIWYG editor.
    • Fixes bugs in a few edge cases when parsing BBCode.
    • Centers BBCode tables wrapped in the center BBCode.
    • Fixes PHP syntax highlighting in BBCode under PHP 8.3+.
    • Fixes issues with broken HTML entities in warning templates.
  • Calendar:
    • Shows multiple calendar events on the same day correctly.
  • Search:
    • Fixes undefined variable error in custom search API.
    • Fixes a bug where the last character of a Unicode search term could be mangled.
    • Returns correct search results when post moderation is enabled.
  • Email:
    • Notification emails always use display names, never usernames.
    • Improved handling of SMTP errors when sending emails.
    • Fixes a bug where undeliverable emails might never clear from the mail queue.
    • Accepts wildcards in email-based ban triggers.
  • Admin:
    • Updates Unicode data files in a background task. (This ensures the forum will always have up-to-date support for the latest emojis and such.)
    • Fixes bug where rearranging boards in the admin center could cause some boards to temporarily not be shown.
  • Other:
    • Fixes errors in RSS feeds for messages by members with commas in their usernames.
    • Fixes the integrate_error_types integration hook.
    • Fixes the integrate_attachments_browse integration hook.
    • Fixes open_basedir warnings in PHP 8.
    • Fixes some minor UI bugs.


Please see the change list for 2.1.5 and the change list for 2.1.6 on GitHub for more information.

How to update to 2.1.6

If you are currently using version 2.1.5, you can perform the update using the Package Manager (Administration Center > Package Manager). There you should see a notification about 2.1.6, 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.4, you can use the process described above to apply previous update patches successively until you reach version 2.1.5.

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.6 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
19 comments | Write Comment

xx SMF 2.1.5 released

June 24, 2025, 12:41:20 PM by Sesquipedalian
Dear Members,

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.5.

Notable changes in SMF 2.1.5

  • PHP support:
    • Raises the minimum supported PHP version from 7.0 to 7.1.
    • Adds support for PHP 8.4.
  • User profiles:
    • Fixes errors when profile fields using the "nohtml" mask are given values with Unicode characters or quotation marks.
    • Adds a new, separate permission for using Gravatars.
  • Attachments:
    • Several fixes and improvements for the attachment upload UI.
    • Sets Content-Disposition header correctly for attachments for mobile browsers.
    • Improves handling of SVG image attachments
    • Adds support for WEBP images.
  • Editor and BBCode:
    • The "Quote Selected Text" button is now more tolerant of "messy" selection ranges.
    • Shows "Last Edit" info (if applicable) when editing a post.
    • Improves smileys popup behavior.
    • Improves image quality of previews for embedded attachments in the WYSIWYG editor.
    • Fixes bugs in a few edge cases when parsing BBCode.
    • Centers BBCode tables wrapped in the center BBCode.
    • Fixes PHP syntax highlighting in BBCode under PHP 8.3+.
    • Fixes issues with broken HTML entities in warning templates.
  • Calendar:
    • Shows multiple calendar events on the same day correctly.
  • Search:
    • Fixes undefined variable error in custom search API.
    • Fixes a bug where the last character of a Unicode search term could be mangled.
    • Returns correct search results when post moderation is enabled.
  • Email:
    • Notification emails always use display names, never usernames.
    • Improved handling of SMTP errors when sending emails.
    • Fixes a bug where undeliverable emails might never clear from the mail queue.
    • Accepts wildcards in email-based ban triggers.
  • Admin:
    • Updates Unicode data files in a background task. (This ensures the forum will always have up-to-date support for the latest emojis and such.)
    • Fixes bug where rearranging boards in the admin center could cause some boards to temporarily not be shown.
  • Other:
    • Fixes errors in RSS feeds for messages by members with commas in their usernames.
    • Fixes the integrate_error_types integration hook.
    • Fixes the integrate_attachments_browse integration hook.
    • Fixes open_basedir warnings in PHP 8.
    • Fixes some minor UI bugs.

Please see the change list on GitHub for more information.

How to update to 2.1.5

If you are currently using version 2.1.4, you can perform the update using the Package Manager (Administration Center > Package Manager). There you should see a notification about 2.1.5, 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.5.

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.5 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
13 comments

xx SMF 2.1.4 Released

June 10, 2023, 01:18:17 PM by shawnb61
Dear Members,

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
55 comments

xx SMF 2.1.3 Released

November 21, 2022, 02:06:14 PM by shawnb61
Dear Members,

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
45 comments

xx SMF 2.1.2 Released

May 09, 2022, 12:33:55 PM by Sesquipedalian
Dear Members,

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
45 comments

Menubar Function

Displays a menu bar, like one displayed at the top of the forum.

Code

Code: [Select]
<?php ssi_menubar(); ?>

Result

Quick Search Function

Code

Code: [Select]
<?php ssi_quickSearch(); ?>

Result

Recent Attachments Function

Code

Code: [Select]
<?php ssi_recentAttachments(); ?>

Result

Show Single Poll

Shows a poll in the specified topic.

Code

Code: [Select]
<?php ssi_showPoll($topicID); ?>

Result

Not shown because it needs specific topic ID that contains a poll.

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

Code: [Select]
<?php ssi_fetchPosts($postIDs, $isOverride); ?>

Result

Not shown because it needs a specific post ID.

Show Single Member

Shows the specified member's name and profile link.

Code

Code: [Select]
<?php ssi_fetchMember($memberIDs); ?>

Result

Not shown because it needs a specific member ID.

Show Group Members

Shows all members in a specified group.

Code

Code: [Select]
<?php ssi_fetchGroupMembers($groupIDs); ?>

Result

Not shown because it needs specific membergroup IDs.

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

Code: Select
<?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>

Result