ServerSideIncludes
in package
Uses
BackwardCompatibility
Performs all the necessary setup and security checks for SSI access, and provides a number of useful functions that allow external scripts to access SMF data.
External scripts can affect various aspects of SSI behaviour using global variables that are named in this class's $ssi_globals property. For more information on this, see the DocBlock comments below.
Table of Contents
Properties
- $ban : bool
- $guest_access : bool
- $gzip : bool
- $layers : array<string|int, mixed>
- $maintenance_off : bool
- $on_error_method : bool|string
- $theme : int
- $error_reporting : int
- $setup_done : bool
- $ssi_globals : array<string|int, mixed>
- $backcompat : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor. Sets up stuff we need for safe use of SSI.
- boardNews() : void|array<string|int, mixed>
- Show the latest news, with a template... by board.
- boardStats() : void|array<string|int, mixed>
- Show some basic stats: Total This: XXXX, etc.
- checkPassword() : bool
- Checks whether the specified password is correct for the specified user.
- copyright() : void|string
- Show the forum copyright. Only used in our ssi_examples files.
- execute() : true
- Allows accessing an SSI function via URL parameters.
- exportStatic() : void
- Provides a way to export a class's public static properties and methods to global namespace.
- fetchGroupMembers() : void|array<string|int, mixed>
- Get al members in the specified group
- fetchMember() : void|array<string|int, mixed>
- Fetch specific members
- fetchPosts() : void|array<string|int, mixed>
- Fetches one or more posts by ID.
- fullVersion() : void|string
- Show the full SMF version string.
- latestMember() : void|array<string|int, mixed>
- Show a link to the latest member: Please welcome, Someone, our latest member.
- login() : void|bool
- Shows a login box
- logOnline() : void|array<string|int, mixed>
- Just like whosOnline except it also logs the online presence.
- logout() : void|string
- Show a logout link.
- menubar() : void|array<string|int, mixed>
- Display a menu bar, like is displayed at the top of the forum.
- news() : void|string
- Show a random forum news item
- pollVote() : mixed
- Handles voting in a poll (done automatically)
- queryMembers() : void|array<string|int, mixed>
- Pulls info about members based on the specified parameters. Used by other functions to eliminate duplication.
- queryPosts() : void|array<string|int, mixed>
- This handles actually pulling post info. Called from other functions to eliminate duplication.
- quickSearch() : void|string
- Shows a search box
- randomMember() : void|array<string|int, mixed>
- Fetches a random member.
- recentAttachments() : void|array<string|int, mixed>
- Shows the most recent attachments that the user can see
- recentEvents() : void|array<string|int, mixed>
- Show the most recent events
- recentPoll() : void|array<string|int, mixed>
- Shows the most recent poll
- recentPosts() : void|array<string|int, mixed>
- Recent post list: [board] Subject by Poster Date
- recentTopics() : void|array<string|int, mixed>
- Recent topic list: [board] Subject by Poster Date
- showPoll() : void|array<string|int, mixed>
- Shows the poll from the specified topic
- shutdown() : mixed
- This shuts down the SSI and shows the footer.
- softwareYear() : void|string
- Show the SMF software year.
- todaysBirthdays() : void|array<string|int, mixed>
- Show today's birthdays.
- todaysCalendar() : void|array<string|int, mixed>
- Shows today's calendar items (events, birthdays and holidays)
- todaysEvents() : void|array<string|int, mixed>
- Shows today's events.
- todaysHolidays() : void|array<string|int, mixed>
- Shows today's holidays.
- topBoards() : void|array<string|int, mixed>
- Shows a list of top boards based on activity
- topPoll() : void|array<string|int, mixed>
- Show the top poll based on votes
- topPoster() : void|array<string|int, mixed>
- Shows a list of top posters
- topTopics() : void|array<string|int, mixed>
- Shows a list of top topics based on views or replies
- topTopicsReplies() : void|array<string|int, mixed>
- Top topics based on replies
- topTopicsViews() : void|array<string|int, mixed>
- Top topics based on views
- version() : void|string
- Show the SMF version.
- welcome() : void|array<string|int, mixed>
- Display a welcome message, like: Hey, User, you have 0 messages, 0 are new.
- whosOnline() : void|array<string|int, mixed>
- Shows a list of online users: YY Guests, ZZ Users and then a list... Alias: ssi_whosOnline()
Properties
$ban
public
bool
$ban
= false
Local copy of the global $ssi_ban variable.
Whether to check that the viewing user is not banned.
$guest_access
public
bool
$guest_access
= false
Local copy of the global $ssi_guest_access variable.
If true, allows guests to see SSI data even when they cannot access the forum itself.
$gzip
public
bool
$gzip
Local copy of the global $ssi_gzip variable.
Whether to compress output using the GZip algorithm.
$layers
public
array<string|int, mixed>
$layers
Local copy of the global $ssi_layers variable.
An array of template layers in which to wrap the content. If not set, the theme's defaults will be used.
$maintenance_off
public
bool
$maintenance_off
= false
Local copy of the global $ssi_maintenance_off variable.
If true, allows SSI access even when the forum is in maintenance mode.
$on_error_method
public
static bool|string
$on_error_method
= false
Local copy of the global $ssi_on_error_method variable.
Set this to one of three values depending on what you want to happen in the case of a fatal error:
false: Default. Will just load the error sub template and die without putting any theme layers around it.
true: Will load the error sub template AND put the SMF layers around it. (Not useful if on total custom pages.)
string: Name of a callback function to call in the event of an error to allow you to define your own methods. Will die after function returns.
$theme
public
int
$theme
= 0
Local copy of the global $ssi_theme variable.
ID number of a theme to use for SSI functions.
$error_reporting
protected
int
$error_reporting
Remembers the error_reporting level prior to SSI starting, so that we can restore it once we are done.
$setup_done
protected
static bool
$setup_done
= false
Whether SSI setup has been completed.
$ssi_globals
protected
array<string|int, mixed>
$ssi_globals
= ['ssi_on_error_method', 'ssi_maintenance_off', 'ssi_theme', 'ssi_layers', 'ssi_gzip', 'ssi_ban', 'ssi_guest_access']
Names of various global variables that external scripts can declare in order to influence the behaviour of SSI.
$backcompat
private
static array<string|int, mixed>
$backcompat
= ['func_names' => ['shutdown' => 'ssi_shutdown', 'version' => 'ssi_version', 'fullVersion' => 'ssi_full_version', 'softwareYear' => 'ssi_software_year', 'copyright' => 'ssi_copyright', 'welcome' => 'ssi_welcome', 'menubar' => 'ssi_menubar', 'logout' => 'ssi_logout', 'recentPosts' => 'ssi_recentPosts', 'fetchPosts' => 'ssi_fetchPosts', 'queryPosts' => 'ssi_queryPosts', 'recentTopics' => 'ssi_recentTopics', 'topPoster' => 'ssi_topPoster', 'topBoards' => 'ssi_topBoards', 'topTopics' => 'ssi_topTopics', 'topTopicsReplies' => 'ssi_topTopicsReplies', 'topTopicsViews' => 'ssi_topTopicsViews', 'latestMember' => 'ssi_latestMember', 'randomMember' => 'ssi_randomMember', 'fetchMember' => 'ssi_fetchMember', 'fetchGroupMembers' => 'ssi_fetchGroupMembers', 'queryMembers' => 'ssi_queryMembers', 'boardStats' => 'ssi_boardStats', 'whosOnline' => 'ssi_whosOnline', 'logOnline' => 'ssi_logOnline', 'login' => 'ssi_login', 'topPoll' => 'ssi_topPoll', 'recentPoll' => 'ssi_recentPoll', 'showPoll' => 'ssi_showPoll', 'pollVote' => 'ssi_pollVote', 'quickSearch' => 'ssi_quickSearch', 'news' => 'ssi_news', 'todaysBirthdays' => 'ssi_todaysBirthdays', 'todaysHolidays' => 'ssi_todaysHolidays', 'todaysEvents' => 'ssi_todaysEvents', 'todaysCalendar' => 'ssi_todaysCalendar', 'boardNews' => 'ssi_boardNews', 'recentEvents' => 'ssi_recentEvents', 'checkPassword' => 'ssi_checkPassword', 'recentAttachments' => 'ssi_recentAttachments']]
BackwardCompatibility settings for this class.
Methods
__construct()
Constructor. Sets up stuff we need for safe use of SSI.
public
__construct() : mixed
boardNews()
Show the latest news, with a template... by board.
public
static boardNews([null|int $board = null ][, null|int $limit = null ][, null|int $start = null ][, null|int $length = null ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_boardNews()
Parameters
- $board : null|int = null
-
The ID of the board to get the info from. Defaults to $board or $_GET['board'] if not set.
- $limit : null|int = null
-
How many items to show. Defaults to $_GET['limit'] or 5 if not set.
- $start : null|int = null
-
Start with the specified item. Defaults to $_GET['start'] or 0 if not set.
- $length : null|int = null
-
How many characters to show from each post. Defaults to $_GET['length'] or 0 (no limit) if not set.
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the news items, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays the news items or returns an array of info about them, depending on output_method.
boardStats()
Show some basic stats: Total This: XXXX, etc.
public
static boardStats([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_boardStats()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the stats, otherwise returns an array of info about them
Return values
void|array<string|int, mixed> —Doesn't return anything if the user can't view stats. Otherwise either displays the stats or returns an array of info about them, depending on output_method.
checkPassword()
Checks whether the specified password is correct for the specified user.
public
static checkPassword([int|string $id = null ][, string $password = null ][, bool $is_username = false ]) : bool
Alias: ssi_checkPassword()
Parameters
- $id : int|string = null
-
The ID or username of a user
- $password : string = null
-
The password to check
- $is_username : bool = false
-
If true, treats $id as a username rather than a user ID
Return values
bool —Whether or not the password is correct.
copyright()
Show the forum copyright. Only used in our ssi_examples files.
public
static copyright([string $output_method = 'echo' ]) : void|string
Alias: ssi_copyright()
Parameters
- $output_method : string = 'echo'
-
If 'echo', displays the forum copyright, otherwise returns it
Return values
void|string —Returns nothing if output_method is 'echo', otherwise returns the copyright string
execute()
Allows accessing an SSI function via URL parameters.
public
execute() : true
Return values
trueexportStatic()
Provides a way to export a class's public static properties and methods to global namespace.
public
static exportStatic() : void
To do so:
- Use this trait in the class.
- At the END of the class's file, call its exportStatic() method.
Although it might not seem that way at first glance, this approach conforms to section 2.3 of PSR 1, since executing this method is simply a dynamic means of declaring functions when the file is included; it has no other side effects.
Regarding the $backcompat items:
A class's static properties are not exported to global variables unless explicitly included in $backcompat['prop_names']. Likewise, a class's static methods are not exported as global functions unless explicitly included in $backcompat['func_names'].
$backcompat['prop_names'] is a simple array where the keys are the names of one or more of a class's static properties, and the values are the names of global variables. In each case, the global variable will be set to a reference to the static property. Static properties that are not named in this array will not be exported.
$backcompat['func_names'] is a simple array where the keys are the names of one or more of a class's static methods, and the values are the names that should be used for global functions that will encapsulate those methods. Methods that are not named in this array will not be exported.
Adding non-static properties or methods to the $backcompat arrays will produce runtime errors. It is the responsibility of the developer to make sure not to do this.
fetchGroupMembers()
Get al members in the specified group
public
static fetchGroupMembers([int $group_id = null ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_fetchGroupMembers()
Parameters
- $group_id : int = null
-
The ID of the group to get members from
- $output_method : string = 'echo'
-
The output method. If 'echo', returns a list of group members, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a list of group members or returns an array of info about them, depending on output_method.
fetchMember()
Fetch specific members
public
static fetchMember([array<string|int, mixed> $member_ids = [] ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_fetchMember()
Parameters
- $member_ids : array<string|int, mixed> = []
-
The IDs of the members to fetch
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of links to the members' profiles, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays links to the specified members' profiles or returns an array of info about them, depending on output_method.
fetchPosts()
Fetches one or more posts by ID.
public
static fetchPosts([array<string|int, mixed> $post_ids = [] ][, bool $override_permissions = false ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_fetchPosts()
Parameters
- $post_ids : array<string|int, mixed> = []
-
An array containing the IDs of the posts to show
- $override_permissions : bool = false
-
Whether to ignore permissions. If true, will show posts even if the user doesn't have permission to see them.
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the posts, otherwise returns an array of info about them
Return values
void|array<string|int, mixed> —Displays the specified posts or returns an array of info about them, depending on output_method.
fullVersion()
Show the full SMF version string.
public
static fullVersion([string $output_method = 'echo' ]) : void|string
Alias: ssi_full_version()
Parameters
- $output_method : string = 'echo'
-
If 'echo', displays the full version string, otherwise returns it
Return values
void|string —Returns nothing if output_method is 'echo', otherwise returns the version string
latestMember()
Show a link to the latest member: Please welcome, Someone, our latest member.
public
static latestMember([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_latestMember()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', returns a string with a link to the latest member's profile, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a "welcome" message for the latest member or returns an array of info about them, depending on output_method.
login()
Shows a login box
public
static login([string $redirect_to = '' ][, string $output_method = 'echo' ]) : void|bool
Alias: ssi_login()
Parameters
- $redirect_to : string = ''
-
The URL to redirect the user to after they login
- $output_method : string = 'echo'
-
The output method. If 'echo' and the user is a guest, displays a login box, otherwise returns whether the user is a guest
Return values
void|bool —Either displays a login box or returns whether the user is a guest, depending on whether the user is logged in and output_method.
logOnline()
Just like whosOnline except it also logs the online presence.
public
static logOnline([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_logOnline()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list, otherwise returns an array of info about the online users.
Return values
void|array<string|int, mixed> —Either displays a list of online users or returns an aray of info about them, depending on output_method.
logout()
Show a logout link.
public
static logout([string $redirect_to = '' ][, string $output_method = 'echo' ]) : void|string
Alias: ssi_logout()
Parameters
- $redirect_to : string = ''
-
A URL to redirect the user to after they log out.
- $output_method : string = 'echo'
-
The output method. If 'echo', shows a logout link, otherwise returns the HTML for it.
Return values
void|string —Displays a logout link or returns its HTML depending on output_method.
menubar()
Display a menu bar, like is displayed at the top of the forum.
public
static menubar([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_menubar()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', will display the menu, otherwise returns an array of menu data.
Return values
void|array<string|int, mixed> —Displays the menu or returns an array of menu data depending on output_method.
news()
Show a random forum news item
public
static news([string $output_method = 'echo' ]) : void|string
Alias: ssi_news()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', shows the news item, otherwise returns it.
Return values
void|string —Shows or returns a random forum news item, depending on output_method.
pollVote()
Handles voting in a poll (done automatically)
public
static pollVote() : mixed
Alias: ssi_pollVote()
queryMembers()
Pulls info about members based on the specified parameters. Used by other functions to eliminate duplication.
public
static queryMembers([string $query_where = null ][, array<string|int, mixed> $query_where_params = [] ][, string|int $query_limit = '' ][, string $query_order = 'id_member DESC' ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_queryMembers()
Parameters
- $query_where : string = null
-
The info for the WHERE clause of the query
- $query_where_params : array<string|int, mixed> = []
-
The parameters for the WHERE clause
- $query_limit : string|int = ''
-
The number of rows to return or an empty string to return all
- $query_order : string = 'id_member DESC'
-
The info for the ORDER BY clause of the query
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of members, otherwise returns an array of info about them
Return values
void|array<string|int, mixed> —Displays a list of members or returns an array of info about them, depending on output_method.
queryPosts()
This handles actually pulling post info. Called from other functions to eliminate duplication.
public
static queryPosts([string $query_where = '' ][, array<string|int, mixed> $query_where_params = [] ][, int $query_limit = 10 ][, string $query_order = 'm.id_msg DESC' ][, string $output_method = 'echo' ][, bool $limit_body = false ][, bool|false $override_permissions = false ]) : void|array<string|int, mixed>
Alias: ssi_queryPosts()
Parameters
- $query_where : string = ''
-
The WHERE clause for the query
- $query_where_params : array<string|int, mixed> = []
-
An array of parameters for the WHERE clause
- $query_limit : int = 10
-
The maximum number of rows to return
- $query_order : string = 'm.id_msg DESC'
-
The ORDER BY clause for the query
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the posts, otherwise returns an array of info about them.
- $limit_body : bool = false
-
If true, will only show the first 384 characters of the post rather than all of it
- $override_permissions : bool|false = false
-
Whether or not to ignore permissions. If true, will show all posts regardless of whether the user can actually see them
Return values
void|array<string|int, mixed> —Displays the posts or returns an array of info about them, depending on output_method
quickSearch()
Shows a search box
public
static quickSearch([string $output_method = 'echo' ]) : void|string
Alias: ssi_quickSearch()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a search box, otherwise returns the URL of the search page.
Return values
void|string —Displays a search box or returns the URL to the search page depending on output_method. If you don't have permission to search, the function won't return anything.
randomMember()
Fetches a random member.
public
static randomMember([string $random_type = '' ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_randomMember()
Parameters
- $random_type : string = ''
-
If 'day', only fetches a new random member once a day.
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a link to the member's profile, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a link to a random member's profile or returns an array of info about them depending on output_method.
recentAttachments()
Shows the most recent attachments that the user can see
public
static recentAttachments([int $num_attachments = 10 ][, array<string|int, mixed> $attachment_ext = [] ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_recentAttachments()
Parameters
- $num_attachments : int = 10
-
How many to show
- $attachment_ext : array<string|int, mixed> = []
-
Only shows attachments with the specified extensions ('jpg', 'gif', etc.) if set
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a table with links/info, otherwise returns an array with information about the attachments
Return values
void|array<string|int, mixed> —Displays a table of attachment info or returns an array containing info about the attachments, depending on output_method.
recentEvents()
Show the most recent events
public
static recentEvents([int $max_events = 7 ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_recentEvents()
Parameters
- $max_events : int = 7
-
The maximum number of events to show
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the events, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays the events or returns an array of info about them, depending on output_method.
recentPoll()
Shows the most recent poll
public
static recentPoll([bool $topPollInstead = false ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_recentPoll()
Parameters
- $topPollInstead : bool = false
-
Whether to show the top poll (based on votes) instead of the most recent one
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the poll, otherwise returns an array of info about it.
Return values
void|array<string|int, mixed> —Either shows the poll or returns an array of info about it, depending on output_method.
recentPosts()
Recent post list: [board] Subject by Poster Date
public
static recentPosts([int $num_recent = 8 ][, null|array<string|int, mixed> $exclude_boards = null ][, null|array<string|int, mixed> $include_boards = null ][, string $output_method = 'echo' ][, bool $limit_body = true ]) : void|array<string|int, mixed>
Alias: ssi_recentPosts()
Parameters
- $num_recent : int = 8
-
How many recent posts to display
- $exclude_boards : null|array<string|int, mixed> = null
-
If set, doesn't show posts from the specified boards
- $include_boards : null|array<string|int, mixed> = null
-
If set, only includes posts from the specified boards
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the posts, otherwise returns an array of information about them.
- $limit_body : bool = true
-
Whether or not to only show the first 384 characters of each post
Return values
void|array<string|int, mixed> —Displays a list of recent posts or returns an array of information about them depending on output_method.
recentTopics()
Recent topic list: [board] Subject by Poster Date
public
static recentTopics([int $num_recent = 8 ][, null|array<string|int, mixed> $exclude_boards = null ][, null|array<string|int, mixed> $include_boards = null ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_recentTopics()
Parameters
- $num_recent : int = 8
-
How many recent topics to show
- $exclude_boards : null|array<string|int, mixed> = null
-
If set, exclude topics from the specified board(s)
- $include_boards : null|array<string|int, mixed> = null
-
If set, only include topics from the specified board(s)
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them
Return values
void|array<string|int, mixed> —Either displays a list of topics or returns an array of info about them, depending on output_method.
showPoll()
Shows the poll from the specified topic
public
static showPoll([null|int $topic = null ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_showPoll()
Parameters
- $topic : null|int = null
-
The topic to show the poll from. If null, $_REQUEST['ssi_topic'] will be used instead.
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the poll, otherwise returns an array of info about it.
Return values
void|array<string|int, mixed> —Either displays the poll or returns an array of info about it, depending on output_method.
shutdown()
This shuts down the SSI and shows the footer.
public
static shutdown() : mixed
Alias: ssi_shutdown()
softwareYear()
Show the SMF software year.
public
static softwareYear([string $output_method = 'echo' ]) : void|string
Alias: ssi_software_year()
Parameters
- $output_method : string = 'echo'
-
If 'echo', displays the software year, otherwise returns it
Return values
void|string —Returns nothing if output_method is 'echo', otherwise returns the software year
todaysBirthdays()
Show today's birthdays.
public
static todaysBirthdays([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_todaysBirthdays()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of users, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a list of users or returns an array of info about them depending on output_method.
todaysCalendar()
Shows today's calendar items (events, birthdays and holidays)
public
static todaysCalendar([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_todaysCalendar()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of calendar items, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a list of calendar items or returns an array of info about them depending on output_method
todaysEvents()
Shows today's events.
public
static todaysEvents([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_todaysEvents()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of events, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a list of events or returns an array of info about them depending on output_method
todaysHolidays()
Shows today's holidays.
public
static todaysHolidays([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_todaysHolidays()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of holidays, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a list of holidays or returns an array of info about them depending on output_method
topBoards()
Shows a list of top boards based on activity
public
static topBoards([int $num_top = 10 ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_topBoards()
Parameters
- $num_top : int = 10
-
How many boards to display
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of boards, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Displays a list of the top boards or returns an array of info about them, depending on output_method.
topPoll()
Show the top poll based on votes
public
static topPoll([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_topPoll()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays the poll, otherwise returns an array of info about it
Return values
void|array<string|int, mixed> —Either shows the top poll or returns an array of info about it, depending on output_method.
topPoster()
Shows a list of top posters
public
static topPoster([int $topNumber = 1 ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_topPoster()
Parameters
- $topNumber : int = 1
-
How many top posters to list
- $output_method : string = 'echo'
-
The output method. If 'echo', will display a list of users, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Either displays a list of users or returns an array of info about them, depending on output_method.
topTopics()
Shows a list of top topics based on views or replies
public
static topTopics([string $type = 'replies' ][, int $num_topics = 10 ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_topTopics()
Parameters
- $type : string = 'replies'
-
Can be either replies or views
- $num_topics : int = 10
-
How many topics to display
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them.
Return values
void|array<string|int, mixed> —Either displays a list of topics or returns an array of info about them, depending on output_method.
topTopicsReplies()
Top topics based on replies
public
static topTopicsReplies([int $num_topics = 10 ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_topTopicsReplies()
Parameters
- $num_topics : int = 10
-
How many topics to show
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them
Return values
void|array<string|int, mixed> —Either displays a list of top topics or returns an array of info about them, depending on output_method.
topTopicsViews()
Top topics based on views
public
static topTopicsViews([int $num_topics = 10 ][, string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_topTopicsViews()
Parameters
- $num_topics : int = 10
-
How many topics to show
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them
Return values
void|array<string|int, mixed> —Either displays a list of top topics or returns an array of info about them, depending on output_method.
version()
Show the SMF version.
public
static version([string $output_method = 'echo' ]) : void|string
Alias: ssi_version()
Parameters
- $output_method : string = 'echo'
-
If 'echo', displays the version, otherwise returns it
Return values
void|string —Returns nothing if output_method is 'echo', otherwise returns the version
welcome()
Display a welcome message, like: Hey, User, you have 0 messages, 0 are new.
public
static welcome([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Alias: ssi_welcome()
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', will display everything. Otherwise returns an array of user info.
Return values
void|array<string|int, mixed> —Displays a welcome message or returns an array of user data depending on output_method.
whosOnline()
Shows a list of online users: YY Guests, ZZ Users and then a list... Alias: ssi_whosOnline()
public
static whosOnline([string $output_method = 'echo' ]) : void|array<string|int, mixed>
Parameters
- $output_method : string = 'echo'
-
The output method. If 'echo', displays a list, otherwise returns an array of info about the online users.
Return values
void|array<string|int, mixed> —Either displays a list of online users or returns an array of info about them, depending on output_method.