DB_SCRIPT_VERSION
public
mixed
DB_SCRIPT_VERSION
= '3-0'
public
mixed
DB_SCRIPT_VERSION
= '3-0'
Simple Machines Forum (SMF)
public
mixed
DEBUG_MODE
= \false
public
mixed
ERR_READ_FAILED
= 3
public
mixed
ERR_SELECT_FAILED
= 1
public
mixed
ERR_TIMEOUT
= 2
public
mixed
ERR_WRITE_FAILED
= 4
public
mixed
EXPORTING
= 1
public
mixed
FROM_CLI
= Sapi::isCLI()
public
mixed
IMAGETYPE_AVIF
= 19
public
mixed
JQUERY_VERSION
= '3.6.3'
public
mixed
JQUERY_VERSION
= '3.6.3'
public
mixed
JQUERY_VERSION
= '3.6.3'
public
mixed
MAX_CLAIM_THRESHOLD
= self::MAX_CLAIM_THRESHOLD
public
mixed
MAX_CRON_TIME
= self::MAX_CRON_TIME
public
mixed
MB_CASE_LOWER
= 1
public
mixed
MB_CASE_TITLE
= 2
public
mixed
MB_CASE_UPPER
= 0
public
mixed
MYSQL_TITLE
= 'MySQL'
public
mixed
MYSQL_TITLE
= 'MySQL'
public
mixed
MYSQL_TITLE
= 'MySQL'
public
mixed
POSTGRE_TITLE
= 'PostgreSQL'
public
mixed
POSTGRE_TITLE
= 'PostgreSQL'
public
mixed
POSTGRE_TITLE
= 'PostgreSQL'
public
mixed
SMF
= 'BACKGROUND'
public
mixed
SMF
= 1
public
mixed
SMF
= 1
public
mixed
SMF
= basename(__FILE__)
public
mixed
SMF
= 'BACKGROUND'
public
mixed
SMF
= 1
public
mixed
SMF
= 'PROXY'
public
mixed
SMF
= 'SSI'
public
mixed
SMF_FULL_VERSION
= 'SMF ' . \SMF_VERSION
public
mixed
SMF_FULL_VERSION
= 'SMF ' . \SMF_VERSION
public
mixed
SMF_FULL_VERSION
= 'SMF ' . \SMF_VERSION
public
mixed
SMF_INSTALLING
= 1
public
mixed
SMF_INSTALLING
= 1
public
mixed
SMF_LANG_VERSION
= '3.0 Alpha 2'
public
mixed
SMF_SETTINGS_BACKUP_FILE
= \dirname(\SMF_SETTINGS_FILE) . '/' . \pathinfo(\SMF_SETTINGS_FILE, \PATHINFO_FILENAME) . '_bak.php'
public
mixed
SMF_SETTINGS_BACKUP_FILE
= __DIR__ . '/Settings_bak.php'
public
mixed
SMF_SETTINGS_BACKUP_FILE
= dirname(SMF_SETTINGS_FILE) . '/' . pathinfo(SMF_SETTINGS_FILE, PATHINFO_FILENAME) . '_bak.php'
public
mixed
SMF_SETTINGS_FILE
= __DIR__ . '/Settings.php'
public
mixed
SMF_SETTINGS_FILE
= __DIR__ . '/Settings.php'
public
mixed
SMF_SETTINGS_FILE
= $settingsFile
public
mixed
SMF_SOFTWARE_YEAR
= '2025'
public
mixed
SMF_SOFTWARE_YEAR
= '2025'
public
mixed
SMF_SOFTWARE_YEAR
= $matches[1]
public
mixed
SMF_SOFTWARE_YEAR
= '2025'
public
mixed
SMF_UNICODE_VERSION
= '16.0.0.0'
public
mixed
SMF_USER_AGENT
= 'Mozilla/5.0 (' . \php_uname('s') . ' ' . \php_uname('m') . ') AppleWebKit/605.1.15 (KHTML, like Gecko) SMF/' . \strtr(\SMF_VERSION, ' ', '.')
public
mixed
SMF_USER_AGENT
= 'Mozilla/5.0 (' . \php_uname('s') . ' ' . \php_uname('m') . ') AppleWebKit/605.1.15 (KHTML, like Gecko) SMF/' . \strtr(\SMF_VERSION, ' ', '.')
public
mixed
SMF_USER_AGENT
= 'SMF'
public
mixed
SMF_USER_AGENT
= 'SMF'
public
mixed
SMF_USER_AGENT
= 'Mozilla/5.0 (' . \php_uname('s') . ' ' . \php_uname('m') . ') AppleWebKit/605.1.15 (KHTML, like Gecko) SMF/' . \strtr(\SMF_VERSION, ' ', '.')
public
mixed
SMF_VERSION
= '3.0 Alpha 2'
public
mixed
SMF_VERSION
= '3.0 Alpha 2'
public
mixed
SMF_VERSION
= $matches[1]
public
mixed
SMF_VERSION
= '3.0 Alpha 2'
public
mixed
TIME_START
= \microtime(\true)
public
mixed
TIME_START
= \microtime(\true)
public
mixed
TIME_START
= \microtime(\true)
public
mixed
TIME_START
= \microtime(\true)
initialize_inputs() : mixed
load_lang_file() : mixed
load_database() : mixed
installExit([mixed $fallThrough = false ]) : mixed
Welcome() : mixed
CheckFilesWritable() : mixed
DatabaseSettings() : mixed
ForumSettings() : mixed
DatabasePopulation() : mixed
AdminAccount() : mixed
DeleteInstall() : mixed
installer_updateSettingsFile(mixed $vars[, mixed $rebuild = false ]) : mixed
fixModSecurity() : mixed
template_install_above() : mixed
template_install_below() : mixed
template_welcome_message() : mixed
template_warning_divs() : mixed
template_chmod_files() : mixed
template_database_settings() : mixed
template_forum_settings() : mixed
template_populate_database() : mixed
template_admin_account() : mixed
template_delete_install() : mixed
getFiles(string $dir) : array<string|int, mixed>
Clean the cache using the SMF 2.1 CacheAPI.
upgrade_clean_cache() : mixed
If coming from SMF 2.0 and below it should wipe the cache using the SMF backend.
Returns a list of member groups. Used to upgrade 1.0 and 1.1.
getMemberGroups() : array<string|int, mixed>
Make files writable. First try to use regular chmod, but if that fails, try to use FTP.
makeFilesWritable(mixed &$files) : bool
The quick version of makeFilesWritable, which does not support FTP.
quickFileWritable(string $file) : bool
Delete a file. Check permissions first, just in case.
deleteFile(string $file) : mixed
Prints an error to stderr.
print_error(mixed $message[, bool $fatal = false ]) : mixed
Throws a graphical error message.
throw_error(mixed $message) : bool
smf_mysql_fetch_assoc(mixed $rs) : array<string|int, mixed>|null
smf_mysql_fetch_row(mixed $rs) : array<string|int, mixed>|null
smf_mysql_free_result(mixed $rs) : mixed
smf_mysql_insert_id([mixed $rs = null ]) : int|string
Ignored
smf_mysql_num_rows(mixed $rs) : int
smf_mysql_real_escape_string(mixed $string) : mixed
array_column(mixed $input, mixed $column_key[, mixed $index_key = null ]) : mixed
Creates the json_encoded array for the current cache option.
upgradeCacheSettings() : string
a json_encoded array with the selected API options
upgradeExit([mixed $fallThrough = false ]) : mixed
findSettingsFile() : mixed
load_lang_file() : mixed
redirectLocation(mixed $location[, mixed $addForm = true ]) : mixed
loadEssentialData() : mixed
initialize_inputs() : mixed
WelcomeLogin() : mixed
checkFolders() : mixed
checkLogin() : mixed
UpgradeOptions() : mixed
BackupDatabase() : mixed
backupTable(mixed $table) : mixed
DatabaseChanges() : mixed
setSqlMode([mixed $strict = true ]) : mixed
DeleteUpgrade() : mixed
addBackgroundTasks() : mixed
cli_scheduled_fetchSMfiles() : mixed
convertSettingsToTheme() : mixed
convertSettingstoOptions() : mixed
php_version_check() : mixed
db_version_check() : mixed
fixRelativePath(mixed $path) : mixed
parse_sql(mixed $filename) : mixed
upgrade_query(mixed $string[, mixed $unbuffered = false ]) : mixed
protected_alter(mixed $change, mixed $substep[, mixed $is_test = false ]) : mixed
Alter a text column definition preserving its character set.
textfield_alter(array<string|int, mixed> $change, int $substep) : mixed
nextSubstep(mixed $substep) : mixed
cmdStep0() : mixed
Handles converting your database to UTF-8
ConvertUtf8() : mixed
Wrapper for unserialize that attempts to repair corrupted serialized data strings
upgrade_unserialize(string $string) : string|bool
Serialized data that may or may not have been corrupted
The unserialized data, or false if the repair failed
serialize_to_json() : mixed
Cleanup() : mixed
CleanupLanguages() : mixed
CleanupAgreements() : mixed
template_chmod() : mixed
template_upgrade_above() : mixed
template_upgrade_below() : mixed
template_xml_above() : mixed
template_xml_below() : mixed
template_error_message() : mixed
template_welcome_message() : mixed
template_upgrade_options() : mixed
template_backup_database() : mixed
template_backup_xml() : mixed
template_database_changes() : mixed
template_database_xml() : mixed
template_convert_utf8() : mixed
template_convert_xml() : mixed
template_serialize_json() : mixed
template_serialize_json_xml() : mixed
template_cleanup() : mixed
template_cleanup_xml() : mixed
template_upgrade_complete() : mixed
Convert MySQL (var)char ip col to binary
MySQLConvertOldIp(string $targetTable, string $oldCol, string $newCol[, int $limit = 50000 ][, int $setSize = 100 ]) : void
newCol needs to be a varbinary(16) null able field
The table to perform the operation on
The old column to gather data from
The new column to put data in
The amount of entries to handle at once.
The amount of entries after which to update the database.
Get the column info. This is basically the same as smf_db_list_columns but we get 1 column, force detail and other checks.
upgradeGetColumnInfo(string $targetTable, string $column) : array<string|int, mixed>
The table to perform the operation on
The column we are looking for.
Info on the table.
Activate an users account.
Activate() : mixed
Checks for mail changes, resends password if needed.
The main admin handling function.<br> It initialises all the basic context required for the admin center.<br> It passes execution onto the relevant admin section.<br> If the passed section is not found it shows the admin home page.
AdminMain() : mixed
Helper function, it sets up the context for database settings.
prepareDBSettingContext(array<string|int, mixed> &$config_vars) : void
An array of configuration variables
Helper function. Saves settings by putting them in Settings.php or saving them in the settings table.
saveSettings(array<string|int, mixed> &$config_vars) : void
An array of configuration variables
Helper function for saving database settings.
saveDbSettings(array<string|int, mixed> &$config_vars) : void
An array of configuration variables
Get a list of versions that are currently installed on the server.
getServerVersions(array<string|int, mixed> $checkFor) : array<string|int, mixed>
An array of what to check versions for - can contain one or more of 'gd', 'imagemagick', 'db_server', 'phpa', 'memcache', 'php' or 'server'
An array of versions (keys are same as what was in $checkFor, values are the versions)
Search through source, theme and language files to determine their version.
getFileVersions(array<string|int, mixed> &$versionOptions) : array<string|int, mixed>
Get detailed version information about the physical SMF files on the server.
An array of options. Can contain one or more of 'include_ssi', 'include_subscriptions', 'include_tasks' and 'sort_results'
An array of file version info.
Saves the admin's current preferences to the database.
updateAdminPreferences() : void
Send all the administrators a lovely email.
emailAdmins(string $template[, array<string|int, mixed> $replacements = [] ][, array<string|int, mixed> $additional_recipients = [] ]) : void
Which email template to use
An array of items to replace the variables in the template
An array of arrays of info for additional recipients. Should have 'id', 'email' and 'name' for each.
Question the verity of the admin by asking for his or her password.
adminLogin([string $type = 'admin' ]) : void
What login type is this - can be 'admin' or 'moderate'
Let's try keep the spam to a minimum ah Thantos?
ModifyAntispamSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
The main 'Attachments and Avatars' management function.
ManageAttachments() : mixed
This function is the entry point for index.php?action=admin;area=manageattachments and it calls a function based on the sub-action. It requires the manage_attachments permission.
Uses ManageAttachments template. Uses Admin language file. Uses template layer 'manage_files' for showing the tab bar.
Checks the status of an attachment directory and returns an array of the status key, if that status key signifies an error, and the file count.
attachDirStatus(string $dir, int $expected_files) : array<string|int, mixed>
The directory to check
How many files should be in that directory
An array containing the status of the directory, whether the number of files was what we expected and how many were in the directory
Allows to show/change attachment settings.
ManageAttachmentSettings([bool $return_config = false ]) : array<string|int, mixed>|null
This is the default sub-action of the 'Attachments and Avatars' center. Called by index.php?action=admin;area=manageattachments;sa=attachments. Uses 'attachments' sub template.
Whether to return the array of config variables (used for admin search)
If $return_config is true, simply returns the config_vars array, otherwise returns nothing
This allows to show/change avatar settings.
ManageAvatarSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Called by index.php?action=admin;area=manageattachments;sa=avatars. Show/set permissions for permissions: 'profile_server_avatar', 'profile_upload_avatar' and 'profile_remote_avatar'.
Whether to return the config_vars array (used for admin search)
Returns the config_vars array if $return_config is true, otherwise returns nothing
Show a list of attachment or avatar files.
BrowseFiles() : void
Called by ?action=admin;area=manageattachments;sa=browse for attachments and ?action=admin;area=manageattachments;sa=browse;avatars for avatars. Allows sorting by name, date, size and member. Paginates results.
Show several file maintenance options.
MaintainFiles() : void
Called by ?action=admin;area=manageattachments;sa=maintain. Calculates file statistics (total file size, number of attachments, number of avatars, attachment space available).
Remove a selection of attachments or avatars.
RemoveAttachment() : void
Called from the browse screen as submitted form by ?action=admin;area=manageattachments;sa=remove
Remove attachments older than a given age.
RemoveAttachmentByAge() : void
Called from the maintenance screen by ?action=admin;area=manageattachments;sa=byAge. It optionally adds a certain text to the messages the attachments were removed from.
Remove attachments larger than a given size.
RemoveAttachmentBySize() : void
Called from the maintenance screen by ?action=admin;area=manageattachments;sa=bySize. Optionally adds a certain text to the messages the attachments were removed from.
Removes all attachments in a single click Called from the maintenance screen by ?action=admin;area=manageattachments;sa=removeall.
RemoveAllAttachments() : void
This function should find attachments in the database that no longer exist and clear them, and fix filesize issues.
RepairAttachments() : void
This function lists and allows updating of multiple attachments paths.
ManageAttachmentPaths() : void
Maintance function to move attachments from one directory to another
TransferAttachments() : void
Ban center. The main entrance point for all ban center functions.
Ban() : void
It is accesssed by ?action=admin;area=ban. It choses a function based on the 'sa' parameter, like many others. The default sub-action is BanList(). It requires the ban_members permission. It initializes the admin tabs.
Uses ManageBans template.
As it says... this tries to review the list of banned members, to match new bans.
updateBanMembers() : void
Note: is_activated >= 10: a member is banned.
Shows a list of bans currently set.
BanList() : void
It is accessed by ?action=admin;area=ban;sa=list. It removes expired bans. It allows sorting on different criteria. It also handles removal of selected ban items.
Uses the main ManageBans template.
This function is behind the screen for adding new bans and modifying existing ones.
BanEdit() : void
Adding new bans: - is accessed by ?action=admin;area=ban;sa=add. - uses the ban_edit sub template of the ManageBans template. Modifying existing bans:
This handles the screen for showing the banned entities It is accessed by ?action=admin;area=ban;sa=browse It uses sub-tabs for browsing by IP, hostname, email or username.
BanBrowseTriggers() : void
Uses a standard list (@see createList())
This function handles the ins and outs of the screen for adding new ban triggers or modifying existing ones.
BanEditTrigger() : void
Adding new ban triggers: - is accessed by ?action=admin;area=ban;sa=edittrigger;bg=x - uses the ban_edit_trigger sub template of ManageBans. Editing existing ban triggers:
This handles the listing of ban log entries, and allows their deletion.
BanLog() : void
Shows a list of logged access attempts by banned users. It is accessed by ?action=admin;area=ban;sa=log. How it works:
The main dispatcher; doesn't do anything, just delegates.
ManageBoards() : void
This is the main entry point for all the manageboards admin screens. Called by ?action=admin;area=manageboards. It checks the permissions, based on the sub-action, and calls a function based on the sub-action.
Uses ManageBoards language file.
A screen to set a few general board and category settings.
EditBoardSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether to return the $config_vars array (used for admin search)
Returns nothing or the array of config vars if $return_config is true
The main controlling function doesn't have much to do... yet.
ManageCalendar() : void
Just check permissions and delegate to the rest.
Uses ManageCalendar language file.
The function that handles adding, and deleting holiday data
ModifyHolidays() : void
This function is used for adding/editing a specific holiday
EditHoliday() : void
Show and allow to modify calendar settings. Obviously.
ModifyCalendarSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether to return the $config_vars array (used for admin search)
Returns nothing or returns $config_vars if $return_config is true
This ends a admin session, requiring authentication to access the ACP again.
AdminEndSession() : void
View the forum's error log.
ViewErrorLog() : void
This function sets all the context up to show the error log for maintenance. It requires the maintain_forum permission. It is accessed from ?action=admin;area=logs;sa=errorlog.
This function passes control through to the relevant tab.
ModifyFeatureSettings() : void
Config array for changing the basic forum settings Accessed from ?action=admin;area=featuresettings;sa=basic;
ModifyBasicSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Set a few Bulletin Board Code settings. It loads a list of Bulletin Board Code tags to allow disabling tags.
ModifyBBCSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Requires the admin_forum permission. Accessed from ?action=admin;area=featuresettings;sa=bbc.
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Allows modifying the global layout settings in the forum Accessed through ?action=admin;area=featuresettings;sa=layout;
ModifyLayoutSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
You'll never guess what this function does.
ModifySignatureSettings([bool $return_config = false ]) : array<string|int, mixed>|null
..
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Show all the custom profile fields available to the user.
ShowCustomProfiles() : void
Edit some profile fields?
EditCustomProfiles() : void
Config array for changing like settings Accessed from ?action=admin;area=featuresettings;sa=likes;
ModifyLikesSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array
Returns nothing or returns the $config_vars array if $return_config is true
Config array for changing like settings Accessed from ?action=admin;area=featuresettings;sa=mentions;
ModifyMentionsSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Handles modifying the alerts settings
ModifyAlertsSettings() : void
This function allocates out all the search stuff.
AdminSearch() : void
The main administration section.
AdminHome() : void
It prepares all the data necessary for the administration front page. It uses the Admin template along with the admin sub template. It requires the moderate_forum, manage_membergroups, manage_bans, admin_forum, manage_permissions, manage_attachments, manage_smileys, manage_boards, edit_news, or send_mail permission. It uses the index administrative area. It can be found by going to ?action=admin.
This is the main function for the languages area.
ManageLanguages() : void
It dispatches the requests. Loads the ManageLanguages template. (sub-actions will use it)
This lists all the current languages and allows editing of them.
ModifyLanguages() : void
Interface for adding a new language
AddLanguage() : void
Edit language related settings.
ModifyLanguageSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether to return the $config_vars array (used in admin search)
Returns nothing or the $config_vars array if $return_config is true
Download a language file from the Simple Machines website.
DownloadLanguage() : void
Requires a valid download ID ("did") in the URL. Also handles installing language files. Attempts to chmod things as needed. Uses a standard list to display information about all the files and where they'll be put.
Edit a particular set of language entries.
ModifyLanguage() : void
This function decides which log to load.
AdminLogs([bool $return_config = false ]) : array<string|int, mixed>|null
Main dispatcher. This function checks permissions and passes control through to the relevant section.
ManageMail() : void
Display the mail queue.
BrowseMailQueue() : void
..
This function clears the mail queue of all emails, and at the end redirects to browse.
ClearMailQueue() : void
Allows to view and modify the mail settings.
ModifyMailSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether to return the $config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Test mail sending ability.
TestMailSend() : void
Main dispatcher, the maintenance access point.
ManageMaintenance() : void
This, as usual, checks permissions, loads language files, and forwards to the actual workers.
Callback function for the integration hooks list (list_integration_hooks) Gets all of the hooks in the system and their status
get_integration_hooks_data(int $start, int $per_page, string $sort, array<string|int, mixed> $filtered_hooks, string $normalized_boarddir, string $normalized_sourcedir) : array<string|int, mixed>
The item to start with (for pagination purposes)
How many items to display on each page
A string indicating how to sort things
An array of information about the integration hooks
This function is used to reassociate members with relevant posts.
reattributePosts(int $memID[, bool|string $email = null ][, bool|string $membername = null ][, bool $post_count = false ]) : array<string|int, mixed>
Reattribute guest posts to a specified member. Does not check for any permissions. If add_to_post_count is set, the member's post count is increased.
The ID of the original poster
If set, should be the email of the poster
If set, the membername of the poster
Whether to adjust post counts
An array containing the number of messages, topics and reports updated
Supporting function for the routine maintenance area.
MaintainRoutine() : void
Supporting function for the database maintenance area.
MaintainDatabase() : void
Supporting function for the members maintenance area.
MaintainMembers() : void
Supporting function for the topics maintenance area.
MaintainTopics() : void
Generates a list of integration hooks for display Accessed through ?action=admin;area=maintain;sa=hooks; Allows for removal or disabling of selected hooks
list_integration_hooks() : void
Perform a detailed version check. A very good thing ;).
VersionDetail() : void
The function parses the comment headers in all files for their version information, and outputs that for some javascript to check with simplemachines.org. It does not connect directly with simplemachines.org, but rather expects the client to.
It requires the admin_forum permission. Uses the view_versions admin area. Accessed through ?action=admin;area=maintain;sa=routine;activity=version.
Find and fix all errors on the forum.
MaintainFindFixErrors() : void
Recount many forum totals that can be recounted automatically without harm.
AdminBoardRecount() : void
it requires the admin_forum permission. It shows the maintain_forum admin area.
Totals recounted:
The function redirects back to ?action=admin;area=maintain when complete. It is accessed via ?action=admin;area=maintain;sa=database;activity=recount.
Rebuilds Settings.php to make it nice and pretty.
RebuildSettingsFile() : void
Empties all uninmportant logs
MaintainEmptyUnimportantLogs() : void
Wipes the whole cache.
MaintainCleanCache() : void
Optimizes all tables in the database and lists how much was saved.
OptimizeTables() : void
It requires the admin_forum permission. It shows as the maintain_forum admin area. It is accessed from ?action=admin;area=maintain;sa=database;activity=optimize. It also updates the optimize scheduled task such that the tables are not automatically optimized again too soon.
Converts HTML-entities to their UTF-8 character equivalents.
ConvertEntities() : void
This requires the admin_forum permission. Pre-condition: UTF-8 has been set as database and global character set.
It is divided in steps of 10 seconds. This action is linked from the maintenance screen (if applicable). It is accessed by ?action=admin;area=maintain;sa=database;activity=convertentities.
Convert the column "body" of the table {db_prefix}messages from TEXT to MEDIUMTEXT and vice versa.
ConvertMsgBody() : void
It requires the admin_forum permission. This is needed only for MySQL. During the conversion from MEDIUMTEXT to TEXT it check if any of the posts exceed the TEXT length and if so it aborts. This action is linked from the maintenance screen (if it's applicable). Accessed by ?action=admin;area=maintain;sa=database;activity=convertmsgbody.
Re-attribute posts.
MaintainReattributePosts() : void
Removing old members. Done and out!
MaintainPurgeInactiveMembers() : void
Recalculate all members post counts it requires the admin_forum permission.
MaintainRecountPosts() : void
The function redirects back to action=admin;area=maintain;sa=members when complete. It is accessed via ?action=admin;area=maintain;sa=members;activity=recountposts
Moves topics from one board to another.
MaintainMassMoveTopics() : void
Removing old posts doesn't take much as we really pass through.
MaintainRemoveOldPosts() : void
Removing old drafts
MaintainRemoveOldDrafts() : void
Main dispatcher, the entrance point for all 'Manage Membergroup' actions.
ModifyMembergroups() : void
It forwards to a function based on the given subaction, default being subaction 'index', or, without manage_membergroup permissions, then 'settings'. Called by ?action=admin;area=membergroups. Requires the manage_membergroups or the admin_forum permission.
Uses ManageMembergroups template. Uses ManageMembers language file.
This function handles adding a membergroup and setting some initial properties.
AddMemberGroup() : void
Called by ?action=admin;area=membergroups;sa=add. It requires the manage_membergroups permission. Allows to use a predefined permission profile or copy one from another group. Redirects to action=admin;area=membergroups;sa=edit;group=x.
Deleting a membergroup by URL (not implemented).
DeleteMembergroup() : void
Called by ?action=admin;area=membergroups;sa=delete;group=x;session_var=y. Requires the manage_membergroups permission. Redirects to ?action=admin;area=membergroups.
Editing a membergroup.
EditMembergroup() : void
Screen to edit a specific membergroup. Called by ?action=admin;area=membergroups;sa=edit;group=x. It requires the manage_membergroups permission. Also handles the delete button of the edit form. Redirects to ?action=admin;area=membergroups.
Shows an overview of the current membergroups.
MembergroupIndex() : void
Called by ?action=admin;area=membergroups. Requires the manage_membergroups permission. Splits the membergroups in regular ones and post count based groups. It also counts the number of members part of each membergroup.
Uses ManageMembergroups template, main.
Set some general membergroup settings and permissions.
ModifyMembergroupsettings([bool $return_config = false ]) : array<string|int, mixed>|null
Called by ?action=admin;area=membergroups;sa=settings Requires the admin_forum permission (and manage_permissions for changing permissions) Redirects to itself.
The main entrance point for the Manage Members screen.
ViewMembers() : void
As everyone else, it calls a function based on the given sub-action. Called by ?action=admin;area=viewmembers. Requires the moderate_forum permission.
Uses ManageMembers template Uses ManageMembers language file.
View all members list. It allows sorting on several columns, and deletion of selected members. It also handles the search query sent by ?action=admin;area=viewmembers;sa=search.
ViewMemberlist() : void
Called by ?action=admin;area=viewmembers;sa=all or ?action=admin;area=viewmembers;sa=query. Requires the moderate_forum permission.
Uses a standard list (@see createList())
This function handles the approval, rejection, activation or deletion of members.
AdminApprove() : void
Called by ?action=admin;area=viewmembers;sa=approve. Requires the moderate_forum permission. Redirects to ?action=admin;area=viewmembers;sa=browse with the same parameters as the calling page.
List all members who are awaiting approval / activation, sortable on different columns.
MembersAwaitingActivation() : void
It allows instant approval or activation of (a selection of) members. Called by ?action=admin;area=viewmembers;sa=browse;type=approve or ?action=admin;area=viewmembers;sa=browse;type=activate. The form submits to ?action=admin;area=viewmembers;sa=approve. Requires the moderate_forum permission.
Search the member list, using one or more criteria.
SearchMembers() : void
Called by ?action=admin;area=viewmembers;sa=search. Requires the moderate_forum permission. form is submitted to action=admin;area=viewmembers;sa=query.
This my friend, is for all the mod authors out there.
ModifyModSettings([bool $return_config = false ]) : array<string|int, mixed>|null
The news dispatcher; doesn't do anything, just delegates.
ManageNews() : void
This is the entrance point for all News and Newsletter screens. Called by ?action=admin;area=news. It does the permission checks, and calls the appropriate function based on the requested sub-action.
Prepare subject and message of an email for the preview box Used in ComposeMailing and RetrievePreview (Xml.php)
prepareMailingForPreview() : void
Let the administrator(s) edit the news items for the forum.
EditNews() : void
It writes an entry into the moderation log. This function uses the edit_news administration area. Called by ?action=admin;area=news. Requires the edit_news permission. Can be accessed with ?action=admin;sa=editnews.
Uses a standard list (@see createList())
This function allows a user to select the membergroups to send their mailing to.
SelectMailingMembers() : void
Called by ?action=admin;area=news;sa=mailingmembers. Requires the send_mail permission. Form is submitted to ?action=admin;area=news;mailingcompose.
Shows a form to edit a forum mailing and its recipients.
ComposeMailing() : void
Called by ?action=admin;area=news;sa=mailingcompose. Requires the send_mail permission. Form is submitted to ?action=admin;area=news;sa=mailingsend.
Handles the sending of the forum mailing in batches.
SendMailing() : void
Called by ?action=admin;area=news;sa=mailingsend Requires the send_mail permission. Redirects to itself when more batches need to be sent. Redirects to ?action=admin;area=news;sa=mailingmembers after everything has been sent.
Set general news and newsletter settings and permissions.
ModifyNewsSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Called by ?action=admin;area=news;sa=settings. Requires the forum_admin permission.
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the config_vars array if $return_config is true
Dispatches to the right function based on the given subaction.
ModifyPermissions() : void
Checks the permissions, based on the sub-action. Called by ?action=managepermissions.
Uses ManagePermissions language file.
Show a collapsible box to set a specific permission.
theme_inline_permissions(string $permission) : void
The function is called by templates to show a list of permissions settings. Calls the template function template_inline_permissions().
The permission to display inline
Load permissions profiles.
loadPermissionProfiles() : void
This function updates the permissions of any groups based off this group.
updateChildPermissions([null|array<string|int, mixed> $parents = null ][, null|int $profile = null ]) : bool|null
The parent groups
the ID of a permissions profile to update
Returns nothing if successful or false if there are no child groups to update
Load permissions someone cannot grant.
loadIllegalPermissions() : array<string|int, mixed>
Sets up the permissions by membergroup index page.
PermissionIndex() : void
Called by ?action=managepermissions Creates an array of all the groups with the number of members and permissions.
Uses ManagePermissions language file. Uses ManagePermissions template file.
Handle permissions by board... more or less. :P
PermissionsByBoard() : void
Initializes the necessary to modify a membergroup's permissions.
ModifyMembergroup() : void
This function actually saves modifications to a membergroup's board permissions.
ModifyMembergroup2() : void
Handles permission modification actions from the upper part of the permission manager index.
SetQuickGroups() : void
Present a nice way of applying post moderation.
ModifyPostModeration() : void
Add/Edit/Delete profiles.
EditPermissionProfiles() : void
A screen to set some general settings for permissions.
GeneralPermissionSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether to return the $config_vars array (used for admin search)
Returns nothing or returns the config_vars array if $return_config is true
The main entrance point for the 'Posts and topics' screen.
ManagePostSettings() : void
Like all others, it checks permissions, then forwards to the right function based on the given sub-action. Defaults to sub-action 'posts'. Accessed from ?action=admin;area=postsettings. Requires (and checks for) the admin_forum permission.
Modify any setting related to posts and posting.
ModifyPostSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Requires the admin_forum permission. Accessed from ?action=admin;area=postsettings;sa=posts.
Whether or not to return the $config_vars array (used for admin search)
Returns nothing or returns the config_vars array if $return_config is true
Modify any setting related to topics.
ModifyTopicSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Requires the admin_forum permission. Accessed from ?action=admin;area=postsettings;sa=topics.
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns $config_vars if $return_config is true
Modify any setting related to drafts.
ModifyDraftSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Requires the admin_forum permission. Accessed from ?action=admin;area=postsettings;sa=drafts
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Entrance point for the registration center, it checks permissions and forwards to the right function based on the subaction.
RegCenter() : void
Accessed by ?action=admin;area=regcenter. Requires either the moderate_forum or the admin_forum permission.
Uses Login language file Uses Register template.
This function allows the admin to register a new member by hand.
AdminRegister() : void
It also allows assigning a primary group to the member being registered. Accessed by ?action=admin;area=regcenter;sa=register Requires the moderate_forum permission.
Allows the administrator to edit the registration agreement, and choose whether it should be shown or not. It writes and saves the agreement to the agreement.txt file.
EditAgreement() : void
Accessed by ?action=admin;area=regcenter;sa=agreement. Requires the admin_forum permission.
Sure, you can sell my personal info for profit (...or not)
EditPrivacyPolicy() : void
Set the names under which users are not allowed to register.
SetReserved() : void
Accessed by ?action=admin;area=regcenter;sa=reservednames. Requires the admin_forum permission.
This function handles registration settings, and provides a few pretty stats too while it's at it.
ModifyRegistrationSettings([bool $return_config = false ]) : array<string|int, mixed>|null
General registration settings and Coppa compliance settings. Accessed by ?action=admin;area=regcenter;sa=settings. Requires the admin_forum permission.
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Finds or repairs errors in the database to fix possible problems.
RepairBoards() : void
Requires the admin_forum permission. Calls createSalvageArea() to create a new board, if necessary. Accessed by ?action=admin;area=repairboards.
Handling function for generating reports.
ReportsMain() : void
Requires the admin_forum permission. Loads the Reports template and language files. Decides which type of report to generate, if this isn't passed through the querystring it will set the report_type sub-template to force the user to choose which type. When generating a report chooses which sub_template to use. Depends on the cal_enabled setting, and many of the other cal_ settings. Will call the relevant report generation function. If generating report will call finishTables before returning. Accessed through ?action=admin;area=reports.
Standard report about what settings the boards have.
BoardReport() : void
functions ending with "Report" are responsible for generating data for reporting. they are all called from ReportsMain. never access the context directly, but use the data handling functions to do so.
Generate a report on the current permissions by board and membergroup.
BoardPermissionsReport() : void
functions ending with "Report" are responsible for generating data for reporting. they are all called from ReportsMain. never access the context directly, but use the data handling functions to do so.
Show what the membergroups are made of.
MemberGroupsReport() : void
functions ending with "Report" are responsible for generating data for reporting. they are all called from ReportsMain. never access the context directly, but use the data handling functions to do so.
Show the large variety of group permissions assigned to each membergroup.
GroupPermissionsReport() : void
functions ending with "Report" are responsible for generating data for reporting. they are all called from ReportsMain. never access the context directly, but use the data handling functions to do so.
Report for showing all the forum staff members - quite a feat! functions ending with "Report" are responsible for generating data for reporting.
StaffReport() : void
they are all called from ReportsMain. never access the context directly, but use the data handling functions to do so.
Main entry point for the admin search settings screen.
ManageSearch() : void
It checks permissions, and it forwards to the appropriate function based on the given sub-action. Defaults to sub-action 'settings'. Called by ?action=admin;area=managesearch. Requires the admin_forum permission.
Uses ManageSearch template. Uses Search language file.
Edit some general settings related to the search function.
EditSearchSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Called by ?action=admin;area=managesearch;sa=settings. Requires the admin_forum permission.
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Edit the relative weight of the search factors.
EditWeights() : void
Called by ?action=admin;area=managesearch;sa=weights. Requires the admin_forum permission.
Edit the search method and search index used.
EditSearchMethod() : void
Calculates the size of the current search indexes in use. Allows to create and delete a fulltext index on the messages table. Allows to delete a custom index (that CreateMessageIndex() created). Called by ?action=admin;area=managesearch;sa=method. Requires the admin_forum permission.
Create a custom search index for the messages table.
CreateMessageIndex() : void
Called by ?action=admin;area=managesearch;sa=createmsgindex. Linked from the EditSearchMethod screen. Requires the admin_forum permission. Depending on the size of the message table, the process is divided in steps.
Entry point for this section.
SearchEngines() : void
This function takes any unprocessed hits and turns them into stats.
consolidateSpiderStats() : void
Recache spider names?
recacheSpiderNames() : void
Show the spider statistics.
SpiderStats() : void
See what spiders have been up to.
SpiderLogs() : void
View a list of all the spiders we know about.
ViewSpiders() : void
This is really just the settings page.
ManageSearchEngineSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Here we can add, and edit, spider info!
EditSpider() : void
This is the main dispatcher. Sets up all the available sub-actions, all the tabs and selects the appropriate one based on the sub-action.
ModifySettings() : void
Requires the admin_forum permission. Redirects to the appropriate function based on the sub-action.
Uses edit_settings adminIndex.
Helper function, it sets up the context for the manage server settings.
prepareServerSettingsContext(array<string|int, mixed> &$config_vars) : mixed
the following named keys are also permitted 'disabled' => A string of code that will determine whether or not the setting should be disabled 'postinput' => Text to display after the input field 'preinput' => Text to display before the input field 'subtext' => Additional descriptive text to display under the field's label 'min' => minimum allowed value (for int/float). Defaults to 0 if not set. 'max' => maximum allowed value (for int/float) 'step' => how much to increment/decrement the value by (only for int/float - mostly used for float values).
An array of configuration variables
General forum settings - forum name, maintenance mode, etc.
ModifyGeneralSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Practically, this shows an interface for the settings in Settings.php to be changed.
Whether to return the $config_vars array (for pagination purposes)
Returns nothing or returns the $config_vars array if $return_config is true
Basic database and paths settings - database name, host, etc.
ModifyDatabaseSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
This function handles cookies settings modifications.
ModifyCookieSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Settings really associated with general security aspects.
ModifyGeneralSecuritySettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Simply modifying cache functions
ModifyCacheSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Controls settings for data export functionality
ModifyExportSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Allows to edit load balancing settings.
ModifyLoadBalancingSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array
Returns nothing or returns the $config_vars array if $return_config is true
Allows us to see the servers php settings
ShowPHPinfoSettings() : void
This is the dispatcher of smileys administration.
ManageSmileys() : void
Handles modifying smileys settings.
EditSmileySettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
Add a smiley, that's right.
AddSmiley() : void
Add, remove, edit smileys.
EditSmileys() : void
Allows to edit smileys order.
EditSmileyOrder() : void
Install a smiley set.
InstallSmileySet() : void
Handles editing message icons
EditMessageIcons() : void
The main entrance point for the 'Paid Subscription' screen, calling the right function based on the given sub-action.
ManagePaidSubscriptions() : void
It defaults to sub-action 'view'. Accessed from ?action=admin;area=paidsubscribe. It requires admin_forum permission for admin based actions.
This just kind of caches all the subscription data.
loadSubscriptions() : array<string|int, mixed>
Add or extend a subscription of a user.
addSubscription(int $id_subscribe, int $id_member[, int|string $renewal = 0 ][, int $forceStartTime = 0 ][, int $forceEndTime = 0 ]) : void
The subscription ID
The ID of the member
0 if we're forcing start/end time, otherwise a string indicating how long to renew the subscription for ('D', 'W', 'M' or 'Y')
If set, forces the subscription to start at the specified time
If set, forces the subscription to end at the specified time
Removes a subscription from a user, as in removes the groups.
removeSubscription(int $id_subscribe, int $id_member[, bool $delete = false ]) : void
The ID of the subscription
The ID of the member
Whether to delete the subscription or just disable it
Reapplies all subscription rules for each of the users.
reapplySubscriptions(array<string|int, mixed> $users) : void
An array of user IDs
Load all the payment gateways.
loadPaymentGateways() : array<string|int, mixed>
Checks the Sources directory for any files fitting the format of a payment gateway, loads each file to check it's valid, includes each file and returns the function name and whether it should work with this version of SMF.
An array of information about available payment gateways
View a list of all the current subscriptions Requires the admin_forum permission.
ViewSubscriptions() : void
Accessed from ?action=admin;area=paidsubscribe;sa=view.
View all the users subscribed to a particular subscription.
ViewSubscribedUsers() : void
Requires the admin_forum permission. Accessed from ?action=admin;area=paidsubscribe;sa=viewsub.
Subscription ID is required, in the form of $_GET['sid'].
Adding, editing and deleting subscriptions.
ModifySubscription() : void
Accessed from ?action=admin;area=paidsubscribe;sa=modify.
Edit or add a user subscription.
ModifyUserSubscription() : void
Accessed from ?action=admin;area=paidsubscribe;sa=modifyuser.
Set any setting related to paid subscriptions, i.e.
ModifySubscriptionSettings([bool $return_config = false ]) : array<string|int, mixed>|null
modify which payment methods are to be used. It requires the moderate_forum permission Accessed from ?action=admin;area=paidsubscribe;sa=settings.
Whether or not to return the $config_vars array (used for admin search)
Returns nothing or returns the config_vars array if $return_config is true
Scheduled tasks management dispatcher. This function checks permissions and delegates to the appropriate function based on the sub-action.
ManageScheduledTasks() : void
Everything here requires admin_forum permission.
Uses ManageScheduledTasks template file Uses ManageScheduledTasks language file
List all the scheduled task in place on the forum.
ScheduledTasks() : void
Function for editing a task.
EditTask() : void
Show the log of all tasks that have taken place.
TaskLog() : void
Uses ManageScheduledTasks language file
This handles settings related to scheduled tasks
TaskSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config vars. Used in the admin search.
If return_config is true, returns the array of $config_vars
Subaction handler - manages the action and delegates control to the proper sub-action.
ThemesMain() : void
It loads both the Themes and Settings language files. Checks the session by GET or POST to verify the sent data. Requires the user not be a guest. (@todo what?) Accessed via ?action=admin;area=theme.
This function allows administration of themes and their settings, as well as global theme settings.
ThemeAdmin() : void
Uses Themes template Uses Admin language file
This function lists the available themes and provides an interface to reset the paths of all the installed themes.
ThemeList() : void
Administrative global settings.
SetThemeOptions() : void
Remove a theme from the database.
RemoveTheme() : void
Handles enabling/disabling a theme from the admin center
EnableTheme() : void
Installs new themes, calls the respective function according to the install type.
ThemeInstall() : void
Shows an interface for editing the templates.
EditTheme() : void
Makes a copy of a template file in a new location
CopyTemplate() : void
Moderation type settings - although there are fewer than we have you believe ;)
ModifyWarningSettings([bool $return_config = false ]) : array<string|int, mixed>|null
Whether or not to return the config_vars array (used for admin search)
Returns nothing or returns the $config_vars array if $return_config is true
This ends a moderator session, requiring authentication to access the MCP again.
ModEndSession() : void
This function basically is the home page of the moderation center.
ModerationHome() : void
Prepares the information from the moderation log for viewing.
ViewModlog() : void
Show the moderation log. If clearing the log, leaves a message in the log to indicate it was cleared, by whom and when. Requires the admin_forum permission. Accessed via ?action=moderate;area=modlog.
Uses Modlog template, main sub-template.
Entry point for the moderation center.
ModerationMain([bool $dont_call = false ]) : void
If true, just creates the menu and doesn't call the function for the appropriate mod area.
This is a handling function for all things post moderation.
PostModerationMain() : void
This is a helper function - basically approve everything!
approveAllData() : void
View all unapproved posts.
UnapprovedPosts() : void
View all unapproved attachments.
UnapprovedAttachments() : void
Approve a post, just the one.
ApproveMessage() : void
Sets and call a function based on the given subaction. Acts as a dispatcher function.
ReportedContent() : void
It requires the moderate_forum permission.
Uses ModerationCenter template. Uses ModerationCenter language file.
Recount all open reports. Sets a SESSION var with the updated info.
recountOpenReports(string $type) : int
the type of reports to count
the update open report count.
Shows all currently open reported posts.
ShowReports() : void
Handles closing multiple reports
Shows all currently closed reported posts.
ShowClosedReports() : void
Shows detailed information about a report. such as report comments and moderator comments.
ReportDetails() : void
Shows a list of moderation actions for the specific report.
Performs closing/ignoring actions for a given report.
HandleReport() : void
Creates/Deletes moderator comments.
HandleComment() : void
Shows a textarea for editing a moderator comment.
EditComment() : void
Handles the edited comment and stores it on the DB.
Show a notice sent to a user.
ShowNotice() : void
Entry point for viewing warning related stuff.
ViewWarnings() : void
Simply put, look at the warning log!
ViewWarningLog() : void
Load all the warning templates.
ViewWarningTemplates() : void
Edit a warning template.
ModifyWarningTemplate() : void
View watched users.
ViewWatchedUsers() : void
Handles the account section of the profile
account() : void
Activate an account.
activateAccount() : void
Set up the requirements for the alerts popup - the area that shows all the alerts just quickly for the current user.
alerts_popup() : void
Show all the users buddies, as well as a add/delete interface.
editBuddyIgnoreLists() : void
Show all the users buddies, as well as a add/delete interface.
editBuddies(int $memID) : void
The ID of the member
Allows the user to view their ignore list, as well as the option to manage members on it.
editIgnoreList(int $memID) : void
The ID of the member
Present a screen to make sure the user wants to be deleted
deleteAccount() : void
Actually delete an account.
deleteAccount2(int $memID) : void
The member ID
Initiates exports a member's profile, posts, and personal messages to a file.
export_profile_data() : void
Returns the path to a secure directory for storing exported profile data.
create_export_dir([string $fallback = '' ]) : string|bool
The directory is created if it does not yet exist, and is secured using the same method that we use to secure attachment directories. Files in this directory can only be downloaded via the download_export_file() function.
The path to the directory, or false on error.
Helper function that defines data export formats in a single location.
get_export_formats() : array<string|int, mixed>
Information about supported data formats for profile exports.
Allows a member to export their attachments.
export_attachment() : void
Mostly just a wrapper for showAttachment() but with a few tweaks.
Downloads exported profile data file.
download_export_file() : void
Handles the main "Forum Profile" section of the profile
forumProfile() : void
Function to allow the user to choose group membership etc.
groupMembership() : void
..
This function actually makes all the group changes
groupMembership2(array<string|int, mixed> $profile_vars, array<string|int, mixed> $post_errors, int $memID) : string
Note: $profile_vars and $post_errors were unused even in 2.1.
The profile variables. (Ignored.)
Any errors that have occurred. (Ignored.)
The ID of the member.
What type of change this is - 'primary' if changing the primary group, 'request' if requesting to join a group or 'free' if it's an open group
Handles the "ignored boards" section of the profile (if enabled)
ignoreboards(int $memID) : void
The ID of the member
Issue/manage an user's warning status.
issueWarning(int $memID) : void
The ID of the user
The main designating function for modifying profiles. Loads up info, determins what to do, etc.
ModifyProfile([array<string|int, mixed> $post_errors = [] ]) : void
Any errors that occurred
Display the notifications and settings for changes.
notification() : void
Handles configuration of alert preferences
alert_configuration(int $memID[, bool $defaultSettings = false ]) : void
The ID of the member
If true, we are loading default options.
Marks all alerts as read for the specified user
alert_markread(int $memID) : void
The ID of the member
Handles alerts related to topics and posts
alert_notifications_topics(int $memID) : void
The ID of the member
Handles preferences related to board-level notifications
alert_notifications_boards(int $memID) : void
The ID of the member
Make any notification changes that need to be made.
makeNotificationChanges(int $memID) : void
The ID of the member
Function for doing all the paid subscription stuff - kinda.
subscriptions() : void
Set up the requirements for the profile popup - the area that is shown as the popup menu for the current user.
profile_popup() : void
Shows all alerts for a member
showAlerts(int $memID) : void
The ID of the member
Shows which permissions a user has
showPermissions(int $memID) : void
The ID of the member
Show all posts by a member
showPosts(int $memID) : void
The ID of the member
Show all the unwatched topics.
showUnwatched(int $memID) : void
The ID of the member
Show all the attachments belonging to a member.
showAttachments(int $memID) : void
The ID of the member
Gets the user stats for display
statPanel(int $memID) : void
The ID of the member
View a summary.
summary(int $memID) : void
The ID of the member
Provides interface to disable two-factor authentication in SMF
tfadisable() : void
Provides interface to setup Two Factor Auth in SMF
tfasetup() : void
Handles the "Look and Layout" section of the profile
theme() : void
Loads up the information for the "track user" section of the profile
tracking() : void
Handles tracking a user's activity
trackActivity(int $memID) : void
The ID of the member
Tracks a user's profile edits
trackEdits(int $memID) : void
The ID of the member
Display the history of group requests made by the user whose profile we are viewing.
trackGroupReq(int $memID) : void
The ID of the member
Tracks a user's logins.
TrackLogins(int $memID) : void
The ID of the member
View a member's warnings
viewWarning(int $memID) : void
The ID of the member
Let's tell them there's a new agreement
Agreement() : void
Checks whether this user needs to accept the registration agreement.
canRequireAgreement() : bool
Whether they need to accept the agreement.
Checks whether this user needs to accept the privacy policy.
canRequirePrivacyPolicy() : bool
Whether they need to accept the policy.
I solemly swear to no longer chase squirrels.
AcceptAgreement() : void
Handle the announce topic function (action=announce).
AnnounceTopic() : void
checks the topic announcement permissions and loads the announcement template. requires the announce_topic permission. uses the ManageMembers template and Post language file. call the right function based on the sub-action.
Allow a user to chose the membergroups to send the announcement to.
AnnouncementSelectMembergroup() : void
lets the user select the membergroups that will receive the topic announcement.
Send the announcement in chunks.
AnnouncementSend() : void
splits the members to be sent a topic announcement into chunks. composes notification messages in all languages needed. does the actual sending of the topic announcements in chunks. calculates a rough estimate of the percentage items sent.
Called from a mouse click, works out what we want to do with attachments and actions it.
ApproveAttach() : void
Downloads an avatar or attachment based on $_GET['attach'], and increments the download count.
showAttachment() : void
It requires the view_attachments permission. It disables the session parser, and clears any previous output. It depends on the attachmentUploadDir setting being correct. It is accessed via the query string ?action=dlattach. Views to attachments do not increase hits and are not logged in the "Who's Online" log.
This keeps track of all registered handling functions for auto suggest functionality and passes execution to them.
AutoSuggestHandler([string|null $suggest_type = null ]) : bool|null
Returns whether the callback function is registered if $checkRegistered isn't null
Search for a member - by real_name or member_name by default.
AutoSuggest_Search_Member() : array<string|int, mixed>
An array of information for displaying the suggestions
Search for a membergroup by name
AutoSuggest_Search_MemberGroups() : array<string|int, mixed>
An array of information for displaying the suggestions
Provides a list of possible SMF versions to use in emulation
AutoSuggest_Search_SMFVersions() : array<string|int, mixed>
An array of data for displaying the suggestions
This function shows the board index.
BoardIndex() : BoardIndex
It uses the BoardIndex template, and main sub template. It updates the most online statistics. It is accessed by ?action=boardindex.
Fetches a list of boards and (optional) categories including statistical information, child boards and moderators.
getBoardIndex(array<string|int, mixed> $board_index_options) : array<string|int, mixed>
An array of boardindex options
An array of information for displaying the boardindex
This simple function adds/removes the passed user from the current users buddy list.
BuddyListToggle() : void
Requires profile_identity_own permission. Called by ?action=buddy;u=x;session_id=y. Redirects to ?action=profile;u=x.
Show the calendar.
CalendarMain() : void
It loads the specified month's events, holidays, and birthdays. It requires the calendar_view permission. It depends on the cal_enabled setting, and many of the other cal_ settings. It uses the calendar_start_day theme option. (Monday/Sunday) It uses the main sub template in the Calendar template. It goes to the month and year passed in 'month' and 'year' by get or post. It is accessed through ?action=calendar.
This function offers up a download of an event in iCal 2.0 format.
iCalDownload() : void
Follows the conventions in RFC5546 Sets events as all day events since we don't have hourly events Will honor and set multi day events Sets a sequence number if the event has been modified
This function processes posting/editing/deleting a calendar event.
CalendarPost() : void
It requires the calendar_post permission to use. It uses the event_post sub template in the Calendar template. It is accessed with ?action=calendar;sa=post.
Get all birthdays within the given time range.
getBirthdayRange(string $low_date, string $high_date) : array<string|int, mixed>
finds all the birthdays in the specified range of days. works with birthdays set for no year, or any other year, and respects month and year boundaries.
The low end of the range, inclusive, in YYYY-MM-DD format
The high end of the range, inclusive, in YYYY-MM-DD format
An array of days, each of which is an array of birthday information for the context
Get all calendar events within the given time range.
getEventRange(string $low_date, string $high_date[, bool $use_permissions = true ]) : array<string|int, mixed>
The low end of the range, inclusive, in YYYY-MM-DD format
The high end of the range, inclusive, in YYYY-MM-DD format
Whether to use permissions
Contextual information if use_permissions is true, and an array of the data needed to build that otherwise
Get all holidays within the given time range.
getHolidayRange(string $low_date, string $high_date) : array<string|int, mixed>
The low end of the range, inclusive, in YYYY-MM-DD format
The high end of the range, inclusive, in YYYY-MM-DD format
An array of days, which are all arrays of holiday names.
Does permission checks to see if an event can be linked to a board/topic.
canLinkEvent() : void
checks if the current user can link the current topic to the calendar, permissions et al. this requires the calendar_post permission, a forum moderator, or a topic starter. expects the $topic and $board variables to be set. if the user doesn't have proper permissions, an error will be shown.
Returns date information about 'today' relative to the users time offset.
getTodayInfo() : array<string|int, mixed>
returns an array with the current date, day, month, and year. takes the users time offset into account.
An array of info about today, based on forum time. Has 'day', 'month', 'year' and 'date' (in YYYY-MM-DD format)
Provides information (link, month, year) about the previous and next month.
getCalendarGrid(string $selected_date, array<string|int, mixed> $calendarOptions[, bool $is_previous = false ][, bool $has_picker = true ]) : array<string|int, mixed>
A date in YYYY-MM-DD format
An array of calendar options
Whether this is the previous month
Wheter to add javascript to handle a date picker
A large array containing all the information needed to show a calendar grid for the given month
Returns the information needed to show a calendar for the given week.
getCalendarWeek(string $selected_date, array<string|int, mixed> $calendarOptions) : array<string|int, mixed>
A date in YYYY-MM-DD format
An array of calendar options
An array of information needed to display the grid for a single week on the calendar
Returns the information needed to show a list of upcoming events, birthdays, and holidays on the calendar.
getCalendarList(string $start_date, string $end_date, array<string|int, mixed> $calendarOptions) : array<string|int, mixed>
The start of a date range in YYYY-MM-DD format
The end of a date range in YYYY-MM-DD format
An array of calendar options
An array of information needed to display a list of upcoming events, etc., on the calendar
Loads the necessary JavaScript and CSS to create a datepicker.
loadDatePicker([string $selector = 'input.date_input' ][, string $date_format = '' ]) : void
A CSS selector for the input field(s) that the datepicker should be attached to.
The date format to use, in strftime() format.
Loads the necessary JavaScript and CSS to create a timepicker.
loadTimePicker([string $selector = 'input.time_input' ][, string $time_format = '' ]) : void
A CSS selector for the input field(s) that the timepicker should be attached to.
A time format in strftime format
Loads the necessary JavaScript for Datepair.js.
loadDatePair(string $container[, string $date_class = '' ][, string $time_class = '' ]) : void
Datepair.js helps to keep date ranges sane in the UI.
CSS selector for the containing element of the date/time inputs to be paired.
The CSS class of the date inputs to be paired.
The CSS class of the time inputs to be paired.
Retrieve all events for the given days, independently of the users offset.
cache_getOffsetIndependentEvents(array<string|int, mixed> $eventOptions) : array<string|int, mixed>
cache callback function used to retrieve the birthdays, holidays, and events between now and now + days_to_index. widens the search range by an extra 24 hours to support time offset shifts. used by the cache_getRecentEvents function to get the information needed to calculate the events taking the users time offset into account.
With the keys 'num_days_shown', 'include_holidays', 'include_birthdays' and 'include_events'
An array containing the data that was cached as well as an expression to calculate whether the data should be refreshed and when it expires
cache callback function used to retrieve the upcoming birthdays, holidays, and events within the given period, taking into account the users time offset.
cache_getRecentEvents(array<string|int, mixed> $eventOptions) : array<string|int, mixed>
Called from the BoardIndex to display the current day's events on the board index used by the board index and SSI to show the upcoming events.
An array of event options.
An array containing the info that was cached as well as a few other relevant things
Makes sure the calendar post is valid.
validateEventPost() : void
Get the event's poster.
getEventPoster(int $event_id) : int|bool
The ID of the event
The ID of the poster or false if the event was not found
Remove a holiday from the calendar
removeHolidays(array<string|int, mixed> $holiday_ids) : void
An array of IDs of holidays to delete
This function will display the contact information for the forum, as well a form to fill in.
CoppaForm() : void
It prepares credit and copyright information for the credits page or the admin page
Credits([bool $in_admin = false ]) : void
= false, if parameter is true the it will not load the sub-template nor the template file
The central part of the board - topic display.
Display() : void
This function loads the posts in a topic up so they can be displayed. It uses the main sub template of the Display template. It requires a topic, and can go to the previous or next topic from it. It jumps to the correct post depending on a number/time/IS_MSG passed. It depends on the messages_per_page, defaultMaxMessages and enableAllMessages settings. It is accessed by ?topic=id_topic.START.
Get one of the admin information files from Simple Machines.
DisplayAdminFile() : void
Outputs xml data representing recent information or a profile.
ShowXmlFeed() : void
Can be passed subactions which decide what is output: 'recent' for recent posts, 'news' for news topics, 'members' for recently registered members, 'profile' for a member's profile. 'posts' for a member's posts. 'personal_messages' for a member's personal messages.
When displaying a member's profile or posts, the u parameter identifies which member. Defaults to the current user's id. To display a member's personal messages, the u parameter must match the id of the current user.
Outputs can be in RSS 0.92, RSS 2, Atom, RDF, or our own custom XML format. Default is RSS 2.
Accessed via ?action=.xml.
Does not use any templates, sub templates, or template layers.
Uses Stats, Profile, Post, and PersonalMessage language files.
Builds the XML from the data.
buildXmlFeed(string $format, array<string|int, mixed> $data, array<string|int, mixed> $metadata, string $subaction) : array<string|int, mixed>
Returns an array containing three parts: the feed's header section, its items section, and its footer section. For convenience, the array is also made available as SMF\Utils::$context['feed'].
This method is static for the sake of the ExportProfileData task, which needs to do a lot of custom manipulation of the XML.
A supported feed format.
Structured data to build as XML.
Metadata about the feed.
The sub-action that was requested.
The feed's header, items, and footer.
Ensures supplied data is properly encapsulated in cdata xml tags Called from getXmlProfile in News.php
cdata_parse(string $data[, string $ns = '' ][, bool $force = false ]) : string
XML data
A namespace prefix for the XML data elements (used by mods, maybe)
If true, enclose the XML data in cdata tags no matter what (used by mods, maybe)
The XML data enclosed in cdata tags when necessary
Called by index.php?action=findmember.
JSMembers() : void
Entry point function, permission checks, admin bars, etc.
Groups() : void
It allows moderators and users to access the group showing functions. It handles permission checks, and puts the moderation bar on as required.
Gets the members of a supplied membergroup Returns them as a link for display
listMembergroupMembers_Href(array<string|int, mixed> &$members, int $membergroup[, int $limit = null ]) : bool
The IDs of the members
The ID of the group
How many members to show (null for no limit)
True if there are more members to display, false otherwise
This very simply lists the groups, nothing snazy.
GroupList() : void
Display members of a group, and allow adding of members to a group. Silly function name though ;) It can be called from ManageMembergroups if it needs templating within the admin environment.
MembergroupMembers() : void
It shows a list of members that are part of a given membergroup. It is called by ?action=moderate;area=viewgroups;sa=members;group=x It requires the manage_membergroups permission. It allows to add and remove members from the selected membergroup. It allows sorting on several columns. It redirects to itself.
Show and manage all group requests.
GroupRequests() : void
Redirect to the user help ;).
ShowHelp() : void
It loads information needed for the help section. It is accessed by ?action=help.
Uses Help template and Manual language file.
The main page for the Help section
HelpIndex() : void
Show some of the more detailed help to give the admin an idea... It shows a popup for administrative or user help.
ShowAdminHelp() : void
It uses the help parameter to decide what string to display and where to get the string from. ($helptxt or $txt?) It is accessed via ?action=helpadmin;help=?.
Uses ManagePermissions language file, if the help starts with permissionhelp.
Used to edit the body or subject of a message inline called from action=jsmodify from script and topic js
JavaScriptModify() : void
Ask them for their login information. (shows a page for the user to type in their username and password.) It caches the referring URL in $_SESSION['login_url'].
Login() : void
It is accessed from ?action=login.
Uses Login template and language file with the login sub-template.
Actually logs you in.
Login2() : void
What it does:
This protects against brute force attacks on a member's password.
validatePasswordFlood(int $id_member, string $member_name[, bool|string $password_flood_value = false ][, bool $was_correct = false ][, bool $tfa = false ]) : void
Importantly, even if the password was right we DON'T TELL THEM!
The ID of the member
The name of the member.
False if we don't have a flood value, otherwise a string with a timestamp and number of tries separated by a |
Whether or not the password was correct
Whether we're validating for two-factor authentication
Allows the user to enter their Two-Factor Authentication code
LoginTFA() : void
Logs the current user out of their account.
Logout() : void
It requires that the session hash is sent as well, to prevent automatic logouts by images or javascript. It redirects back to $_SESSION['logout_url'], if it exists. It is accessed via ?action=logout;session_var=...
Mark one or more boards as read.
MarkRead() : void
Shows a listing of registered members.
Memberlist() : void
Uses Memberlist template, main sub template.
List all members, page by page, with sorting.
MLAll() : void
Called from MemberList(). Can be passed a sort parameter, to order the display of members. Calls printMemberListRows to retrieve the results of the query.
Search for members, or display search results.
MLSearch() : void
Retrieves results of the request passed to it Puts results of request into the context for the sub template.
printMemberListRows(resource $request) : void
An SQL result resource
Sets the label, sort and join info for every custom field column.
getCustFieldsMList() : array<string|int, mixed>
An array of info about the custom fields for the member list
Show the list of topics in this board, along with any child boards.
MessageIndex() : void
Generates the query to determine the list of available boards for a user Executes the query and returns the list
getBoardList([array<string|int, mixed> $boardListOptions = [] ]) : array<string|int, mixed>
An array of options for the board list
An array of board info
Remove just a single post.
DeleteMessage() : void
On completion redirect to the topic or to the board.
Fetches the list of preferences (or a single/subset of preferences) for notifications for one or more users.
getNotifyPrefs(int|array<string|int, mixed> $members[, string|array<string|int, mixed> $prefs = '' ][, bool $process_defaults = false ]) : array<string|int, mixed>
A user id or an array of (integer) user ids to load preferences for
An empty string to load all preferences, or a string (or array) of preference name(s) to load
An array of user ids => array (pref name -> value), with user id 0 representing the defaults
Sets the list of preferences for a single user.
setNotifyPrefs(int $memID[, array<string|int, mixed> $prefs = [] ]) : mixed
The user whose preferences you are setting
An array key of pref -> value
Deletes notification preference
deleteNotifyPrefs(int $memID, array<string|int, mixed> $prefs) : mixed
The user whose preference you're setting
The preferences to delete
Verifies a member's unsubscribe token, then returns some member info
getMemberWithToken(string $type) : array<string|int, mixed>
The type of notification the token is for (e.g. 'board', 'topic', etc.)
The id and email address of the specified member
Builds an unsubscribe token
createUnsubscribeToken(int $memID, string $email[, string $type = '' ][, int $itemID = 0 ]) : string
The id of the member that this token is for
The member's email address
The type of notification the token is for (e.g. 'board', 'topic', etc.)
The id of the notification item, if applicable.
The unsubscribe token
Turn off/on notifications for announcements.
AnnouncementsNotify() : void
Only uses the template if no mode was given. Accessed via ?action=notifyannouncements.
Turn off/on notification for a particular board.
BoardNotify() : void
Must be called with a board specified in the URL. Only uses the template if no mode (or subaction) was given. Redirects the user back to the board after it is done. Accessed via ?action=notifyboard.
Turn off/on unread replies subscription for a topic as well as sets individual topic's alert preferences Must be called with a topic specified in the URL.
TopicNotify() : void
The mode can be from 0 to 3 0 => unwatched, 1 => no alerts/emails, 2 => alerts, 3 => emails/alerts Upon successful completion of action will direct user back to topic. Accessed via ?action=notifytopic.
This helps organize things.
MessageMain() : void
..
A folder, ie. inbox/sent etc.
MessageFolder() : void
The popup for when we ask for the popup from the user.
MessagePopup() : void
This function handles adding, deleting and editing labels on messages.
ManageLabels() : void
List all rules, and allow adding/entering etc.
ManageRules() : void
..
This function performs all additional stuff.
MessageActionsApply() : void
..
This function allows the user to delete all messages older than so many days.
MessagePrune() : mixed
Delete ALL the messages!
MessageKillAll() : void
Allows the user to report a personal message to an administrator.
ReportMessage() : void
Allows searching through personal messages.
MessageSearch() : void
Actually do the search of personal messages.
MessageSearch2() : void
Send a new message?
MessagePost() : void
Send it!
MessagePost2() : void
Allows to edit Personal Message Settings.
MessageSettings() : void
Uses Profile.php Uses Profile-Modify.php Uses Profile template. Uses Profile language file.
This function allows the user to view their PM drafts
MessageDrafts() : void
Handles showing the post screen, loading the post to be modified, and loading any post quoted.
Post([array<string|int, mixed> $post_errors = [] ]) : void
Holds any errors found while trying to post
Posts or saves the message composed with Post().
Post2() : void
requires various permissions depending on the action. handles attachment, post, and calendar saving. sends off notifications, and allows for announcements and moderation. accessed from ?action=post2.
Handles moderation from the message index.
QuickModeration() : void
In-topic quick moderation.
QuickInTopicModeration() : void
Loads a post an inserts it into the current editing text box.
QuoteFast() : void
uses the Post language file. uses special (sadly browser dependent) javascript to parse entities for internationalization reasons. accessed with ?action=quotefast.
Find the ten most recent posts.
RecentPosts() : void
Get the latest post made on the system
getLastPost() : array<string|int, mixed>
An array of information about the last post that you can see
Begin the registration process.
Register([array<string|int, mixed> $reg_errors = [] ]) : void
Holds information about any errors that occurred
Actually register the member.
Register2() : void
Registers a member to the forum.
registerMember(array<string|int, mixed> &$reg_options[, bool $return_errors = false ]) : int|array<string|int, mixed>
Allows two types of interface: 'guest' and 'admin'. The first includes hammering protection, the latter can perform the registration silently. The strings used in the options array are assumed to be escaped. Allows to perform several checks on the input, e.g. reserved names. The function will adjust member statistics. If an error is detected will fatal error on all errors unless return_errors is true.
An array of registration options
Whether to return the errors
The ID of the newly registered user or an array of error info if $return_errors is true
This is the controlling delegator
RemindMe() : void
Uses Profile language files and Reminder template
Report a post or profile to the moderator... ask for a comment.
ReportToModerator() : void
Gathers data from the user to report abuse to the moderator(s). Uses the ReportToModerator template, main sub template. Requires the report_any permission. Uses ReportToModerator2() if post data was sent. Accessed through ?action=reporttm.
Send the emails.
ReportToModerator2() : void
Sends off emails to all the moderators. Sends to administrators and global moderators. (1 and 2) Called by ReportToModerator(), and thus has the same permission and setting requirements as it does. Accessed through ?action=reporttm when posting.
Actually reports a post using information specified from a form
reportPost(int $msg, string $reason) : void
The ID of the post being reported
The reason specified for reporting the post
Actually reports a user's profile using information specified from a form
reportUser(int $id_member, string $reason) : void
The ID of the member whose profile is being reported
The reason specified by the reporter for this report
Outputs each member name on its own line.
RequestMembers() : void
Ask the user what they want to search for.
PlushSearch1() : void
What it does:
Gather the results and show them.
PlushSearch2() : void
What it does:
It doesn't actually send anything, this action just shows a message for a guest.
SendActivation() : void
This is the function which returns stats to simplemachines.org IF enabled! called by simplemachines.org.
SMStats() : void
only returns anything if stats was enabled during installation. can also be accessed by the admin, to show what stats sm.org collects. does not return any data directly to sm.org, instead starts a new request for security.
Display some useful/interesting board statistics.
DisplayStats() : void
gets all the statistics in order and puts them in. uses the Stats template and language file. (and main sub template.) requires the view_stats permission. accessed from ?action=stats.
merges two or more topics into one topic.
MergeTopics() : void
delegates to the other functions (based on the URL parameter sa). loads the SplitTopics template. requires the merge_any permission. is accessed with ?action=mergetopics.
allows to pick a topic to merge the current topic with.
MergeIndex() : void
is accessed with ?action=mergetopics;sa=index default sub action for ?action=mergetopics. uses 'merge' sub template of the MoveTopic template. allows to set a different target board.
set merge options and do the actual merge of two or more topics.
MergeExecute([array<string|int, mixed> $topics = [] ]) : void
the merge options screen:
the actual merge:
The IDs of the topics to merge
Shows a 'merge completed' screen.
MergeDone() : void
is accessed with ?action=mergetopics;sa=done. uses 'merge_done' sub template of the SplitTopics template.
This function allows to move a topic, making sure to ask the moderator to give reason for topic move.
MoveTopic() : void
It must be called with a topic specified. (that is, global $topic must be set... @todo fix this thing.) If the member is the topic starter requires the move_own permission, otherwise the move_any permission. Accessed via ?action=movetopic.
Uses the MoveTopic template, main sub-template.
Execute the move of a topic.
MoveTopic2() : void
It is called on the submit of MoveTopic. This function logs that topics have been moved in the moderation log. If the member is the topic starter requires the move_own permission, otherwise requires the move_any permission. Upon successful completion redirects to message index. Accessed via ?action=movetopic2.
Uses Subs-Post.php
Called after a topic is moved to update $board_link and $topic_link to point to new location
moveTopicConcurrence() : mixed
Format a topic to be printer friendly.
PrintTopic() : void
Must be called with a topic specified. Accessed via ?action=printpage.
Uses Printpage template, main sub-template. Uses print_above/print_below later without the main layer.
Completely remove an entire topic.
RemoveTopic2() : void
Redirects to the board when completed.
Try to determine if the topic has already been deleted by another user.
removeDeleteConcurrence() : bool
False if it can't be deleted (recycling not enabled or no recycling board set), true if we've confirmed it can be deleted. Dies with an error if it's already been deleted.
So long as you are sure... all old posts will be gone.
RemoveOldTopics2() : mixed
Used in ManageMaintenance.php to prune old topics.
Move back a topic from the recycle board to its original board.
RestoreTopic() : void
splits a topic into two topics.
SplitTopics() : void
delegates to the other functions (based on the URL parameter 'sa'). loads the SplitTopics template. requires the split_any permission. is accessed with ?action=splittopics.
general function to split off a topic.
splitTopic(int $split1_ID_TOPIC, array<string|int, mixed> $splitMessages, string $new_subject) : int
creates a new topic and moves the messages with the IDs in array messagesToBeSplit to the new topic. the subject of the newly created topic is set to 'newSubject'. marks the newly created message as read for the user splitting it. updates the statistics to reflect a newly created topic. logs the action in the moderation log. a notification is sent to all users monitoring this topic.
The ID of the topic we're splitting
The IDs of the messages being split
The subject of the new topic
The ID of the new split topic.
screen shown before the actual split.
SplitIndex() : void
is accessed with ?action=splittopics;sa=index. default sub action for ?action=splittopics. uses 'ask' sub template of the SplitTopics template. redirects to SplitSelectTopics if the message given turns out to be the first message of a topic. shows the user three ways to split the current topic.
do the actual split.
SplitExecute() : void
is accessed with ?action=splittopics;sa=execute. uses the main SplitTopics template. supports three ways of splitting: (1) only one message is split off. (2) all messages after and including a given message are split off. (3) select topics to split (redirects to SplitSelectTopics()). uses splitTopic function to do the actual splitting.
allows the user to select the messages to be split.
SplitSelectTopics() : void
is accessed with ?action=splittopics;sa=selectTopics. uses 'select' sub template of the SplitTopics template or (for XMLhttp) the 'split' sub template of the Xml template. supports XMLhttp for adding/removing a message to the selection. uses a session variable to store the selected topics. shows two independent page indexes for both the selected and not-selected messages (;topic=1.x;start2=y).
do the actual split of a selection of topics.
SplitSelectionExecute() : void
is accessed with ?action=splittopics;sa=splitSelection. uses the main SplitTopics template. uses splitTopic function to do the actual splitting.
Handles tracking a particular IP address
TrackIP([int $memID = 0 ]) : void
The ID of a member whose IP we want to track
Find unread topics and replies.
UnreadTopics() : void
Show the verification code or let it be heard.
VerificationCode() : void
Show the database queries for debugging What this does: - Toggles the session variable 'view_queries'.
ViewQuery() : void
Who's online, and what are they doing? This function prepares the who's online data for the Who template.
Who() : void
It requires the who_view permission. It is enabled with the who_enabled setting. It is accessed via ?action=who.
Uses Who template, main sub-template Uses Who language file.
This function determines the actions of the members passed in urls.
determineActions(mixed $urls[, string|bool $preferred_prefix = false ]) : array<string|int, mixed>
Adding actions to the Who's Online list: Adding actions to this list is actually relatively easy...
a single url (string) or an array of arrays, each inner array being (JSON-encoded request data, id_member)
= false
an array of descriptions if you passed an array, otherwise the string describing their current location.
The main handler and designator for AJAX stuff - jumpto, message icons and previews
XMLhttpMain() : void
Get a list of boards and categories used for the jumpto dropdown.
GetJumpTo() : void
Gets a list of available message icons and sends the info to the template for display
ListMessageIcons() : void
Handles retrieving previews of news items, newsletters, signatures and warnings.
RetrievePreview() : bool|null
Calls the appropriate function based on $_POST['item']
Returns false if $_POST['item'] isn't set or isn't valid
Try to load up a supported caching method. This is saved in $cacheAPI if we are not overriding it.
loadCacheAccelerator([string $overrideCache = '' ][, bool $fallbackSMF = true ]) : object|false
Try to use a different cache method other than that defined in $cache_accelerator.
Use the default SMF method if the accelerator fails.
A object of $cacheAPI, or False on failure.
Get the installed Cache API implementations.
loadCacheAPIs() : array<string|int, mixed>
Empty out the cache in use as best it can
clean_cache([string $type = '' ]) : void
It may only remove the files of a certain type (if the $type parameter is given) Type can be user, data or left blank - user clears out user data
The cache type ('memcached', 'zend' or something else for SMF's file cache)
Try to retrieve a cache entry. On failure, call the appropriate function.
cache_quick_get(string $key, string $file, string $function, array<string|int, mixed> $params[, int $level = 1 ]) : string
The key for this entry
The file associated with this entry
The function to call
Parameters to be passed to the specified function
The cache level
The cached data
Puts value in the cache under key for ttl seconds.
cache_put_data(string $key, mixed $value[, int $ttl = 120 ]) : void
A key for this value
The data to cache
How long (in seconds) the data should be cached for
Gets the value from the cache specified by key, so long as it is not older than ttl seconds.
cache_get_data(string $key[, int $ttl = 120 ]) : array<string|int, mixed>|null
The key for the value to retrieve
The maximum age of the cached data
The cached data or null if nothing was loaded
Load the $modSettings array.
reloadSettings() : mixed
Updates the settings table as well as $modSettings... only does one at a time if $update is true.
updateSettings(array<string|int, mixed> $change_array[, bool $update = false ]) : mixed
An array of info about what we're changing in 'setting' => 'value' format
Whether to use an UPDATE query instead of a REPLACE query
Gets, and if necessary creates, the authentication secret to use for cookies, tokens, etc.
get_auth_secret() : string
Note: Never use the $auth_secret variable directly. Always call this function instead.
The authentication secret.
Describes properties of all known Settings.php variables and other content.
get_settings_defs() : array<string|int, mixed>
Helper for updateSettingsFile(); also called by saveSettings().
Descriptions of all known Settings.php content
Update the Settings.php file.
updateSettingsFile(array<string|int, mixed> $config_vars[, bool|null $keep_quotes = null ][, bool $rebuild = false ]) : bool
The most important function in this file for mod makers happens to be the updateSettingsFile() function, but it shouldn't be used often anyway.
Updates the Settings.php file with the changes supplied in config_vars.
Expects config_vars to be an associative array, with the keys as the variable names in Settings.php, and the values the variable values.
Correctly formats the values using smf_var_export().
Restores standard formatting of the file, if $rebuild is true.
Checks for changes to db_last_error and passes those off to a separate handler.
Creates a backup file and will use it should the writing of the new settings file fail.
Tries to intelligently trim quotes and remove slashes from string values. This is done for backwards compatibility purposes (old versions of this function expected strings to have been manually escaped and quoted). This behaviour can be controlled by the $keep_quotes parameter.
MOD AUTHORS: If you are adding a setting to Settings.php, you should use the integrate_update_settings_file hook to define it in get_settings_defs().
An array of one or more variables to update.
Whether to strip slashes & trim quotes from string values. Defaults to auto-detection.
If true, attempts to rebuild with standard format. Default false.
True on success, false on failure.
Writes data to a file, optionally making a backup, while avoiding race conditions.
safe_file_write(string $file, string $data[, string $backup_file = null ][, int $mtime = null ][, bool $append = false ]) : bool
The filepath of the file where the data should be written.
The data to be written to $file.
The filepath where the backup should be saved. Default null.
If modification time of $file is more recent than this Unix timestamp, the write operation will abort. Defaults to time that the script started execution.
If true, the data will be appended instead of overwriting the existing content of the file. Default false.
Whether the write operation succeeded or not.
A wrapper around var_export whose output matches SMF coding conventions.
smf_var_export(mixed $var) : mixed
The variable to export
A PHP-parseable representation of the variable's value
Saves the time of the last db error for the error log - Done separately from updateSettingsFile to avoid race conditions which can occur during a db error - If it fails Settings.php will assume 0
updateDbLastError(int $time) : bool
The timestamp of the last DB error
True If we could succesfully put the file or not.
Locates the most appropriate temp directory.
sm_temp_dir() : string
Systems using open_basedir
restrictions may receive errors with
sys_get_temp_dir()
due to misconfigurations on servers. Other
cases sys_temp_dir may not be set to a safe value. Additionally
sys_get_temp_dir
may use a readonly directory. This attempts to
find a working temp directory that is accessible under the
restrictions and is writable to the web service account.
Directories checked against open_basedir
:
sys_get_temp_dir()
upload_tmp_dir
session.save_path
cachedir
Generate a random seed and ensure it's stored in settings.
smf_seed_generator() : mixed
Ensures SMF's scheduled tasks are being run as intended
check_cron() : mixed
If the admin activated the cron_is_real_cron setting, but the cron job is not running things at least once per day, we need to go back to SMF's default behaviour using "web cron" JavaScript calls.
Initialize a database connection.
loadDatabase([array<string|int, mixed> $options = [] ]) : DatabaseApi
Extend the database functionality. It calls the respective file's init to add the implementations in that file to $smcFunc array.
db_extend(string $type) : void
In SMF 3.0 this is a no-op.
Indicates which additional file to load. ('extra', 'packages')
See if we have enough memory to thumbnail an image
imageMemoryCheck(array<string|int, mixed> $sizes) : bool
image size
Whether we do
Get the size of a specified image with better error handling.
url_image_size(string $url) : array<string|int, mixed>|false
The URL of the image
The image size as array (width, height), or false on failure
Writes a gif file to disk as a png file.
gif_outputAsPng(gif_file $gif, string $lpszFileName[, int $background_color = -1 ]) : bool
A gif image resource
The name of the file
The background color
Whether the operation was successful
Gets the dimensions of an SVG image (specifically, of its viewport).
getSvgSize(string $filepath) : array<string|int, mixed>
If $filepath is not the path to a valid SVG file, the returned width and height will both be null.
See https://www.w3.org/TR/SVG11/coords.html#IntrinsicSizing
The path to the SVG file.
The width and height of the SVG image in pixels.
Create a thumbnail of the given source.
createThumbnail(string $source, int $max_width, int $max_height) : bool
The name of the source image
The maximum allowed width
The maximum allowed height
Whether the thumbnail creation was successful.
Used to re-econodes an image to a specified image format - creates a copy of the file at the same location as fileName.
reencodeImage(string $source[, int $preferred_type = 0 ]) : bool
Whether the reencoding was successful
Searches through the file to see if there's potentially harmful non-binary content.
checkImageContents(string $source[, bool $extensive = false ]) : bool
Whether the image appears to be safe
Searches through an SVG file to see if there's potentially harmful content.
checkSvgContents(string $source) : bool
Whether the image appears to be safe.
Resizes an image from a remote location or a local file.
resizeImageFile(string $source, string $destination, int $max_width, int $max_height[, int $preferred_type = 0 ]) : bool
Puts the resized image at the destination location. The file would have the format preferred_format if possible, otherwise the default format is jpeg.
The path to the source image
The path to the destination image
The maximum allowed width
The maximum allowed height
Whether it succeeded.
Resizes src_img proportionally to fit within max_width and max_height limits if it is too large.
resizeImage(resource $source, string $destination, int $src_width, int $src_height, int $max_width, int $max_height[, bool $force_resize = false ][, int $preferred_type = 0 ]) : bool
If GD2 is present, it'll use it to achieve better quality. It saves the new image to destination_filename, as preferred_format if possible, default is jpeg.
Uses Imagemagick (IMagick or MagickWand extension) or GD
The source image
The path to the destination image
The width of the source image
The height of the source image
The maximum allowed width
The maximum allowed height
= false Whether to forcibly resize it
Whether the resize was successful
Reads an archive from either a remote location or from the local filesystem.
read_tgz_file(string $gzfilename, string $destination[, bool $single_file = false ][, bool $overwrite = false ][, null|array<string|int, mixed> $files_to_extract = null ]) : array<string|int, mixed>|false
The path to the tar.gz file
The path to the desitnation directory
If true returns the contents of the file specified by destination if it exists
Whether to overwrite existing files
Specific files to extract
An array of information about extracted files or false on failure
Extracts a file or files from the .tar.gz contained in data.
read_tgz_data(string $data, null|string $destination[, bool $single_file = false ][, bool $overwrite = false ][, null|array<string|int, mixed> $files_to_extract = null ]) : array<string|int, mixed>|false
detects if the file is really a .zip file, and if so returns the result of read_zip_data
if destination is null
if single_file is true
overwrites existing files with newer modification times if and only if overwrite is true. creates the destination directory if it doesn't exist, and is is specified. requires zlib support be built into PHP. returns an array of the files extracted. if files_to_extract is not equal to null only extracts file within this array.
The gzipped tarball
The destination
Whether to only extract a single file
Whether to overwrite existing data
If set, only extracts the specified files
An array of information about the extracted files or false on failure
Extract zip data.
read_zip_data(string $data, string $destination[, bool $single_file = false ][, bool $overwrite = false ][, array<string|int, mixed> $files_to_extract = null ]) : mixed
If single_file is true, destination can start with * and / to signify that the file may come from any directory. Destination should not begin with a / if single_file is true.
ZIP data
Null to display a listing of files in the archive, the destination for the files in the archive or the name of a single file to display (if $single_file is true)
If true, returns the contents of the file specified by destination or false if the file can't be found (default value is false).
If true, will overwrite files with newer modication times. Default is false.
If destination is null, return a short array of a few file details optionally delimited by $files_to_extract. If $single_file is true, return contents of a file as a string; false otherwise
Checks the existence of a remote file since file_exists() does not do remote.
url_exists(string $url) : bool
will return false if the file is "moved permanently" or similar.
The URL to parse
Whether the specified URL exists
Loads and returns an array of installed packages.
loadInstalledPackages() : array<string|int, mixed>
default sort order is package_installed time
An array of info about installed packages
Loads a package's information and returns a representative array.
getPackageInfo(string $gzfilename) : array<string|int, mixed>|string
The path to the file
An array of info about the file or a string indicating an error
Create a chmod control for chmoding files.
create_chmod_control([array<string|int, mixed> $chmodFiles = [] ][, array<string|int, mixed> $chmodOptions = [] ][, bool $restore_write_status = false ]) : array<string|int, mixed>
Which files to chmod
Options for chmod
Whether to restore write status
An array of file info
Get a listing of files that will need to be set back to the original state
list_restoreFiles(null $dummy1, null $dummy2, null $dummy3, bool $do_change) : array<string|int, mixed>
An array of info about the files that need to be restored back to their original state
Use FTP functions to work with a package download/install
packageRequireFTP(string $destination_url[, null|array<string|int, mixed> $files = null ][, bool $return = false ]) : array<string|int, mixed>
The destination URL
The files to CHMOD
Whether to return an array of file info if there's an error
An array of file info
Parses the actions in package-info.xml file from packages.
parsePackageInfo(xmlArray &$packageXML[, bool $testing_only = true ][, string $method = 'install' ][, string $previous_version = '' ]) : array<string|int, mixed>
The info from the package-info file
Whether we're only testing
The method ('install', 'upgrade', or 'uninstall')
The previous version of the mod, if method is 'upgrade'
An array of those changes made.
Checks if version matches any of the versions in `$versions`.
matchHighestPackageVersion(string $versions, bool $reset, string $the_version) : string|bool
The versions that this package will install on
Whether to reset $near_version
The forum version
Highest install value string or false
Checks if the forum version matches any of the available versions from the package install xml.
matchPackageVersion(string $version, string $versions) : bool
The forum version
The versions that this package will install on
Whether the version matched
Compares two versions and determines if one is newer, older or the same, returns - (-1) if version1 is lower than version2 - (0) if version1 is equal to version2 - (1) if version1 is higher than version2
compareVersions(string $version1, string $version2) : int
The first version
The second version
-1 if version2 is greater than version1, 0 if they're equal, 1 if version1 is greater than version2
Parses special identifiers out of the specified path.
parse_path(string $path) : string
The path
The parsed path
Deletes a directory, and all the files and direcories inside it.
deltree(string $dir[, bool $delete_dir = true ]) : void
requires access to delete these files.
A directory
If false, only deletes everything inside the directory but not the directory itself
Creates the specified tree structure with the mode specified.
mktree(string $strPath, int $mode) : bool
creates every directory in path until it finds one that already exists.
The path
The permission mode for CHMOD (0666, etc.)
True if successful, false otherwise
Copies one directory structure over to another.
copytree(string $source, string $destination) : void
requires the destination to be writable.
The directory to copy
The directory to copy $source to
Create a tree listing for a given directory path
listtree(string $path[, string $sub_path = '' ]) : array<string|int, mixed>
The path
The sub-path
An array of information about the files at the specified path/subpath
Parses a xml-style modification file (file).
parseModification(string $file[, bool $testing = true ][, bool $undo = false ][, array<string|int, mixed> $theme_paths = [] ]) : array<string|int, mixed>
The modification file to parse
Whether we're just doing a test
If true, specifies that the modifications should be undone. Used when uninstalling. Doesn't work with regex.
An array of information about custom themes to apply the changes to
An array of those changes made.
Parses a boardmod-style (.mod) modification file
parseBoardMod(string $file[, bool $testing = true ][, bool $undo = false ][, array<string|int, mixed> $theme_paths = [] ]) : array<string|int, mixed>
The modification file to parse
Whether we're just doing a test
If true, specifies that the modifications should be undone. Used when uninstalling.
An array of information about custom themes to apply the changes to
An array of those changes made.
Get the physical contents of a packages file
package_get_contents(string $filename) : string
The package file
The contents of the specified file
Writes data to a file, almost exactly like the file_put_contents() function.
package_put_contents(string $filename, string $data[, bool $testing = false ]) : int
uses FTP to create/chmod the file when necessary and available. uses text mode for text mode file extensions. returns the number of bytes written.
The name of the file
The data to write to the file
Whether we're just testing things
The length of the data written (in bytes)
Flushes the cache from memory to the filesystem
package_flush_cache([bool $trash = false ]) : void
Try to make a file writable.
package_chmod(string $filename[, string $perm_state = 'writable' ][, bool $track_change = false ]) : bool
The name of the file
The permission state - can be either 'writable' or 'execute'
Whether to track this change
True if it worked, false if it didn't
Used to crypt the supplied ftp password in this session
package_crypt(string $pass) : string
The password
The encrypted password
package_unique_filename(string $dir, string $filename, string $ext) : string
The filename without an extension
The filename with a number appended but no extension
Creates a backup of forum files prior to modifying them
package_create_backup([string $id = 'backup' ]) : bool
The name of the backup
True if it worked, false if it didn't
Validate a package during install
package_validate_installtest(array<string|int, mixed> $package) : array<string|int, mixed>
Package data
Results from the package validation.
Validate multiple packages.
package_validate(array<string|int, mixed> $packages) : array<string|int, mixed>
Package data
Results from the package validation.
Sending data off to validate packages.
package_validate_send(array<string|int, mixed> $sendData) : array<string|int, mixed>
Json encoded data to be sent to the validation servers.
Results from the package validation.
Sends an personal message from the specified person to the specified people ($from defaults to the user)
sendpm(array<string|int, mixed> $recipients, string $subject, string $message[, bool $store_outbox = false ][, array<string|int, mixed> $from = null ][, int $pm_head = 0 ]) : array<string|int, mixed>
An array containing the arrays 'to' and 'bcc', both containing id_member's.
Should have no slashes and no html entities
Should have no slashes and no html entities
Whether to store it in the sender's outbox
An array with the id, name, and username of the member.
The ID of the chain being replied to - if any.
An array with log entries telling how many recipients were successful and which recipients it failed to send to.
Delete the specified personal messages.
deleteMessages(array<string|int, mixed>|null $personal_messages[, string|null $folder = null ][, array<string|int, mixed>|int|null $owner = null ]) : void
An array containing the IDs of PMs to delete or null to delete all of them
Which "folder" to delete PMs from - 'sent' to delete them from the outbox, null or anything else to delete from the inbox
An array of IDs of users whose PMs are being deleted, the ID of a single user or null to use the current user's ID
Mark the specified personal messages read.
markMessages([array<string|int, mixed>|null $personal_messages = null ][, int|null $label = null ][, int|null $owner = null ]) : void
An array of PM IDs to mark or null to mark all
The ID of a label. If set, only messages with this label will be marked.
If owner is set, marks messages owned by that member id
An error in the message.
messagePostError(array<string|int, mixed> $error_types, array<string|int, mixed> $named_recipients[, mixed $recipient_ids = [] ]) : void
..
An array of strings indicating which type of errors occurred
Check if the PM is available to the current user.
isAccessiblePM(int $pmID[, string $folders = 'both' ]) : bool
The ID of the PM
Whether the PM is accessible in that folder for the current user
Load up all the rules for the current user.
LoadRules([bool $reload = false ]) : array<string|int, mixed>
Whether or not to reload all the rules from the database if $context['rules'] is set
This will apply rules to all unread messages. If all_messages is set will, clearly, do it to all!
ApplyRules([bool $all_messages = false ]) : void
Whether to apply this to all messages or just unread ones
Creates a search API and returns the object.
findSearchAPI() : search_api_interface
An instance of the search API interface
Get the installed Search API implementations.
loadSearchAPIs() : array<string|int, mixed>
This function checks for patterns in comments on top of the Search-API files! In addition to filenames pattern. It loads the search API classes if identified. This function is used by EditSearchMethod to list all installed API implementations.
Info about the detected search APIs.
Highlighting matching string
highlight(string $text, array<string|int, mixed> $words) : string
Text to search through
List of keywords to search
Text with highlighted keywords
Helper function for utf8_normalize_d and utf8_normalize_kd.
utf8_decompose(array<string|int, mixed> $chars[, bool $compatibility = false ]) : array<string|int, mixed>
Array of Unicode characters
If true, perform compatibility decomposition. Default false.
Array of decomposed Unicode characters.
Helper function for utf8_normalize_c and utf8_normalize_kc.
utf8_compose(array<string|int, mixed> $chars) : array<string|int, mixed>
Array of decomposed Unicode characters
Array of composed Unicode characters.
Converts the given UTF-8 string into lowercase.
utf8_strtolower(string $string) : string
Equivalent to mb_strtolower($string, 'UTF-8'), except that we can keep the output consistent across PHP versions and up to date with the latest version of Unicode.
The string
The lowercase version of $string
Convert the given UTF-8 string to uppercase.
utf8_strtoupper(string $string) : string
Equivalent to mb_strtoupper($string, 'UTF-8'), except that we can keep the output consistent across PHP versions and up to date with the latest version of Unicode.
The string
The uppercase version of $string
Casefolds the given UTF-8 string.
utf8_casefold(string $string) : string
Equivalent to mb_convert_case($string, MB_CASE_FOLD, 'UTF-8'), except that we can keep the output consistent across PHP versions and up to date with the latest version of Unicode.
The string
The uppercase version of $string
Converts the case of the given UTF-8 string.
utf8_convert_case(string $string, string $case[, bool $simple = false ]) : string
The string.
One of 'upper', 'lower', 'fold', 'title', 'ucfirst', or 'ucwords'.
If true, use simple maps instead of full maps. Default: false.
A version of $string converted to the specified case.
Normalizes UTF-8 via Canonical Decomposition.
utf8_normalize_d(string $string) : string
A UTF-8 string
The decomposed version of $string
Normalizes UTF-8 via Compatibility Decomposition.
utf8_normalize_kd(string $string) : string
A UTF-8 string.
The decomposed version of $string.
Normalizes UTF-8 via Canonical Decomposition then Canonical Composition.
utf8_normalize_c(string $string) : string
A UTF-8 string
The composed version of $string
Normalizes UTF-8 via Compatibility Decomposition then Canonical Composition.
utf8_normalize_kc(string $string) : string
The string
The composed version of $string
Casefolds UTF-8 via Compatibility Composition Casefolding.
utf8_normalize_kc_casefold(string $string) : string
Used by idn_to_ascii polyfill in Subs-Compat.php
The string
The casefolded version of $string
Checks whether a string is already normalized to a given form.
utf8_is_normalized(string|array<string|int, mixed> $string, string $form) : bool
A string of UTF-8 characters.
One of 'd', 'c', 'kd', 'kc', or 'kc_casefold'
Whether the string is already normalized to the given form.
Helper function for sanitize_chars() that deals with invisible characters.
utf8_sanitize_invisibles(string $string, int $level, string $substitute) : string
This function deals with control characters, private use characters, non-characters, and characters that are invisible by definition in the Unicode standard. It does not deal with characters that are supposed to be visible according to the Unicode standard, and makes no attempt to compensate for possibly incomplete Unicode support in text rendering engines on client devices.
The string to sanitize.
Controls how invisible formatting characters are handled. 0: Allow valid formatting characters. Use for sanitizing text in posts. 1: Allow necessary formatting characters. Use for sanitizing usernames. 2: Disallow all formatting characters. Use for internal comparisions only, such as in the word censor, search contexts, etc.
Replacement string for the invalid characters.
The sanitized string.
Get the contents of a URL, irrespective of allow_url_fopen.
fetch_web_data(string $url[, string $post_data = [] ][, bool $keep_alive = false ]) : string|false
The URL
The data to post to the given URL
Whether to send keepalive info
The fetched data or false on failure
Fetch the alerts a member currently has.
fetch_alerts(int $memID[, mixed $to_fetch = false ][, array<string|int, mixed> $limit = 0 ][, array<string|int, mixed> $offset = 0 ][, bool $with_avatar = false ][, bool $show_links = false ]) : array<string|int, mixed>
The ID of the member.
Alerts to fetch: true/false for all/unread, or a list of one or more IDs.
Maximum number of alerts to fetch (0 for no limit).
Number of alerts to skip for pagination. Ignored if $to_fetch is a list of IDs.
Whether to load the avatar of the alert sender.
Whether to show links in the constituent parts of the alert meessage.
An array of information about the fetched alerts.
Counts how many alerts a user has - either unread or all depending on $unread We can't use db_num_rows here, as we have to determine what boards the user can see Possibly in future versions as database support for json is mainstream, we can simplify this.
alert_count(int $memID[, bool $unread = false ]) : int
The user ID.
Whether to only count unread alerts.
The number of requested alerts
Marks a group of alerts as un/read
alert_mark(array<string|int, mixed>|int $members, array<string|int, mixed>|int $to_mark, bool|int $read) : int
The user IDs.
To mark as read or unread, 1 for read, 0 or any other value different than 1 for unread.
How many alerts remain unread
Deletes a single or a group of alerts by ID
alert_delete(int|array<string|int, mixed> $ids[, int|array<string|int, mixed> $members = [] ]) : int|null
If the $memID param is set, returns the new amount of unread alerts.
Deletes all the alerts that a user has already read.
alert_purge([int $memID = 0 ][, int $before = 0 ]) : void
The user ID. Defaults to the current user's ID.
Check if the current directory is still valid or not.
automanage_attachments_check_directory() : bool|null
If not creates the new directory
False if any error occurred
Creates a directory
automanage_attachments_create_directory(string $updir) : bool
The directory to be created
False on errors
Called when a directory space limit is reached.
automanage_attachments_by_space() : bool|null
Creates a new directory and increments the directory suffix number.
False on errors, true if successful, nothing if auto-management of attachments is disabled
Moves an attachment to the proper directory and set the relevant data into $_SESSION['temp_attachments']
processAttachments() : void
Performs various checks on an uploaded file.
attachmentChecks(int $attachID) : bool
The ID of the attachment
Whether the attachment is OK
Create an attachment, with the given array of parameters.
createAttachment(array<string|int, mixed> &$attachmentOptions) : bool
An array of attachment options
Whether the attachment was created successfully
Assigns the given attachments to the given message ID.
assignAttachments([mixed $attachIDs = [] ][, mixed $msgID = 0 ]) : bool
array of attachment IDs to assign.
integer the message ID.
false on error or missing params.
Approve an attachment, or maybe even more - no permission check!
ApproveAttachments(array<string|int, mixed> $attachments) : int|null
The IDs of the attachments to approve
Returns 0 if the operation failed, otherwise returns nothing
Gets an attach ID and tries to load all its info.
parseAttachBBC([int $attachID = 0 ]) : mixed
the attachment ID to load info from.
If succesful, it will return an array of loaded data. String, most likely a $txt key if there was some error.
Gets all needed message data associated with an attach ID
getAttachMsgInfo(int $attachID) : array<string|int, mixed>
the attachment ID to load info from.
This loads an attachment's contextual data including, most importantly, its size if it is an image.
loadAttachmentContext(int $id_msg, array<string|int, mixed> $attachments) : array<string|int, mixed>
It requires the view_attachments permission to calculate image size. It attempts to keep the "aspect ratio" of the posted image in line, even if it has to be resized by the max_image_width and max_image_height settings.
ID of the post to load attachments for
An array of already loaded attachments. This function no longer depends on having $topic declared, thus, you need to load the actual topic ID for each attachment.
An array of attachment info
prepare the Attachment api for all messages
prepareAttachsByMsg(array<string|int, mixed> $msgIDs) : void
Backward compatibility only.
getAttachmentFilename(string $filename, int $attachment_id[, string|null $dir = null ][, bool $new = false ][, string $file_hash = '' ]) : string
New code should use Attachment::getFilePath() or Attachment::createHash() to get whichever type of output is desired for a given situation.
Get an attachment's encrypted filename. If $new is true, won't check for file existence.
This currently returns the hash if new, and the full filename otherwise, which is very messy. And of course everything that calls this function relies on that behavior and works around it. :P
The name of the file. (Ignored.)
The ID of the attachment.
Which directory it should be in. (Ignored.)
Whether this is a new attachment.
The file hash. (Ignored.)
A hash or the path to the file.
Return an array with allowed bbc tags for signatures, that can be passed to parse_bbc().
get_signature_allowed_bbc_tags() : array<string|int, mixed>
An array containing allowed tags for signatures, or an empty array if all tags are allowed.
Highlight any code.
highlight_php_code(string $code) : string
Uses PHP's highlight_string() to highlight PHP syntax does special handling to keep the tabs in the code available. used to parse PHP code from inside [code] and [php] tags.
The code
The code with highlighted HTML.
Parse bulletin board code in a string, as well as smileys optionally.
parse_bbc(string|bool $message[, bool $smileys = true ][, string $cache_id = '' ][, array<string|int, mixed> $parse_tags = [] ]) : string
The message. When a empty string, nothing is done. When false we provide a list of BBC codes available. When a string, the message is parsed and bbc handled.
Whether to parse smileys as well
The cache ID
If set, only parses these tags rather than all of them
The parsed message
Parse smileys in the passed message.
parseSmileys(string &$message) : void
The smiley parsing function which makes pretty faces appear :). If custom smiley sets are turned off by smiley_enable, the default set of smileys will be used. These are specifically not parsed in code tags [url=mailto:Dad@blah.com] Caches the smileys from the database or array in memory. Doesn't return anything, but rather modifies message directly.
The message to parse smileys in
Converts HTML to BBC As of SMF 2.1, only used by ManageBoards.php (and possibly mods)
html_to_bbc(string $string) : string
The text with html converted to bbc
Check for moderators and see if they have access to the board.
loadBoard() : array<string|int, mixed>
What it does:
Mark a board or multiple boards read.
markBoardsRead(int|array<string|int, mixed> $boards[, bool $unread = false ]) : void
The ID of a single board or an array of boards
Whether we're marking them as unread
Get the id_member associated with the specified message.
getMsgMemberID(int $messageID) : int
The ID of the message
The ID of the member associated with that post
Modify the settings and position of a board.
modifyBoard(int $board_id, array<string|int, mixed> &$boardOptions) : void
Used by ManageBoards.php to change the settings of a board.
The ID of the board
An array of options related to the board
Create a new board and set its properties and position.
createBoard(array<string|int, mixed> $boardOptions) : int
Allows (almost) the same options as the modifyBoard() function. With the option inherit_permissions set, the parent board permissions will be inherited.
An array of information for the new board
The ID of the new board
Remove one or more boards.
deleteBoards(array<string|int, mixed> $boards_to_remove[, int $moveChildrenTo = null ]) : void
Allows to move the children of the board before deleting it if moveChildrenTo is set to null, the child boards will be deleted. Deletes:
The boards to remove
The ID of the board to move the child boards to (null to remove the child boards, 0 to make them a top-level board)
Put all boards in the right order and sorts the records of the boards table.
reorderBoards() : void
Used by modifyBoard(), deleteBoards(), modifyCategory(), and deleteCategories() functions
Fixes the children of a board by setting their child_levels to new values.
fixChildren(int $parent, int $newLevel, int $newParent) : void
Used when a board is deleted or moved, to affect its children.
The ID of the parent board
The new child level for each of the child boards
The ID of the new parent board
Takes a board array and sorts it
sortBoards(array<string|int, mixed> &$boards) : void
The boards
Returns the given board's moderators, with their names and links
getBoardModerators(array<string|int, mixed> $boards) : array<string|int, mixed>
The boards to get moderators of
An array containing information about the moderators of each board
Returns board's moderator groups with their names and link
getBoardModeratorGroups(array<string|int, mixed> $boards) : array<string|int, mixed>
The boards to get moderator groups of
An array containing information about the groups assigned to moderate each board
Returns whether the child board id is actually a child of the parent (recursive).
isChildOf(int $child, int $parent) : bool
The ID of the child board
The ID of a parent board
Whether the specified child board is actually a child of the specified parent board.
Get all parent boards (requires first parent as parameter) It finds all the parents of id_parent, and that board itself.
getBoardParents(int $id_parent) : array<string|int, mixed>
Additionally, it detects the moderators of said boards.
The ID of the parent board
An array of information about the boards found.
Loads information about what browser the user is viewing with and places it in $context - uses the class from {@link Class-BrowserDetect.php}
detectBrowser() : void
Are we using this browser?
isBrowser(string $browser) : bool
Wrapper function for detectBrowser
The browser we are checking for.
Whether or not the current browser is what we're looking for
Edit the position and properties of a category.
modifyCategory(int $category_id, array<string|int, mixed> $catOptions) : void
general function to modify the settings and position of a category. used by ManageBoards.php to change the settings of a category.
The ID of the category
An array containing data and options related to the category
Create a new category.
createCategory(array<string|int, mixed> $catOptions) : mixed
general function to create a new category and set its position. allows (almost) the same options as the modifyCat() function. returns the ID of the newly created category.
An array of data and settings related to the new category. Should have at least 'cat_name' and can also have 'cat_desc', 'move_after' and 'is_collapsable'
Remove one or more categories.
deleteCategories(array<string|int, mixed> $categories[, int $moveBoardsTo = null ]) : void
general function to delete one or more categories. allows to move all boards in the categories to a different category before deleting them. if moveChildrenTo is set to null, all boards inside the given categories will be deleted. deletes all information that's associated with the given categories. updates the statistics to reflect the new situation.
The IDs of the categories to delete
The ID of the category to move any boards to or null to delete the boards
Takes a category array and sorts it
sortCategories(array<string|int, mixed> &$categories) : void
The categories
Tries to load up the entire board order and category very very quickly Returns an array with two elements, cats and boards
getTreeOrder() : array<string|int, mixed>
An array of categories and boards
Load a lot of useful information regarding the boards and categories.
getBoardTree() : void
The information retrieved is stored in globals: $boards properties of each board. $boardList a list of boards grouped by category ID. $cat_tree properties of each category.
Recursively get a list of boards.
recursiveBoards(mixed &$list, mixed &$tree) : void
Used by getBoardTree
Sets the SMF-style login cookie and session based on the id_member and password passed.
setLoginCookie(int $cookie_length, int $id[, string $password = '' ]) : void
How many seconds the cookie should last. If negative, forces logout.
The ID of the member to set the cookie for
The hashed password
Sets Two Factor Auth cookie
setTFACookie(int $cookie_length, int $id, string $secret) : void
How long the cookie should last, in seconds
The ID of the member
Should be a salted secret using hash_salt
Get the domain and path for the cookie - normally, local and global should be the localCookies and globalCookies settings, respectively.
url_parts(bool $local, bool $global) : array<string|int, mixed>
Whether we want local cookies
Whether we want global cookies
An array to set the cookie on with domain and path in it, in that order
Hashes password with salt and authentication secret. This is solely used for cookies.
hash_salt(string $password, string $salt) : string
The password
The salt
The hashed password
A wrapper for setcookie that gives integration hook access to it
smf_setcookie(string $name[, string $value = '' ][, int $expires = 0 ][, string $path = '' ][, string $domain = '' ][, bool|null $secure = null ][, bool $httponly = true ][, string|null $samesite = null ]) : void
= ''
= 0
= ''
= ''
= null
= true
= null
Deletes one or many drafts from the DB Validates the drafts are from the user is supplied an array of drafts will attempt to remove all of them
DeleteDraft(int $id_draft[, bool $check = true ]) : bool
The ID of the draft to delete
Whether or not to check that the draft belongs to the current user
False if it couldn't be deleted (doesn't return anything otherwise)
Loads in a group of drafts for the user of a given type (0/posts, 1/pm's) loads a specific draft for forum use if selected.
ShowDrafts(int $member_id[, bool|inr $reply_to = 0 ][, int $draft_type = 0 ]) : bool
Used in the posting screens to allow draft selection Will load a draft if selected is supplied via post
ID of the member to show drafts for.
ID of the topic or PM being replied to.
The type of drafts to show: 0 = post, 1 = PM.
False if the drafts couldn't be loaded, nothing otherwise
Show all drafts of a given type by the current user Uses the showdraft template Allows for the deleting and loading/editing of drafts
showProfileDrafts(int $memID[, int $draft_type = 0 ]) : void
Creates a box that can be used for richedit stuff like BBC, Smileys etc.
create_control_richedit(array<string|int, mixed> $options) : Editor
Retrieves a list of message icons.
getMessageIcons(int $board_id) : array<string|int, mixed>
The ID of the board
An array of info about available icons
Handler for standard error messages, standard PHP error handler replacement.
smf_error_handler(int $error_level, string $error_string, string $file, int $line) : void
It dies with fatal_error() if the error_level matches with error_reporting.
Log an error, if the error logging is enabled.
log_error(string $error_message[, string|bool $error_type = 'general' ][, string $file = '' ][, int $line = 0 ]) : string
filename and line should be FILE and LINE, respectively. Example use: die(log_error($msg));
The message to log
The type of error
The name of the file where this error occurred
The line where the error occurred
The message that was logged
An irrecoverable error. This function stops execution and displays an error message.
fatal_error(string $error[, string|bool $log = 'general' ][, int $status = 500 ]) : void
It logs the error message if $log is specified.
The error message
= 'general' What type of error to log this as (false to not log it))
The HTTP status code associated with this error
Shows a fatal error with a message stored in the language file.
fatal_lang_error(string $error[, string|false $log = 'general' ][, array<string|int, mixed> $sprintf = [] ][, int $status = 403 ]) : mixed
This function stops execution and displays an error message by key.
The error message
The type of error, or false to not log it
An array of data to be sprintf()'d into the specified message
= false The HTTP status code associated with this error
Show a message for the (full block) maintenance mode.
display_maintenance_message() : void
It shows a complete page independent of language files or themes. It is used only if $maintenance = 2 in Settings.php. It stops further execution of the script.
Show an error message for the connection problems.
display_db_error() : void
It shows a complete page independent of language files or themes. It is used only if there's no way to connect to the database. It stops further execution of the script.
Show an error message for load average blocking problems.
display_loadavg_error() : void
It shows a complete page independent of language files or themes. It is used only if the load averages are too high to continue execution. It stops further execution of the script.
Consolidating the various INSERT statements into this function.
insertEvent(array<string|int, mixed> $eventOptions) : void
Inserts the passed event information into the calendar table. Allows to either set a time span (in days) or an end_date. Does not check any permissions of any sort.
An array of event options ('title', 'span', 'start_date', 'end_date', etc.)
modifies an event.
modifyEvent(int $event_id, array<string|int, mixed> &$eventOptions) : void
allows to either set a time span (in days) or an end_date. does not check any permissions of any sort.
The ID of the event
An array of event information
Remove an event removes an event.
removeEvent(int $event_id) : void
does no permission checks.
The ID of the event to remove
Retrieve a list of (visible) membergroups used by the cache.
cache_getMembergroupList() : array<string|int, mixed>
An array of information about the cache
Process functions of an integration hook.
call_integration_hook(string $name[, array<string|int, mixed> $parameters = [] ]) : array<string|int, mixed>
calls all functions of the given hook. supports static class method calls.
The hook name
An array of parameters this hook implements
The results of the functions
Add a function for integration hook.
add_integration_function(string $name, string $function[, bool $permanent = true ][, string $file = '' ][, bool $object = false ]) : void
Does nothing if the function is already added. Cleans up enabled/disabled variants before taking requested action.
The complete hook name.
The function name. Can be a call to a method via Class::method.
If true, updates the value in settings table.
The file. Must include one of the following wildcards: $boarddir, $sourcedir, $themedir, example: $sourcedir/Test.php
Indicates if your class will be instantiated when its respective hook is called. If true, your function must be a method.
Remove an integration hook function.
remove_integration_function(string $name, string $function[, bool $permanent = true ][, string $file = '' ][, bool $object = false ]) : void
Removes the given function from the given hook. Does nothing if the function is not available. Cleans up enabled/disabled variants before taking requested action.
The complete hook name.
The function name. Can be a call to a method via Class::method.
Irrelevant for the function itself but need to declare it to match
The filename. Must include one of the following wildcards: $boarddir, $sourcedir, $themedir, example: $sourcedir/Test.php
Indicates if your class will be instantiated when its respective hook is called. If true, your function must be a method.
Convert a single IP to a ranged IP.
ip2range(string $addr) : array<string|int, mixed>
internal function used to convert a user-readable format to a format suitable for the database.
An array of IP parts
Convert a range of given IP number into a single string.
range2ip(array<string|int, mixed> $low, array<string|int, mixed> $high) : string
It's practically the reverse function of ip2range().
The low end of the range in IPv4 format
The high end of the range in IPv4 format
A string indicating the range
Check the given String if he is a valid IPv4 or IPv6 return true or false
isValidIP(string $ip) : bool
Validates a IPv6 address. returns true if it is ipv6.
isValidIPv6(string $ip) : bool
The ip address to be validated
Whether the specified IP is a valid IPv6 address
Lookup an IP; try shell_exec first because we can do a timeout on it.
host_from_ip(string $ip) : string
The IP to get the hostname from
The hostname
Converts an IP address into binary
inet_ptod(string $ip) : string|false
The IP address in binary or false
Converts a binary version of an IP address into a readable format
inet_dtop(string $ip) : string|false
The IP address in presentation format or false on error
Expands a IPv6 address to its full form.
expandIPv6(string $ip[, bool $return_bool_if_invalid = true ]) : string|bool
The expanded IPv6 address or false if $strict_check is true and the result isn't valid
Detect if a IP is in a CIDR address - returns true or false
matchIPtoCIDR(string $ip_address, string $cidr_address) : bool
IP address to check
CIDR address to verify
Whether the IP matches the CIDR
Create a new list
createList(array<string|int, mixed> $options) : ItemList
Load a language file. Tries the current and default themes as well as the user and global languages.
loadLanguage(string $template_name[, string $lang = '' ][, bool $fatal = true ][, bool $force_reload = false ]) : string
The name of a template file
A specific language to load this file from
Whether to die with an error if it can't be loaded
Whether to load the file again if it's already loaded
The language actually loaded.
Attempt to reload our known languages.
getLanguages([bool $use_cache = true ]) : array<string|int, mixed>
It will try to choose only utf8 or non-utf8 languages.
Whether or not to use the cache
An array of information about available languages
Replace all vulgar words with respective proper words. (substring or whole words..) What this function does: - it censors the passed string.
censorText(string &$text[, bool $force = false ]) : string
The text to censor
Whether to censor the text regardless of settings
The censored text
tokenTxtReplace([string $string = '' ]) : string
Concatenates an array of strings into a grammatically correct sentence list
sentence_list(array<string|int, mixed> $list) : string
Uses formats defined in the language files to build the list appropropriately for the currently loaded language.
An array of strings to concatenate.
The localized sentence list.
- Formats a number.
comma_format(float $number[, int|null $decimals = null ]) : string
A number
A formatted number
Put this user in the online log.
writeLog([bool $force = false ]) : void
Whether to force logging the data
This function logs an action to the database. It is a thin wrapper around {@link logActions()}.
logAction(string $action[, array<string|int, mixed> $extra = [] ][, string $log_type = 'moderate' ]) : int
A code for the report; a list of such strings can be found in Modlog.{language}.php (modlog_ac_ strings)
An associated array of parameters for the item being logged. Typically this will include 'topic' for the topic's id.
A string reflecting the type of log.
The ID of the row containing the logged data
Log changes to the forum, such as moderation events or administrative changes. This behaves just like {@link logAction()} in SMF 2.0, except that it is designed to log multiple actions at once.
logActions(array<string|int, mixed> $logs) : int
SMF uses three log types:
user
for actions executed that aren't related to
moderation (e.g. signature or other changes from the profile);moderate
for moderation actions (e.g. topic changes);admin
for administrative actions.An array of log data
The last logged ID
Update some basic statistics.
updateStats(string $type[, mixed $parameter1 = null ][, mixed $parameter2 = null ]) : void
'member' statistic updates the latest member, the total member count, and the number of unapproved members. 'member' also only counts approved members when approval is on, but is much more efficient with it off.
'message' changes the total number of messages, and the highest message id by id_msg - which can be parameters 1 and 2, respectively.
'topic' updates the total number of topics, or if parameter1 is true simply increments them.
'subject' updates the log_search_subjects in the event of a topic being moved, removed or split. parameter1 is the topicid, parameter2 is the new subject
'postgroups' case updates those members who match condition's post-based membergroups in the database (restricted by parameter1).
Stat type - can be 'member', 'message', 'topic', 'subject' or 'postgroups'
A parameter for updating the stats
A 2nd parameter for updating the stats
Track Statistics.
trackStats([array<string|int, mixed> $stats = [] ]) : bool
Caches statistics changes, and flushes them if you pass nothing. If '+' is used as a value, it will be incremented. It does not actually commit the changes until the end of the page view. It depends on the trackStats setting.
An array of data
Whether or not the info was updated successfully
Check if the number of users online is a record and store it.
trackStatsUsersOnline(int $total_users_online) : void
The total number of members online
Retrieve a list and several other statistics of the users currently online.
getMembersOnlineStats(array<string|int, mixed> $membersOnlineOptions) : array<string|int, mixed>
Used by the board index and SSI. Also returns the membergroups of the users that are currently online. (optionally) hides members that chose to hide their online presence.
An array of options for the list
An array of information about the online users
This function shows the debug information tracked when $db_show_debug = true in Settings.php
displayDebug() : void
This function sends an email to the specified recipient(s).
sendMail(array<string|int, mixed> $to, string $subject, string $message[, string $from = null ][, string $message_id = null ][, bool $send_html = false ][, int $priority = 3 ][, bool $hotmail_fix = null ][, bool $is_private = false ]) : bool
It uses the mail_type settings and webmaster_email variable.
The email(s) to send to
Email subject, expected to have entities, and slashes, but not be parsed
Email body, expected to have slashes, no htmlentities
The address to use for replies
If specified, it will be used as local part of the Message-ID header.
Whether or not the message is HTML vs. plain text
The priority of the message
Whether to apply the "hotmail fix"
Whether this is private
Whether ot not the email was sent properly.
Add an email to the mail queue.
AddMailQueue([bool $flush = false ][, array<string|int, mixed> $to_array = [] ][, string $subject = '' ][, string $message = '' ][, string $headers = '' ][, bool $send_html = false ][, int $priority = 3 ][, bool $is_private = false ]) : bool
Whether to flush the queue
An array of recipients
The subject of the message
The message
The headers
Whether to send in HTML format
The priority
Whether this is private
Whether the message was added
reduceQueue([bool|int $number = false ][, bool $override_limit = false ][, bool $force_send = false ]) : bool
Prepare text strings for sending as email body or header.
mimespecialchars(string $string[, bool $with_charset = true ][, bool $hotmail_fix = false ][, string $line_break = "
" ][, string $custom_charset = null ]) : array<string|int, mixed>
In case there are higher ASCII characters in the given string, this function will attempt the transport method 'quoted-printable'. Otherwise the transport method '7bit' is used.
The string
Whether we're specifying a charset ($custom_charset must be set here)
Whether to apply the hotmail fix (all higher ASCII characters are converted to HTML entities to assure proper display of the mail)
The linebreak
If set, it uses this character set
An array containing the character set, the converted string and the transport method.
serverParse(string $message, mixed $socket, string $code[, string|null &$response = null ]) : bool
Sends a notification to members who have elected to receive emails when things happen to a topic, such as replies are posted.
sendNotifications(array<string|int, mixed> $topics, string $type[, array<string|int, mixed> $exclude = [] ][, array<string|int, mixed> $members_only = [] ]) : mixed
The function automatically finds the subject and its board, and checks permissions for each member who is "signed up" for notifications. It will not send 'reply' notifications more than once in a row. Uses Post language file
Represents the topics the action is happening to.
Can be any of reply, sticky, lock, unlock, remove, move, merge, and split. An appropriate message will be sent for each.
Members in the exclude array will not be processed for the topic with the same key.
Are the only ones that will be sent the notification if they have it on.
This simple function gets a list of all administrators and sends them an email to let them know a new member has joined.
adminNotify(string $type, int $memberID[, string $member_name = null ]) : void
Called by registerMember() function in Subs-Members.php. Email is sent to all groups that have the moderate_forum permission. The language set by each member is being used (if available). Uses the Login language file
The type. Types supported are 'approval', 'activation', and 'standard'.
The ID of the member
The name of the member (if null, it is pulled from the database)
Load a template from EmailTemplates language file.
loadEmailTemplate(string $template[, array<string|int, mixed> $replacements = [] ][, string $lang = '' ][, bool $loadLang = true ]) : array<string|int, mixed>
The name of the template to load
An array of replacements for the variables in the template
The language to use, if different than the user's current language
Whether to load the language file first
An array containing the subject and body of the email template, with replacements made
Create a menu.
createMenu(array<string|int, mixed> $data[, array<string|int, mixed> $options = [] ]) : bool|array<string|int, mixed>
False if nothing to show or an array of info about the selected menu item
Delete a menu.
destroyMenu([int|string $id = 'last' ]) : bool|void
False if the menu doesn't exist, nothing otherwise
Takes a message and parses it, returning nothing.
preparsecode(string &$message[, bool $previewing = false ]) : void
Cleans up links (javascript, etc.) and code/quote sections. Won't convert \n's and a few other things if previewing is true.
The mesasge
Whether we're previewing
This is very simple, and just removes things done by preparsecode.
un_preparsecode(string $message) : string
The message
Fix any URLs posted - ie. remove 'javascript:'.
fixTags(string &$message) : void
Used by preparsecode, fixes links in message and returns nothing.
The message
Fix a specific class of tag - ie. url with =.
fixTag(string &$message, string $myTag, string $protocols[, bool $embeddedUrl = false ][, bool $hasEqualSign = false ][, bool $hasExtra = false ]) : void
Used by fixTags, fixes a specific tag's links.
The message
The tag
The protocols
Whether it can be set to something
Whether it is set to something
Whether it can have extra cruft after the begin tag.
Create a post, either as new topic (id_topic = 0) or in an existing one.
createPost(array<string|int, mixed> &$msgOptions, array<string|int, mixed> &$topicOptions, array<string|int, mixed> &$posterOptions) : bool
The input parameters of this function assume:
An array of information/options for the post
An array of information/options for the topic
An array of information/options for the poster
Whether the operation was a success
Modifying a post.
modifyPost(array<string|int, mixed> &$msgOptions, array<string|int, mixed> &$topicOptions, array<string|int, mixed> &$posterOptions) : bool
..
An array of information/options for the post
An array of information/options for the topic
An array of information/options for the poster
Whether the post was modified successfully
Approve (or not) some posts... without permission checks.
approvePosts(array<string|int, mixed> $msgs[, bool $approve = true ][, bool $notify = true ]) : bool
..
Array of message ids
Whether to approve the posts (if false, posts are unapproved)
Whether to notify users
Whether the operation was successful
Upon approval, clear unread alerts.
clearApprovalAlerts(array<string|int, int> $content_ids, string $content_action) : void
either id_msgs or id_topics
will be either 'unapproved_post' or 'unapproved_topic'
Takes an array of board IDs and updates their last messages.
updateLastMessages(array<string|int, mixed> $setboards[, int $id_msg = 0 ]) : bool|null
If the board has a parent, that parent board is also automatically updated. The columns updated are id_last_msg and last_updated. Note that id_last_msg should always be updated using this function, and is not automatically updated upon other changes.
An array of board IDs
The ID of the message
Returns false if $setboards is empty for some reason
Remove a specific message (including permission checks).
removeMessage(int $message[, bool $decreasePostCount = true ]) : bool
The message id
Whether to decrease users' post counts
Whether the operation succeeded
Constructs a page list.
constructPageIndex(string $base_url, int &$start, int $num_items, int $num_per_page[, bool $short_format = false ][, bool $show_prevnext = true ]) : string
an example is available near the function definition. $pageindex = constructPageIndex($scripturl . '?board=' . $board, $_REQUEST['start'], $num_messages, $maxindex, true);
The basic URL to be used for each link.
The start position, by reference. If this is not a multiple of the number of items per page, it is sanitized to be so and the value will persist upon the function's return.
The total number of items you are paginating for.
The number of items to be displayed on a given page. $start will be forced to be a multiple of this value.
Whether a ;start=x component should be introduced into the URL automatically (see above)
Whether the Previous and Next links should be shown (should be on only when navigating the list)
The complete HTML of the page index that was requested, formatted by the template.
Allow the user to vote.
Vote() : void
It is called to register a vote in a poll. Must be called with a topic and option specified. Requires the poll_vote permission. Upon successful completion of action will direct user back to topic. Accessed via ?action=vote.
Uses Post language file.
Lock the voting for a poll.
LockVoting() : void
Must be called with a topic specified in the URL. An admin always has over riding permission to lock a poll. If not an admin must have poll_lock_any permission, otherwise must be poll starter with poll_lock_own permission. Upon successful completion of action will direct user back to topic. Accessed via ?action=lockvoting.
Display screen for editing or adding a poll.
EditPoll() : void
Must be called with a topic specified in the URL. If the user is adding a poll to a topic, must contain the variable 'add' in the url. User must have poll_edit_any/poll_add_any permission for the relevant action, otherwise must be poll starter with poll_edit_own permission for editing, or be topic starter with poll_add_any permission for adding. Accessed via ?action=editpoll.
Uses Post language file. Uses Poll template, main sub-template.
Update the settings for a poll, or add a new one.
EditPoll2() : void
Must be called with a topic specified in the URL. The user must have poll_edit_any/poll_add_any permission for the relevant action. Otherwise they must be poll starter with poll_edit_own permission for editing, or be topic starter with poll_add_any permission for adding. In the case of an error, this function will redirect back to EditPoll and display the relevant error message. Upon successful completion of action will direct user back to topic. Accessed via ?action=editpoll2.
Remove a poll from a topic without removing the topic.
RemovePoll() : void
Must be called with a topic specified in the URL. Requires poll_remove_any permission, unless it's the poll starter with poll_remove_own permission. Upon successful completion of action will direct user back to topic. Accessed via ?action=removepoll.
Validate the signature
profileValidateSignature(string &$value) : bool|string
The new signature
True if the signature passes the checks, otherwise a string indicating what the problem is
Handles the "manage groups" section of the profile
profileLoadGroups([int|null $id = null ]) : true
Always returns true
This defines every profile field known to man.
loadProfileFields([bool $force_reload = false ][, int|null $id = null ]) : void
Whether to reload the data
Load any custom fields for this area... no area means load all, 'summary' loads all public ones.
loadCustomFields(int $id[, string $area = 'summary' ]) : void
The ID of the member
Which area to load fields for
Loads the theme options for a user
loadThemeOptions(int $id[, bool $defaultSettings = false ]) : void
The ID of the member
If true, we are loading default options.
Setup the context for a page load!
setupProfileContext(array<string|int, mixed> $fields, int $id) : void
The profile fields to display. Each item should correspond to an item in the $profile_fields array generated by loadProfileFields
Save any changes to the custom profile fields
makeCustomFieldChanges(int $id, string $area[, bool $sanitize = true ][, bool $return_errors = false ]) : array<string|int, mixed>|null
The ID of the member
The area of the profile these fields are in
= true Whether or not to sanitize the data
Returns nothing or returns an array of error info if $returnErrors is true
Make any theme changes that are sent with the profile.
makeThemeChanges(int $id, int $id_theme) : void
The ID of the user
The ID of the theme
cleanRequest() : void
Compares existance request variables against an array.
is_filtered_request(array<string|int, mixed> $value_list, string $var) : bool
The input array is associative, where keys denote accepted values
in a request variable denoted by $req_val
. Values can be:
whether any of the criteria was satisfied
Rewrite URLs to include the session ID.
ob_sessrewrite(string $buffer) : string
What it does:
The unmodified output buffer
The modified buffer
Helper function to set the system memory to a needed value - If the needed memory is greater than current, will attempt to get more - if in_use is set to true, will also try to take the current memory usage in to account
setMemoryLimit(string $needed[, bool $in_use = false ]) : bool
The amount of memory to request, if needed, like 256M
Set to true to account for current memory usage of the script
True if we have at least the needed memory
Helper function to convert memory string settings to bytes
memoryReturnBytes(string $val) : int
The byte string, like 256M or 1G
The string converted to a proper integer in bytes
Checks whether a password meets the current forum rules - called when registering/choosing a password.
validatePassword(string $password, string $username[, array<string|int, mixed> $restrict_in = [] ]) : null|string
The desired password
The username
An array of restricted strings that cannot be part of the password (email address, username, etc.)
Null if valid or a string indicating what the problem was
Generate a random validation code.
generateValidationCode() : string
A random validation code
Hashes the user's password
hash_password(string $username, string $password[, int $cost = null ]) : string
The username. Ignored since 3.0.
The unhashed password
The cost
The hashed password
Verifies a raw SMF password against the encrypted string
hash_verify_password(string $username, string $password, string $hash) : bool
The username. Ignored since 3.0.
The password
The hashed string
Whether the hashed password matches the string
Benchmarks the server to figure out an appropriate cost factor (minimum 9)
hash_benchmark([float $hashTime = 0.2 ]) : int
Time to target, in seconds
The cost
Check if a specific confirm parameter was given.
checkConfirm(string $action) : bool|string
The action we want to check against
True if the check passed or a token
Check whether a form has been submitted twice.
checkSubmitOnce(string $action[, bool $is_fatal = true ]) : bool|null
Registers a sequence number for a form. Checks whether a submitted sequence number is registered in the current session. Depending on the value of is_fatal shows an error or returns true or false. Frees a sequence number from the stack after it's been checked. Frees a sequence number without checking if action == 'free'.
The action - can be 'register', 'check' or 'free'
Whether to die with a fatal error
If the action isn't check, returns nothing, otherwise returns whether the check was successful
This function attempts to protect from spammed messages and the like.
spamProtection(string $error_type[, bool $only_return_result = false ]) : bool
The time taken depends on error_type - generally uses the modSetting.
The error type. Also used as a $txt index (not an actual string).
Whether you want the function to die with a fatal_lang_error.
Whether they've posted within the limit
A generic function to create a pair of index.php and .htaccess files in a directory
secureDirectory(string|array<string|int, mixed> $paths[, bool $attachments = false ]) : bool|array<string|int, mixed>
The (absolute) directory path
Whether this is an attachment directory
True on success an array of errors if anything fails
This sets the X-Frame-Options header.
frameOptionsHeader([string $override = null ]) : mixed
An option to override (either 'SAMEORIGIN' or 'DENY')
This sets the Access-Control-Allow-Origin header.
corsPolicyHeader([bool $set_header = true ]) : void
(Default: true): When false, we will do the logic, but not send the headers. The relevant logic is still saved in the $context and can be sent manually.
Throws guests out to the login screen when guest access is off.
KickGuest() : void
Lets give you a token of our appreciation.
createToken(string $action[, string $type = 'post' ]) : array<string|int, mixed>
The action to create the token for
The type of token ('post', 'get' or 'request')
An array containing the name of the token var and the actual token
Only patrons with valid tokens can ride this ride.
validateToken(string $action[, string $type = 'post' ][, bool $reset = true ]) : bool
The action to validate the token for
The type of request (get, request, or post)
Whether to reset the token and display an error if validation fails
returns whether the validation was successful
Removes old unused tokens from session defaults to 3 hours before a token is considered expired if $complete = true will remove all tokens
cleanTokens([bool $complete = false ]) : void
Whether to remove all tokens or only expired ones
This shuts down the SSI and shows the footer.
ssi_shutdown() : void
Show the SMF version.
ssi_version([string $output_method = 'echo' ]) : void|string
If 'echo', displays the version, otherwise returns it
Returns nothing if output_method is 'echo', otherwise returns the version
Show the full SMF version string.
ssi_full_version([string $output_method = 'echo' ]) : void|string
If 'echo', displays the full version string, otherwise returns it
Returns nothing if output_method is 'echo', otherwise returns the version string
Show the SMF software year.
ssi_software_year([string $output_method = 'echo' ]) : void|string
If 'echo', displays the software year, otherwise returns it
Returns nothing if output_method is 'echo', otherwise returns the software year
Show the forum copyright. Only used in our ssi_examples files.
ssi_copyright([string $output_method = 'echo' ]) : void|string
If 'echo', displays the forum copyright, otherwise returns it
Returns nothing if output_method is 'echo', otherwise returns the copyright string
Display a welcome message, like: Hey, User, you have 0 messages, 0 are new.
ssi_welcome([string $output_method = 'echo' ]) : void|array<string|int, mixed>
The output method. If 'echo', will display everything. Otherwise returns an array of user info.
Displays a welcome message or returns an array of user data depending on output_method.
Display a menu bar, like is displayed at the top of the forum.
ssi_menubar([string $output_method = 'echo' ]) : array<string|int, mixed>|null
The output method. If 'echo', will display the menu, otherwise returns an array of menu data.
Displays the menu or returns an array of menu data depending on output_method.
Show a logout link.
ssi_logout([string $redirect_to = '' ][, string $output_method = 'echo' ]) : string|bool|null
A URL to redirect the user to after they log out.
The output method. If 'echo', shows a logout link, otherwise returns the HTML for it.
Displays a logout link or returns its HTML depending on output_method.
Recent post list: [board] Subject by Poster Date
ssi_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 ]) : array<string|int, mixed>|null
How many recent posts to display
If set, doesn't show posts from the specified boards
If set, only includes posts from the specified boards
The output method. If 'echo', displays the posts, otherwise returns an array of information about them.
Whether or not to only show the first 384 characters of each post
Displays a list of recent posts or returns an array of information about them depending on output_method.
Fetches one or more posts by ID.
ssi_fetchPosts([array<string|int, int> $post_ids = [] ][, bool $override_permissions = false ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
An array containing the IDs of the posts to show
Whether to ignore permissions. If true, will show posts even if the user doesn't have permission to see them.
The output method. If 'echo', displays the posts, otherwise returns an array of info about them
Displays the specified posts or returns an array of info about them, depending on output_method.
This handles actually pulling post info. Called from other functions to eliminate duplication.
ssi_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 $override_permissions = false ]) : array<string|int, mixed>|null
The WHERE clause for the query
An array of parameters for the WHERE clause
The maximum number of rows to return
The ORDER BY clause for the query
The output method. If 'echo', displays the posts, otherwise returns an array of info about them.
If true, will only show the first 384 characters of the post rather than all of it
Whether or not to ignore permissions. If true, will show all posts regardless of whether the user can actually see them
Displays the posts or returns an array of info about them, depending on output_method
Recent topic list: [board] Subject by Poster Date
ssi_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>
How many recent topics to show
If set, exclude topics from the specified board(s)
If set, only include topics from the specified board(s)
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them
Either displays a list of topics or returns an array of info about them, depending on output_method.
Shows a list of top posters
ssi_topPoster([int $topNumber = 1 ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
How many top posters to list
The output method. If 'echo', will display a list of users, otherwise returns an array of info about them.
Either displays a list of users or returns an array of info about them, depending on output_method.
Shows a list of top boards based on activity
ssi_topBoards([int $num_top = 10 ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
How many boards to display
The output method. If 'echo', displays a list of boards, otherwise returns an array of info about them.
Displays a list of the top boards or returns an array of info about them, depending on output_method.
Shows a list of top topics based on views or replies
ssi_topTopics([string $type = 'replies' ][, int $num_topics = 10 ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
Can be either replies or views
How many topics to display
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them.
Either displays a list of topics or returns an array of info about them, depending on output_method.
Top topics based on replies
ssi_topTopicsReplies([int $num_topics = 10 ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
How many topics to show
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them
Either displays a list of top topics or returns an array of info about them, depending on output_method.
Top topics based on views
ssi_topTopicsViews([int $num_topics = 10 ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
How many topics to show
The output method. If 'echo', displays a list of topics, otherwise returns an array of info about them
Either displays a list of top topics or returns an array of info about them, depending on output_method.
Show a link to the latest member: Please welcome, Someone, our latest member.
ssi_latestMember([string $output_method = 'echo' ]) : array<string|int, mixed>|null
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.
Displays a "welcome" message for the latest member or returns an array of info about them, depending on output_method.
Fetches a random member.
ssi_randomMember([string $random_type = '' ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
If 'day', only fetches a new random member once a day.
The output method. If 'echo', displays a link to the member's profile, otherwise returns an array of info about them.
Displays a link to a random member's profile or returns an array of info about them depending on output_method.
Fetch specific members
ssi_fetchMember([array<string|int, mixed> $member_ids = [] ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
The IDs of the members to fetch
The output method. If 'echo', displays a list of links to the members' profiles, otherwise returns an array of info about them.
Displays links to the specified members' profiles or returns an array of info about them, depending on output_method.
Get all members in the specified group
ssi_fetchGroupMembers([int $group_id = null ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
The ID of the group to get members from
The output method. If 'echo', returns a list of group members, otherwise returns an array of info about them.
Displays a list of group members or returns an array of info about them, depending on output_method.
Pulls info about members based on the specified parameters. Used by other functions to eliminate duplication.
ssi_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' ]) : array<string|int, mixed>|null
The info for the WHERE clause of the query
The parameters for the WHERE clause
The number of rows to return or an empty string to return all
The info for the ORDER BY clause of the query
The output method. If 'echo', displays a list of members, otherwise returns an array of info about them
Displays a list of members or returns an array of info about them, depending on output_method.
Show some basic stats: Total This: XXXX, etc.
ssi_boardStats([string $output_method = 'echo' ]) : array<string|int, mixed>|null
The output method. If 'echo', displays the stats, otherwise returns an array of info about them
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.
Shows a list of online users: YY Guests, ZZ Users and then a list.
ssi_whosOnline([string $output_method = 'echo' ]) : array<string|int, mixed>|null
..
The output method. If 'echo', displays a list, otherwise returns an array of info about the online users.
Either displays a list of online users or returns an array of info about them, depending on output_method.
Just like whosOnline except it also logs the online presence.
ssi_logOnline([string $output_method = 'echo' ]) : array<string|int, mixed>|null
The output method. If 'echo', displays a list, otherwise returns an array of info about the online users.
Either displays a list of online users or returns an array of info about them, depending on output_method.
Shows a login box
ssi_login([string $redirect_to = '' ][, string $output_method = 'echo' ]) : bool|null
The URL to redirect the user to after they login
The output method. If 'echo' and the user is a guest, displays a login box, otherwise returns whether the user is a guest
Either displays a login box or returns whether the user is a guest, depending on whether the user is logged in and output_method.
Show the top poll based on votes
ssi_topPoll([string $output_method = 'echo' ]) : array<string|int, mixed>|null
The output method. If 'echo', displays the poll, otherwise returns an array of info about it
Either shows the top poll or returns an array of info about it, depending on output_method.
Shows the most recent poll
ssi_recentPoll([bool $topPollInstead = false ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
Whether to show the top poll (based on votes) instead of the most recent one
The output method. If 'echo', displays the poll, otherwise returns an array of info about it.
Either shows the poll or returns an array of info about it, depending on output_method.
Shows the poll from the specified topic
ssi_showPoll([null|int $topic = null ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
The topic to show the poll from. If null, $_REQUEST['ssi_topic'] will be used instead.
The output method. If 'echo', displays the poll, otherwise returns an array of info about it.
Either displays the poll or returns an array of info about it, depending on output_method.
Handles voting in a poll (done automatically)
ssi_pollVote() : mixed
Shows a search box
ssi_quickSearch([string $output_method = 'echo' ]) : string|null
The output method. If 'echo', displays a search box, otherwise returns the URL of the search page.
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.
Show a random forum news item
ssi_news([string $output_method = 'echo' ]) : string|null
The output method. If 'echo', shows the news item, otherwise returns it.
Shows or returns a random forum news item, depending on output_method.
Show today's birthdays.
ssi_todaysBirthdays([string $output_method = 'echo' ]) : array<string|int, mixed>|null
The output method. If 'echo', displays a list of users, otherwise returns an array of info about them.
Displays a list of users or returns an array of info about them depending on output_method.
Shows today's holidays.
ssi_todaysHolidays([string $output_method = 'echo' ]) : array<string|int, mixed>|null
The output method. If 'echo', displays a list of holidays, otherwise returns an array of info about them.
Displays a list of holidays or returns an array of info about them depending on output_method
Shows today's events.
ssi_todaysEvents([string $output_method = 'echo' ]) : array<string|int, mixed>|null
The output method. If 'echo', displays a list of events, otherwise returns an array of info about them.
Displays a list of events or returns an array of info about them depending on output_method
Shows today's calendar items (events, birthdays and holidays)
ssi_todaysCalendar([string $output_method = 'echo' ]) : array<string|int, mixed>|string|null
The output method. If 'echo', displays a list of calendar items, otherwise returns an array of info about them.
Displays a list of calendar items or returns an array of info about them depending on output_method
Show the latest news, with a template... by board.
ssi_boardNews([null|int $board = null ][, null|int $limit = null ][, null|int $start = null ][, null|int $length = null ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
The ID of the board to get the info from. Defaults to $board or $_GET['board'] if not set.
How many items to show. Defaults to $_GET['limit'] or 5 if not set.
Start with the specified item. Defaults to $_GET['start'] or 0 if not set.
How many characters to show from each post. Defaults to $_GET['length'] or 0 (no limit) if not set.
The output method. If 'echo', displays the news items, otherwise returns an array of info about them.
Displays the news items or returns an array of info about them, depending on output_method.
Show the most recent events
ssi_recentEvents([int $max_events = 7 ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
The maximum number of events to show
The output method. If 'echo', displays the events, otherwise returns an array of info about them.
Displays the events or returns an array of info about them, depending on output_method.
Checks whether the specified password is correct for the specified user.
ssi_checkPassword([int|string $id = null ][, string $password = null ][, bool $is_username = false ]) : bool
The ID or username of a user
The password to check
If true, treats $id as a username rather than a user ID
Whether or not the password is correct.
Shows the most recent attachments that the user can see
ssi_recentAttachments([int $num_attachments = 10 ][, array<string|int, mixed> $attachment_ext = [] ][, string $output_method = 'echo' ]) : array<string|int, mixed>|null
How many to show
Only shows attachments with the specified extensions ('jpg', 'gif', etc.) if set
The output method. If 'echo', displays a table with links/info, otherwise returns an array with information about the attachments
Displays a table of attachment info or returns an array containing info about the attachments, depending on output_method.
Attempt to start the session, unless it already has been.
loadSession() : void
Calculate the next time the passed tasks should be triggered.
CalculateNextTrigger([string|array<string|int, mixed> $tasks = [] ][, bool $force_update = false ]) : void
The ID of a single task or an array of tasks
Load a theme, by ID.
loadTheme([int $id = 0 ][, bool $initialize = true ]) : mixed
The ID of the theme to load
Whether or not to initialize a bunch of theme-related variables/settings
This loads the bare minimum data to allow us to load language files!
loadEssentialThemeData() : void
Load a template - if the theme doesn't include it, use the default.
loadTemplate(string $template_name[, array<string|int, mixed>|string $style_sheets = [] ][, bool $fatal = true ]) : bool
What this function does:
The name of the template to load
The name of a single stylesheet or an array of names of stylesheets to load
If true, dies with an error message if the template cannot be found
Whether or not the template was loaded
Load a sub-template.
loadSubTemplate(string $sub_template_name[, bool $fatal = false ]) : mixed
What it does: - loads the sub template specified by sub_template_name, which must be in an already-loaded template.
The name of the sub-template to load
Whether to die with an error if the sub-template can't be loaded
Add a CSS file for output later
loadCSSFile(string $filename[, array<string|int, mixed> $params = [] ][, string $id = '' ]) : void
The name of the file to load
An array of parameters Keys are the following: - ['external'] (true/false): define if the file is a externally located file. Needs to be set to true if you are loading an external file - ['default_theme'] (true/false): force use of default theme url - ['force_current'] (true/false): if this is false, we will attempt to load the file from the default theme if not found in the current theme
An ID to stick on the end of the filename for caching purposes
Add a block of inline css code to be executed later
addInlineCss(string $css) : bool|null
Some css code
Adds the CSS to the $context['css_header'] array or returns if no CSS is specified
Add a Javascript file for output later
loadJavaScriptFile(string $fileName[, array<string|int, mixed> $params = [] ][, string $id = '' ]) : void
The name of the file to load
An array of parameter info Keys are the following: - ['external'] (true/false): define if the file is a externally located file. Needs to be set to true if you are loading an external file - ['default_theme'] (true/false): force use of default theme url - ['defer'] (true/false): define if the file should load in
or before the closing tag - ['force_current'] (true/false): if this is false, we will attempt to load the file from the default theme if not found in the current themeAn ID to stick on the end of the filename
Add a Javascript variable for output later (for feeding text strings and similar to JS) Cleaner and easier (for modders) than to use the function below.
addJavaScriptVar(string $key, string $value[, bool $escape = false ]) : mixed
The key for this variable
The value
Whether or not to escape the value
Add a block of inline Javascript code to be executed later
addInlineJavaScript(string $javascript[, bool $defer = false ]) : bool|null
Some JS code
Whether the script should load in
or before the closing tagAdds the code to one of the $context['javascript_inline'] arrays or returns if no JS was specified
Sets up the basic theme context stuff.
setupThemeContext([bool $forceload = false ]) : mixed
Whether to load the theme even if it's already loaded
Sets up all of the top menu buttons Saves them in the cache if it is available and on Places the results in $context
setupMenuContext() : void
The header template
template_header() : void
Show the copyright.
theme_copyright() : void
The template footer
template_footer() : void
Output the Javascript files - tabbing in this function is to make the HTML source look good and proper - if deferred is set function will output all JS set to load at page end
template_javascript([bool $do_deferred = false ]) : void
If true will only output the deferred JS (the stuff that goes right before the closing body tag)
Output the CSS files
template_css() : void
Get an array of previously defined files and adds them to our main minified files.
custMinify(array<string|int, mixed> $data, string $type) : array<string|int, mixed>
Sets a one day cache to avoid re-creating a file on every request.
The files to minify.
either css or js.
Info about the minified file, or about the original files if the minify process failed.
Clears out old minimized CSS and JavaScript files and ensures $modSettings['browser_cache'] is up to date
deleteAllMinified() : void
Set an option via javascript.
SetJavaScript() : void
Possibly the simplest and best example of how to use the template system.
WrapAction() : void
Choose a theme from a list.
PickTheme() : void
allows a user to pick a new theme with an interface.
Replacement for strftime() that is compatible with PHP 8.1+.
smf_strftime(string $format[, int|null $timestamp = null ][, string|null $tzid = null ]) : string
This does not use the system's strftime library or locale setting, so results may vary in a few cases from the results of strftime():
%a, %A, %b, %B, %p, %P: Output will use SMF's language strings to localize these values. If SMF's language strings have not been loaded, PHP's default English strings will be used.
%c, %x, %X: Output will always use ISO format.
A strftime() format string.
A Unix timestamp. If null, defaults to the current time.
Time zone identifier. If null, uses default time zone.
The formatted datetime string.
Replacement for gmstrftime() that is compatible with PHP 8.1+.
smf_gmstrftime(string $format[, int|null $timestamp = null ]) : string
Calls smf_strftime() with the $tzid parameter set to 'UTC'.
A strftime() format string.
A Unix timestamp. If null, defaults to the current time.
The formatted datetime string.
Gets a version of a strftime() format that only shows the date or time components
get_date_or_time_format([string $type = '' ][, string $format = '' ][, bool|null $strftime = null ]) : string
Either 'date' or 'time'.
A strftime() format to process. Defaults to $user_info['time_format'].
A strftime() format string
Format a time to make it look purdy.
timeformat(int $log_time[, bool|string $show_today = true ][, null|string $tzid = null ]) : string
A timestamp
Whether to show "Today"/"Yesterday" or just a date. If a string is specified, that is used to temporarily override the date format.
Time zone to use when generating the formatted string. If empty, the user's time zone will be used. If set to 'forum', the value of $modSettings['default_timezone'] will be used. If set to a valid time zone identifier, that will be used. Otherwise, the value of date_default_timezone_get() will be used.
A formatted time string
Helper function to convert date string to english so that date_parse can parse the date
convertDateToEnglish(string $date) : string
A localized date string
English date string
Deprecated function that formerly applied manual offsets to Unix timestamps in order to provide a fake version of time zone support on ancient versions of PHP. It now simply returns an unaltered timestamp.
since 2.1
forum_time([bool $use_user_offset = true ][, int $timestamp = null ]) : int
This parameter is deprecated and nonfunctional
A timestamp (null to use current time)
Seconds since the Unix epoch
Get a list of time zones.
smf_list_timezones([string $when = 'now' ]) : array<string|int, mixed>
The date/time for which to calculate the time zone values. May be a Unix timestamp or any string that strtotime() can understand. Defaults to 'now'.
An array of time zone identifiers and label text.
Returns an array that instructs SMF how to map specific time zones (e.g. "America/Denver") onto the user-friendly "meta-zone" labels that most people think of as time zones (e.g. "Mountain Time").
get_tzid_metazones([string $when = 'now' ]) : array<string|int, mixed>
The date/time used to determine fallback values. May be a Unix timestamp or any string that strtotime() can understand. Defaults to 'now'.
An array relating time zones to "meta-zones"
Returns an array of all the time zones in a country, ranked according to population and/or political significance.
get_sorted_tzids_for_country(string $country_code[, string $when = 'now' ]) : array<string|int, mixed>
The two-character ISO-3166 code for a country.
The date/time used to determine fallback values. May be a Unix timestamp or any string that strtotime() can understand. Defaults to 'now'.
An array relating time zones to "meta-zones"
Checks a list of time zone identifiers to make sure they are all defined in the installed version of the time zone database, and returns an array of key-value substitution pairs.
get_tzid_fallbacks(array<string|int, mixed> $tzids[, string $when = 'now' ]) : array<string|int, mixed>
For defined time zone identifiers, the substitution value will be identical to the original value. For undefined ones, the substitute will be a time zone identifier that was equivalent to the missing one at the specified time, or an empty string if there was no equivalent at that time.
Note: These fallbacks do not need to include every new time zone ever. They only need to cover any that are used in $tzid_metazones.
To find the date & time when a new time zone comes into effect, check the TZDB changelog at https://data.iana.org/time-zones/tzdb/NEWS
The time zone identifiers to check.
The date/time used to determine substitute values. May be a Unix timestamp or any string that strtotime() can understand. Defaults to 'now'.
Substitute values for any missing time zone identifiers.
Validates a set of two-character ISO 3166-1 country codes.
validate_iso_country_codes(array<string|int, mixed>|string $country_codes[, bool $as_csv = false ]) : array<string|int, mixed>|string
Array or CSV string of country codes.
If true, return CSV string instead of array.
Array or CSV string of valid country codes.
Locks a topic... either by way of a moderator or the topic starter.
LockTopic() : void
What this does:
Sticky a topic.
Sticky() : void
Can't be done by topic starters - that would be annoying! What this does:
Approve topics?
approveTopics(array<string|int, mixed> $topics[, bool $approve = true ]) : bool
Array of topic ids
Whether to approve the topics. If false, unapproves them instead
Whether the operation was successful
Moves one or more topics to a specific board. (doesn't check permissions.) Determines the source boards for the supplied topics Handles the moving of mark_read data Updates the posts count of the affected boards
moveTopics(int|array<string|int, int> $topics, int $toBoard) : mixed
The ID of a single topic to move or an array containing the IDs of multiple topics to move
The ID of the board to move the topics to
Removes the passed id_topic's. (permissions are NOT checked here!).
removeTopics(array<string|int, mixed>|int $topics[, bool $decreasePostCount = true ][, bool $ignoreRecycling = false ][, bool $updateBoardCount = true ]) : mixed
The topics to remove (can be an id or an array of ids).
Whether to decrease the users' post counts
Whether to ignore recycling board settings
Whether to adjust topic counts for the boards
Prepares an array of "likes" info for the topic specified by $topic
prepareLikesContext(int $topic) : array<string|int, mixed>
The topic ID to fetch the info from.
An array of IDs of messages in the specified topic that the current user likes
Creates an optimized regex to match all known top level domains.
set_tld_regex([bool $update = false ]) : void
The optimized regex is stored in $modSettings['tld_regex'].
To update the stored version of the regex to use the latest list of valid TLDs from iana.org, set the $update parameter to true. Updating can take some time, based on network connectivity, so it should normally only be done by calling this function from a background or scheduled task.
If $update is not true, but the regex is missing or invalid, the regex will be regenerated from a hard-coded list of TLDs. This regenerated regex will be overwritten on the next scheduled update.
If true, fetch and process the latest official list of TLDs from iana.org.
A wrapper for `parse_url($url)` that can handle URLs with international characters (a.k.a. IRIs)
parse_iri(string $iri[, int $component = -1 ]) : string|int|array<string|int, mixed>|null|bool
The IRI to parse.
Optional flag for parse_url's second parameter.
Same as parse_url(), but with unmangled Unicode.
A wrapper for `filter_var($url, FILTER_VALIDATE_URL)` that can handle URLs with international characters (a.k.a. IRIs)
validate_iri(string $iri[, int $flags = 0 ]) : string|bool
The IRI to test.
Optional flags to pass to filter_var()
Either the original IRI, or false if the IRI was invalid.
A wrapper for `filter_var($url, FILTER_SANITIZE_URL)` that can handle URLs with international characters (a.k.a. IRIs)
sanitize_iri(string $iri) : string|bool
Note: The returned value will still be an IRI, not a URL. To convert to URL, feed the result of this function to iri_to_url()
The IRI to sanitize.
The sanitized version of the IRI
Performs Unicode normalization on IRIs.
normalize_iri(string $iri) : string|bool
Internally calls sanitize_iri(), then performs Unicode normalization on the IRI as a whole, using NFKC normalization for the domain name (see RFC 3491) and NFC normalization for the rest.
The IRI to normalize.
The normalized version of the IRI.
Converts a URL with international characters (an IRI) into a pure ASCII URL
iri_to_url(string $iri) : string|bool
Uses Punycode to encode any non-ASCII characters in the domain name, and uses standard URL encoding on the rest.
A IRI that may or may not contain non-ASCII characters.
The URL version of the IRI.
Decodes a URL containing encoded international characters to UTF-8
url_to_iri(string $url) : string|bool
Decodes any Punycode encoded characters in the domain name, then uses standard URL decoding on the rest.
The pure ASCII version of a URL.
The UTF-8 version of the URL.
Gets the appropriate URL to use for images (or whatever) when using SSL
get_proxied_url(string $url) : string
The returned URL may or may not be a proxied URL, depending on the situation. Mods can implement alternative proxies using the 'integrate_proxy' hook.
The original URL of the requested resource
The URL to use
Check if the passed url has an SSL certificate.
ssl_cert_found(string $url) : bool
Returns true if a cert was found & false if not.
to check, in $boardurl format (no trailing slash).
Check if the passed url has a redirect to https:// by querying headers.
https_redirect_active(string $url) : bool
Returns true if a redirect was found & false if not. Note that when force_ssl = 2, SMF issues its own redirect... So if this returns true, it may be caused by SMF, not necessarily an .htaccess redirect.
to check, in $boardurl format (no trailing slash).
Build query_wanna_see_board and query_see_board for a userid
build_query_board(int $id) : array<string|int, mixed>
Returns array with keys query_wanna_see_board and query_see_board
Helper function to set an array of data for an user's avatar.
set_avatar_data([array<string|int, mixed> $data = [] ]) : array<string|int, mixed>
Makes assumptions based on the data provided, the following keys are required:
An array of raw info
An array of avatar data
Updates the columns in the members table.
updateMemberData(mixed $members, array<string|int, mixed> $data) : void
Assumes the data has been htmlspecialchar'd. this function should be used whenever member data needs to be updated in place of an UPDATE query.
id_member is either an int or an array of ints to be updated.
data is an associative array of the columns to be updated and their respective values. any string values updated should be quoted and slashed.
the value of any column can be '+' or '-', which mean 'increment' and decrement, respectively.
if the member's post number is updated, updates their post groups.
An array of member IDs, the ID of a single member, or null to update this for all members
The info to update for the members
Gets a member's selected time zone identifier
getUserTimezone([int $id_member = null ]) : string
The member id to look up. If not provided, the current user's id will be used.
The time zone identifier string for the user's time zone.
Delete one or more members.
deleteMembers(int|array<string|int, mixed> $users[, bool $check_not_admin = false ]) : void
Requires profile_remove_own or profile_remove_any permission for respectively removing your own account or any account. Non-admins cannot delete admins. The function:
The ID of a user or an array of user IDs
Whether to verify that the users aren't admins
Checks a username obeys a load of rules
validateUsername(int $memID, string $username[, bool $return_error = false ][, bool $check_reserved_name = true ]) : array<string|int, mixed>|null
The ID of the member
The username to validate
Whether to return errors
Whether to check this against the list of reserved names
Null if there are no errors, otherwise an array of errors if return_error is true
Check if a name is in the reserved words list.
isReservedName(string $name[, int $current_id_member = 0 ][, bool $is_name = true ][, bool $fatal = true ]) : bool|void
(name, current member id, name/username?.)
The name to check
The ID of the current member (to avoid false positives with the current member)
Whether we're checking against reserved names or just usernames
Whether to die with a fatal error if the name is reserved
False if name is not reserved, otherwise true if $fatal is false or dies with a fatal_lang_error if $fatal is true
Checks if a given email address might be banned.
isBannedEmail(string $email, string $restriction, string $error) : void
Check if a given email is banned. Performs an immediate ban if the turns turns out positive.
The email to check
What type of restriction (cannot_post, cannot_register, etc.)
The error message to display if they are indeed banned
Finds members by email address, username, or real name.
findMembers(array<string|int, mixed> $names[, bool $use_wildcards = false ][, bool $buddies_only = false ][, int $max = 500 ]) : array<string|int, mixed>
The names of members to search for
Whether to use wildcards. Accepts wildcards ? and * in the pattern if true
Whether to only search for the user's buddies
The maximum number of results
An array containing information about the matching members
Retrieves a list of members that have a given permission (on a given board).
membersAllowedTo(string $permission[, int $board_id = null ]) : array<string|int, mixed>
If board_id is not null, a board permission is assumed. Takes different permission settings into account. Takes possible moderators (on board 'board_id') into account.
The permission to check
If set, checks permission for that specific board
An array containing the IDs of the members having that permission
Retrieves a list of membergroups that have the given permission, either on a given board or in general.
groupsAllowedTo(string $permission[, int $board_id = null ][, bool $simple = true ][, int|null $profile_id = null ]) : array<string|int, mixed>
If board_id is not null, a board permission is assumed. The function takes different permission settings into account.
The permission to check
= null If set, checks permissions for the specified board
An array containing two arrays - 'allowed', which has which groups are allowed to do it and 'denied' which has the groups that are denied
Retrieves a list of membergroups with the given permissions.
getGroupsWithPermissions([array<string|int, mixed> $general_permissions = [] ][, array<string|int, mixed> $board_permissions = [] ][, int $profile_id = 1 ]) : array<string|int, mixed>
An array containing two arrays - 'allowed', which has which groups are allowed to do it and 'denied' which has the groups that are denied
Log the spider presence online.
logSpider() : void
Loads an array of users' data by ID or member_name.
loadMemberData([array<string|int, mixed>|string $users = [] ][, int $type = SMFUser::LOAD_BY_ID ][, string|null $dataset = null ]) : array<string|int, mixed>
An array of users by id or name or a single username/id
The ids of the members loaded
Load all the important user information.
loadUserSettings() : void
What it does:
Load this user's permissions.
loadPermissions() : void
Loads the user's basic values... meant for template/theme usage.
loadMemberContext(int $id[, bool $display_custom_fields = false ]) : bool|array<string|int, mixed>
Whether or not to display custom profile fields
False if the data wasn't loaded or the loaded data.
Require a user who is logged in. (not a guest.) Checks if the user is currently a guest, and if so asks them to login with a message telling them why.
is_not_guest([string $message = '' ]) : void
Message is what to tell them when asking them to login.
The message to display to the guest
Do banning related stuff. (ie. disallow access....) Checks if the user is banned, and if so dies with an error.
is_not_banned([bool $force_check = false ]) : void
Caches this information for optimization purposes.
Fix permissions according to ban status.
banPermissions() : void
Applies any states of banning by removing permissions the user cannot have.
Log a ban in the database.
log_ban([array<string|int, mixed> $ban_ids = [] ][, string $email = null ]) : void
Log the current user in the ban logs. Increment the hit counters for the specified ban ID's (if any.)
The IDs of the bans
The email address associated with the user that triggered this hit
Check if the user is who he/she says he is Makes sure the user is who they claim to be by requiring a password to be typed in every hour.
validateSession([string $type = 'admin' ][, string $force = false ]) : string|null
Is turned on and off by the securityDisable setting. Uses the adminLogin() function of Subs-Auth.php if they need to login, which saves all request (post and get) data.
What type of session this is
When true, require a password even if we normally wouldn't
Returns 'session_verify_fail' if verification failed
Make sure the user's correct session was passed, and they came from here.
checkSession([string $type = 'post' ][, string $from_action = '' ][, bool $is_fatal = true ]) : string
Checks the current session, verifying that the person is who he or she should be. Also checks the referrer to make sure they didn't get sent here. Depends on the disableCheckUA setting, which is usually missing. Will check GET, POST, or REQUEST depending on the passed type. Also optionally checks the referring action if passed. (note that the referring action must be by GET.)
The type of check (post, get, request)
The action this is coming from
Whether to die with a fatal error if the check fails
The error message if is_fatal is false.
Check the user's permissions.
allowedTo(string|array<string|int, mixed> $permission[, int|array<string|int, mixed> $boards = null ][, bool $any = false ]) : bool
checks whether the user is allowed to do permission. (ie. post_new.) If boards is specified, checks those boards instead of the current one. If any is true, will return true if the user has the permission on any of the specified boards Always returns true if the user is an administrator.
A single permission to check or an array of permissions to check
The ID of a board or an array of board IDs if we want to check board-level permissions
Whether to check for permission on at least one board instead of all boards
Whether the user has the specified permission
Fatal error if they cannot.
isAllowedTo(string|array<string|int, mixed> $permission[, int|array<string|int, mixed> $boards = null ][, bool $any = false ]) : bool
Uses allowedTo() to check if the user is allowed to do permission. Checks the passed boards or current board for the permission. If $any is true, the user only needs permission on at least one of the boards to pass If they are not, it loads the Errors language file and shows an error using $txt['cannot_' . $permission]. If they are a guest and cannot do it, this calls is_not_guest().
A single permission to check or an array of permissions to check
The ID of a single board or an array of board IDs if we're checking board-level permissions (null otherwise)
Whether to check for permission on at least one board instead of all boards
Return the boards a user has a certain (board) permission on. (array(0) if all.) - returns a list of boards on which the user is allowed to do the specified permission.
boardsAllowedTo(string|array<string|int, mixed> $permissions[, bool $check_access = true ][, bool $simple = true ]) : array<string|int, mixed>
A single permission to check or an array of permissions to check
Whether to check only the boards the user has access to
Whether to return a simple array of board IDs or one with permissions as the keys
An array of board IDs or an array containing 'permission' => 'board,board2,...' pairs
Replaces invalid characters with a substitute.
sanitize_chars(string $string[, int $level = 0 ][, string|null $substitute = null ]) : string
!!! Warning !!! Setting $substitute to '' in order to delete invalid characters from the string can create unexpected security problems. See https://www.unicode.org/reports/tr36/#Deletion_of_Noncharacters for an explanation.
The string to sanitize.
Controls filtering of invisible formatting characters. 0: Allow valid formatting characters. Use for sanitizing text in posts. 1: Allow necessary formatting characters. Use for sanitizing usernames. 2: Disallow all formatting characters. Use for internal comparisions only, such as in the word censor, search contexts, etc. Default: 0.
Replacement string for the invalid characters. If not set, the Unicode replacement character (U+FFFD) will be used (or a fallback like "?" if necessary).
The sanitized string.
Normalizes space characters and line breaks.
normalize_spaces(string $string[, bool $vspace = true ][, bool $hspace = false ][, array<string|int, mixed> $options = [] ]) : string
The string to sanitize.
If true, replaces all line breaks and vertical space characters with "\n". Default: true.
If true, replaces horizontal space characters with a plain " " character. (Note: tabs are not replaced unless the 'replace_tabs' option is supplied.) Default: false.
An array of bool options. Possible values are:
The sanitized string.
Adds html entities to the array/variable. Uses two underscores to guard against overloading.
htmlspecialchars__recursive(array<string|int, mixed>|string $var[, int $flags = ENT_COMPAT ][, mixed $encoding = 'UTF-8' ]) : array<string|int, mixed>|string
What it does:
The string or array of strings to add entites to
The string or array of strings with entities added
Replaces special entities in strings with the real characters.
un_htmlspecialchars(string $string[, int $flags = ENT_QUOTES ][, mixed $encoding = 'UTF-8' ]) : string
Functionally equivalent to htmlspecialchars_decode(), except that this also replaces 'Â ' with a simple space character.
A string
The string without entities
Trim a string including the HTML space, character 160. Uses two underscores to guard against overloading.
htmltrim__recursive(array<string|int, mixed>|string $var) : array<string|int, mixed>|string
What it does:
The string or array of strings to trim
The trimmed string or array of trimmed strings
Shorten a subject + internationalization concerns.
shorten_subject(string $subject, int $len) : string
The subject
How many characters to limit it to
The shortened subject - either the entire subject (if it's <= $len) or the subject shortened to $len characters with "..." appended
Chops a string into words and prepares them to be inserted into (or searched from) the database.
text2words(string $string[, int $max_length = 20 ][, bool $encrypt = false ]) : array<string|int, mixed>
The text to split into words
The maximum number of characters per word
Whether to encrypt the results
An array of ints or words depending on $encrypt
Creates optimized regular expressions from arrays of strings.
build_regex(array<string|int, mixed> $strings[, string $delim = null ][, bool $return_array = false ]) : string|array<string|int, mixed>
An optimized regex built using this function will be much faster than a
simple regex built using implode('|', $strings)
--- anywhere from several
times to several orders of magnitude faster.
However, the time required to build the optimized regex is approximately equal to the time it takes to execute the simple regex. Therefore, it is only worth calling this function if the resulting regex will be used more than once.
Because PHP places an upper limit on the allowed length of a regex, very large arrays of $strings may not fit in a single regex. Normally, the excess strings will simply be dropped. However, if the $returnArray parameter is set to true, this function will build as many regexes as necessary to accommodate everything in $strings and return them in an array. You will need to iterate through all elements of the returned array in order to test all possible matches.
An array of strings to make a regex for.
An optional delimiter character to pass to preg_quote().
One or more regular expressions to match any of the input strings.
Clean up the XML to make sure it doesn't contain invalid characters.
cleanXml(string $string) : string
See https://www.w3.org/TR/xml/#charsets
The string to clean
The cleaned string
Escapes (replaces) characters in strings to make them safe for use in JavaScript
JavaScriptEscape(string $string[, bool $as_json = false ]) : string
The string to escape
If true, escape as double-quoted string. Default false.
The escaped string
Remove slashes recursively. Uses two underscores to guard against overloading.
stripslashes__recursive(array<string|int, mixed>|string $var[, int $level = 0 ]) : array<string|int, mixed>|string
What it does:
The string or array of strings to strip slashes from
= 0 What level we're at within the array (if called recursively)
The string or array of strings with slashes stripped
Removes url stuff from the array/variable. Uses two underscores to guard against overloading.
urldecode__recursive(array<string|int, mixed>|string $var, int $level) : array<string|int, mixed>|string
What it does:
The string or array of strings to decode
Which level we're at within the array (if called recursively)
The decoded string or array of decoded strings
Adds slashes to the array/variable.
escapestring__recursive(array<string|int, mixed>|string $var) : array<string|int, mixed>|string
What it does:
A string or array of strings to escape
The escaped string or array of escaped strings
Unescapes any array or variable. Uses two underscores to guard against overloading.
unescapestring__recursive(array<string|int, mixed>|string $var) : array<string|int, mixed>|string
What it does:
The string or array of strings to unescape
The unescaped string or array of unescaped strings
Truncate an array to a specified length
truncate_array(array<string|int, mixed> $array[, int $max_length = 1900 ]) : array<string|int, mixed>
The array to truncate
The upperbound on the length
The truncated array
array_length Recursive
array_length(array<string|int, mixed> $array) : int
Wrapper function for json_decode() with error handling.
smf_json_decode(string $json[, bool $associative = false ][, bool $should_log = true ]) : array<string|int, mixed>
The string to decode.
Either an empty array or the decoded data as an array.
Wrapper for _safe_serialize() that handles exceptions and multibyte encoding issues.
safe_serialize(mixed $value) : string
Wrapper for _safe_unserialize() that handles exceptions and multibyte encoding issue
safe_unserialize(string $str) : mixed
Attempts to determine the MIME type of some data or a file.
get_mime_type(string $data[, string $is_path = false ]) : string|bool
The data to check, or the path or URL of a file to check.
If true, $data is a path or URL to a file.
A MIME type, or false if we cannot determine it.
Checks whether a file or data has the expected MIME type.
check_mime_type(string $data, string $type_pattern[, string $is_path = false ]) : int
The data to check, or the path or URL of a file to check.
A regex pattern to match the acceptable MIME types.
If true, $data is a path or URL to a file.
1 if the detected MIME type matches the pattern, 0 if it doesn't, or 2 if we can't check.
Tries different modes to make file/dirs writable. Wrapper function for chmod()
smf_chmod(string $path) : bool
true if the file/dir is already writable or the function was able to make it writable, false if the function couldn't make the file/dir writable.
Sends an appropriate HTTP status header based on a given status code
send_http_status(int $code[, string $status = '' ]) : void
The status code
The string for the status. Set automatically if not provided.
Outputs a response.
smf_serverResponse([string $data = '' ][, string $type = 'Content-Type: application/json' ]) : string
It assumes the data is already a string.
The data to print
The content type. Defaults to Json.
Make sure the browser doesn't come back and repost the form data.
redirectexit([string $setLocation = '' ][, bool $refresh = false ][, bool $permanent = false ]) : void
Should be used whenever anything is posted.
The URL to redirect them to
Whether to use a meta refresh instead
Whether to send a 301 Moved Permanently instead of a 302 Moved Temporarily
Ends execution. Takes care of template loading and remembering the previous URL.
obExit([bool $header = null ][, bool $do_footer = null ][, bool $from_index = false ][, bool $from_fatal_error = false ]) : void
Whether to do the header
Whether to do the footer
Whether we're coming from the board index
Whether we're coming from a fatal error
Receives a string and tries to figure it out if its a method or a function.
call_helper(mixed $input[, bool $return = false ]) : string|array<string|int, mixed>|bool
If a method is found, it looks for a "#" which indicates SMF should create a new instance of the given class. Checks the string/array for is_callable() and return false/fatal_lang_error is the given value results in a non callable string/array. Prepare and returns a callable depending on the type of method/function found.
The string containing a function name or a static call. The function can also accept a closure, object or a callable array (object/class, valid_callable)
If true, the function will not call the function/method but instead will return the formatted string.
Either a string or an array that contains a callable function name or an array with a class and method to call. False if the given string cannot produce a callable var.
Decode numeric html entities to their ascii or UTF8 equivalent character.
replaceEntities__callback(array<string|int, mixed> $matches) : string
Callback function for preg_replace_callback in subs-members Does basic scan to ensure characters are inside a valid range
An array of matches
A fixed string
Converts html entities to utf8 equivalents
fixchar__callback(array<string|int, mixed> $matches) : string
Callback function for preg_replace_callback Does basic checks to keep characters inside a viewable range.
An array of matches
The fixed string
Strips out invalid html entities, replaces others with html style { codes
entity_fix__callback(array<string|int, mixed> $matches) : string
Callback function used of preg_replace_callback in smcFunc $ent_checks, for example strpos, strlen, substr etc
An array of matches
The fixed string
Create a anti-bot verification control?
create_control_verification(array<string|int, mixed> &$options[, bool $do_test = false ]) : bool|array<string|int, mixed>
Options for the verification control
Whether to check to see if the user entered the code correctly
False if there's nothing to show, true if everything went well or an array containing error indicators if the test failed
Microsoft uses their own character set Code Page 1252 (CP1252), which is a superset of ISO 8859-1, defining several characters between DEC 128 and 159 that are not normally displayable. This converts the popular ones that appear from a cut and paste from Windows.
sanitizeMSCutPaste(string $string) : string
The string.
The sanitized string.
Compatibility function.
smf_crc32(string $number) : string
crc32 doesn't work as expected on 64-bit functions - make our own. https://php.net/crc32#79567
The crc32 polynomial of $number
Compatibility function.
idn_to_ascii(string $domain[, int $flags = 0 ][, int $variant = 1 ][, array<string|int, mixed>|null &$idna_info = null ]) : string|bool
This is not a complete polyfill:
The domain to convert, which must be UTF-8 encoded.
A subset of possible IDNA_* flags.
Ignored in this compatibility function.
Ignored in this compatibility function.
The domain name encoded in ASCII-compatible form, or false on failure.
Compatibility function.
idn_to_utf8(string $domain[, int $flags = 0 ][, int $variant = 1 ][, array<string|int, mixed>|null &$idna_info = null ]) : string|bool
This is not a complete polyfill:
Domain to convert, in an IDNA ASCII-compatible format.
Ignored in this compatibility function.
Ignored in this compatibility function.
Ignored in this compatibility function.
The domain name in Unicode, encoded in UTF-8, or false on failure.
array_is_list(array<string|int, mixed> $array) : bool
Displays the header for this file
template_ssi_above() : mixed
Displays the footer for this file
template_ssi_below() : mixed
Displays a sample homepage to give you an idea of what's possible using SSI functions
template_homepage_sample1([string $method = 'source' ]) : string|void
If 'source', simply returns the source code, otherwise displays it
Returns the HTML source if $method is 'source', otherwise displays it
Generates the sample homepage. Used with template_homepage_sample1 if $method isn't 'source'.
template_homepage_sample1_php() : mixed
Generates the HTML for the homepage sample. Used in conjunction with template_homepage_sample1 if method is 'source'
template_homepage_sample1_html() : string
The HTML code for the sample homepage
Log an error then exit
generateSubscriptionError(string $text[, bool $debug = false ]) : mixed
The error to log
If true, won't send an email if Config::$modSettings['paid_email'] isn't set
This is the administration center home.
template_admin() : mixed
Show some support information and credits to those who helped make this.
template_credits() : mixed
Displays information about file versions installed, and compares them to current version.
template_view_versions() : mixed
Form for stopping people using naughty words, etc.
template_edit_censored() : mixed
This is the page shown when we've temporarily paused things such as during maintenance tasks, sending newsletters, etc.
template_not_done() : mixed
Template for showing settings (Of any kind really!)
template_show_settings() : mixed
Template for showing custom profile fields.
template_show_custom_profile() : mixed
Template for editing a custom profile field
template_edit_profile_field() : mixed
Results page for an admin search.
template_admin_search_results() : mixed
This little beauty shows questions and answer from the captcha type feature.
template_callback_question_answer_list() : mixed
Repairing boards.
template_repair_boards() : mixed
Retrieves info from the php_info function, scrubs and preps it for display
template_php_info() : mixed
Content shown above the clean cache button
template_clean_cache_button_above() : mixed
Content shown below the clean cache button?
template_clean_cache_button_below() : mixed
This shows the admin search form
template_admin_quick_search() : mixed
template_main() : mixed
The top part of the outer layer of the boardindex
template_boardindex_outer_above() : mixed
This shows the newsfader
template_newsfader() : mixed
This actually displays the board index
template_main() : mixed
Outputs the board icon for a standard board.
template_bi_board_icon(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board icon for a redirect.
template_bi_redirect_icon(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board info for a standard board or redirect.
template_bi_board_info(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board stats for a standard board.
template_bi_board_stats(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board stats for a redirect.
template_bi_redirect_stats(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board lastposts for a standard board or a redirect.
template_bi_board_lastpost(array<string|int, mixed> $board) : mixed
When on a mobile device, this may be hidden if no last post exists.
Current board information.
Outputs the board children for a standard board.
template_bi_board_children(array<string|int, mixed> $board) : mixed
Current board information.
The lower part of the outer layer of the board index
template_boardindex_outer_below() : mixed
Displays the info center
template_info_center() : mixed
The recent posts section of the info center
template_ic_block_recent() : mixed
The calendar section of the info center
template_ic_block_calendar() : mixed
The stats section of the info center
template_ic_block_stats() : mixed
The who's online section of the info center
template_ic_block_online() : mixed
Our main calendar template, which encapsulates weeks and months.
template_main() : mixed
Display a list of upcoming events, birthdays, and holidays.
template_show_upcoming_list(string $grid_name) : void|bool
The grid name
Returns false if the grid doesn't exist.
Display a monthly calendar grid.
template_show_month_grid(string $grid_name[, bool $is_mini = false ]) : void|bool
The grid name
Is this a mini grid?
Returns false if the grid doesn't exist.
Shows a weekly grid
template_show_week_grid(string $grid_name) : void|bool
The name of the grid
Returns false if the grid doesn't exist
Calendar controls under the title
template_calendar_top(array<string|int, mixed> $calendar_data) : mixed
Creates the view selector (list, month, week), the date selector (either a select menu or a date range chooser, depending on the circumstances), and the "Post Event" button.
The data for the calendar grid that this is for
Template for posting a calendar event.
template_event_post() : mixed
Displays a clock
template_bcd() : mixed
Displays the hours, minutes and seconds for our clock
template_hms() : mixed
Displays a binary clock
template_omfg() : mixed
Displays the time
template_thetime() : mixed
This template handles displaying a topic
template_main() : mixed
Template for displaying a single post.
template_single_post(array<string|int, mixed> $message) : mixed
An array of information about the message to display. Should have 'id' and 'member'. Can also have 'first_new', 'is_ignored' and 'css_class'.
The template for displaying the quick reply box.
template_quickreply() : mixed
THis displays a fatal error message
template_fatal_error() : mixed
This template handles the error log in the admin center.
template_error_log() : mixed
This template shows a snippet of code from a file and highlights which line caused the error.
template_show_file() : mixed
This template handles showing attachment-related errors
template_attachment_errors() : mixed
This template shows a backtrace of the given error
template_show_backtrace() : mixed
Template for the event options fieldset that is used when creating an event.
template_event_options() : mixed
Used by Calendar.template.php and Post.template.php
Template for linking an existing topic to an event.
template_event_link_to() : mixed
Template for unlinking a topic and an event.
template_event_unlink() : mixed
Template for choosing a board to create a linked topic in.
template_event_board() : mixed
Template for entering info about a new event.
template_event_new() : mixed
Template used when editing a single occurrence of an event.
template_occurrence_options() : mixed
Template for the recurrence rule options for events.
template_rrule() : mixed
Template to show linked events.
template_linked_events() : mixed
This function displays all the stuff you get with a richedit box - BBC, smileys, etc.
template_control_richedit(string $editor_id[, null|bool $smileyContainer = null ][, null|bool $bbcContainer = null ]) : mixed
The editor ID
If null, hides the smiley section regardless of settings
If null, hides the bbcode buttons regardless of settings
This template shows the form buttons at the bottom of the editor
template_control_richedit_buttons(string $editor_id) : mixed
The editor ID
This template displays a verification form
template_control_verification(int|string $verify_id[, string $display_type = 'all' ][, bool $reset = false ]) : bool
The verification control ID
What type to display. Can be 'single' to only show one verification option or 'all' to show all of them
Whether to reset the internal tracking counter
False if there's nothing else to show, true if $display_type is 'single', nothing otherwise
This template handles displaying a list
template_show_list([string $list_id = null ]) : mixed
The list ID. If null, uses Utils::$context['default_list'].
This template displays additional rows above or below the list.
template_additional_rows(string $row_position, array<string|int, mixed> $cur_list) : mixed
The position ('top', 'bottom', etc.)
An array with the data for the current list
This contains the HTML for the menu bar at the top of the admin center.
template_generic_menu_dropdown_above() : mixed
Part of the admin layer - used with generic_menu_dropdown_above to close the admin content div.
template_generic_menu_dropdown_below() : mixed
The template for displaying a menu
template_generic_menu(array<string|int, mixed> &$menu_context) : mixed
An array of menu information
The code for displaying the menu
template_generic_menu_tabs(array<string|int, mixed> &$menu_context) : mixed
An array of menu context data
This displays a help popup thingy
template_popup() : mixed
The main help page
template_manual() : mixed
Initialize the template... mainly little settings.
template_init() : mixed
The main sub template above the content.
template_html_above() : mixed
The upper part of the main template layer. This is the stuff that shows above the main forum content.
template_body_above() : mixed
The stuff shown immediately below the main content, including the footer
template_body_below() : mixed
This shows any deferred JavaScript and closes out the HTML
template_html_below() : mixed
Show a linktree. This is that thing that shows "My Community | General Category | General Discussion".
theme_linktree([bool $force_show = false ]) : mixed
.
Whether to force showing it even if settings say otherwise
Show the menu up top. Something like [home] [help] [profile] [logout].
template_menu() : mixed
..
Generate a strip of buttons.
template_button_strip(array<string|int, mixed> $button_strip[, string $direction = '' ][, array<string|int, mixed> $strip_options = array() ]) : mixed
An array with info for displaying the strip
The direction
Options for the button strip
Generate a list of quickbuttons.
template_quickbuttons(array<string|int, mixed> $list_items[, string $list_class = null ][, string $output_method = 'echo' ]) : void|string
An array with info for displaying the strip
Used for integration hooks and as a class name
The output method. If 'echo', simply displays the buttons, otherwise returns the HTML for them
Returns nothing unless output_method is something other than 'echo'
The upper part of the maintenance warning box
template_maint_warning_above() : mixed
The lower part of the maintenance warning box.
template_maint_warning_below() : mixed
The upper part of the security warning box
template_security_warning_above() : mixed
The lower part of the security warning box.
template_security_warning_below() : mixed
The upper part of the ban warning box
template_banned_warning_above() : mixed
The lower part of the ban warning box.
template_banned_warning_below() : mixed
This shows the popup that shows who likes a particular post.
template_popup() : mixed
Display a like button and info about how many people liked something
template_like() : mixed
A generic template that outputs any data passed to it.
template_generic() : mixed
..
This is just the basic "login" form.
template_login() : mixed
TFA authentication form
template_login_tfa() : mixed
Tell a guest to get lost or login!
template_kick_guest() : mixed
This is for maintenance mode.
template_maintenance() : mixed
This is for the security stuff - makes administrators login every so often.
template_admin_login() : mixed
Activate your account manually?
template_retry_activate() : mixed
The form for resending the activation code.
template_resend() : mixed
Confirm a logout.
template_logout() : mixed
This template wraps around the simple settings page to add javascript functionality.
template_avatar_settings_above() : mixed
JavaScript to be output below the simple settings page
template_avatar_settings_below() : mixed
The attachment maintenance page
template_maintenance() : mixed
The file repair page
template_attachment_repair() : mixed
The page that handles managing attachment paths.
template_attachment_paths() : mixed
Add or edit a ban
template_ban_edit() : mixed
Add or edit a ban trigger
template_ban_edit_trigger() : mixed
Template for listing all the current categories and boards.
template_main() : mixed
Template for editing/adding a category on the forum.
template_modify_category() : mixed
A template to confirm if a user wishes to delete a category - and whether they want to save the boards.
template_confirm_category_delete() : mixed
Below is the template for adding/editing a board on the forum.
template_modify_board() : mixed
A template used when a user is deleting a board with child boards in it - to see what they want to do with them.
template_confirm_board_delete() : mixed
Editing or adding holidays.
template_edit_holiday() : mixed
Importing iCalendar data.
template_import() : mixed
Download a new language file.
template_download_language() : mixed
Edit language entries. Note that this doesn't always work because of PHP's max_post_vars setting.
template_modify_language_entries() : mixed
Add a new language
template_add_language() : mixed
Template for browsing the mail queue.
template_browse() : mixed
Template for testing mail send.
template_mailtest() : mixed
Template for the database maintenance tasks.
template_maintain_database() : mixed
Template for the routine maintenance tasks.
template_maintain_routine() : mixed
Template for the member maintenance tasks.
template_maintain_members() : mixed
Template for the topic maintenance tasks.
template_maintain_topics() : mixed
Simple template for showing results of our optimization.
template_optimize() : mixed
..
Template for converting entities to UTF-8 characters
template_convert_entities() : mixed
Template for converting posts to UTF-8.
template_convert_msgbody() : mixed
The main page listing all the groups.
template_main() : mixed
Add a new membergroup.
template_new_group() : mixed
Edit an existing membergroup.
template_edit_group() : mixed
The template for determining which boards a group has access to.
template_add_edit_group_boards_list([bool $collapse = true ][, mixed $form_id = 'new_group' ]) : mixed
Whether to collapse the list by default
Template for viewing the members of a group.
template_group_members() : mixed
Allow the moderator to enter a reason to each user being rejected.
template_group_request_reason() : mixed
The admin member search form
template_search_members() : mixed
The admin member list.
template_admin_browse() : mixed
The template for sending newsletters
template_email_members() : mixed
The form for composing a newsletter
template_email_members_compose() : mixed
The page shown while the newsletter is being sent
template_email_members_send() : mixed
The settings page.
template_news_lists() : mixed
The template for adding or editing a subscription.
template_modify_subscription() : mixed
The page for deleting a subscription.
template_delete_subscription() : mixed
Add or edit an existing subscriber.
template_modify_user_subscription() : mixed
Template for a user to edit/pick their subscriptions.
template_user_subscription() : mixed
The "choose payment" dialog.
template_choose_payment() : mixed
The "thank you" bit.
template_paid_done() : mixed
..
The main manage permissions page
template_permission_index() : mixed
THe page that shows which permissions profile applies to each board
template_by_board() : mixed
Edit permission profiles (predefined).
template_edit_profiles() : mixed
Modify a group's permissions
template_modify_group() : mixed
The way of looking at permissions.
template_modify_group_display(string $type) : mixed
The permissions type
A form for displaying inline permissions, such as on a settings page.
template_inline_permissions() : mixed
Edit post moderation permissions.
template_postmod_permissions() : mixed
Template for listing all scheduled tasks.
template_view_scheduled_tasks() : mixed
A template for, you guessed it, editing a task!
template_edit_scheduled_tasks() : mixed
Modify the search weights.
template_modify_weights() : mixed
Select the search method.
template_select_search_method() : mixed
Create a search index.
template_create_index() : mixed
Display a progress page while creating a search index.
template_create_index_progress() : mixed
Done creating a search index.
template_create_index_done() : mixed
Add or edit a search engine spider.
template_spider_edit() : mixed
Show... spider... logs.
template_show_spider_logs() : mixed
..
Show... spider... stats.
template_show_spider_stats() : mixed
..
Shows a list of smiley sets so you can edit them.
template_editsets() : mixed
Modifying a smiley set.
template_modifyset() : mixed
Editing an individual smiley
template_modifysmiley() : mixed
Adding a new smiley.
template_addsmiley() : mixed
Ordering smileys.
template_setorder() : mixed
Editing Message Icons
template_editicons() : mixed
Editing an individual message icon
template_editicon() : mixed
Displays a sortable listing of all members registered on the forum.
template_main() : mixed
A page allowing people to search the member list.
template_search() : mixed
The main messageindex.
template_main() : mixed
Outputs the board icon for a standard board.
template_bi_board_icon(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board icon for a redirect.
template_bi_redirect_icon(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board info for a standard board or redirect.
template_bi_board_info(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board stats for a standard board.
template_bi_board_stats(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board stats for a redirect.
template_bi_redirect_stats(array<string|int, mixed> $board) : mixed
Current board information.
Outputs the board lastposts for a standard board or a redirect.
template_bi_board_lastpost(array<string|int, mixed> $board) : mixed
When on a mobile device, this may be hidden if no last post exists.
Current board information.
Outputs the board children for a standard board.
template_bi_board_children(array<string|int, mixed> $board) : mixed
Current board information.
Shows a legend for topic icons.
template_topic_legend() : mixed
The main moderation center.
template_moderation_center() : mixed
Show all the group requests the user can see.
template_group_requests_block() : mixed
A list of watched users
template_watched_users() : mixed
A list of reported posts
template_reported_posts_block() : mixed
A list of reported users
template_reported_users_block() : mixed
Little section for making... notes.
template_notes() : mixed
Show a list of all the unapproved posts
template_unapproved_posts() : mixed
Callback function for showing a watched users post in the table.
template_user_watch_post_callback(array<string|int, mixed> $post) : string
An array of data about the post.
An array of HTML for showing the post info.
The moderation settings page.
template_moderation_settings() : mixed
Show a notice sent to a user.
template_show_notice() : mixed
Add or edit a warning template.
template_warn_template() : mixed
Show an interface for selecting which board to move a post to.
template_move() : mixed
Redirection topic options
template_redirect_options(string $type) : mixed
What type of topic this is for - currently 'merge' or 'move'. Used to display appropriate text strings...
Confirmation page shown when finished merging topics.
template_merge_done() : mixed
Merge topic page.
template_merge() : mixed
Extra options related to merging topics.
template_merge_extra_options() : mixed
The main notification bar.
template_main() : mixed
Board notification bar.
template_notify_board() : mixed
template_notify_announcements() : mixed
Displays a message indicating the user's notification preferences were successfully changed
template_notify_pref_changed() : mixed
The main template
template_main() : mixed
View package details when installing/uninstalling
template_view_package() : mixed
Extract package contents
template_extract_package() : mixed
List files in a package
template_list() : mixed
Examine a single file within a package
template_examine() : mixed
List all packages
template_browse() : mixed
List package servers
template_servers() : mixed
Confirm package operation
template_package_confirm() : mixed
List packages.
template_package_list() : mixed
Confirmation page showing a package was uploaded/downloaded successfully.
template_downloaded() : mixed
Installation options - FTP info and backup settings
template_install_options() : mixed
CHMOD control form
template_control_chmod() : bool
False if nothing to do.
Wrapper for the above template function showing that FTP is required
template_ftp_required() : mixed
View operation details.
template_view_operations() : mixed
The file permissions page.
template_file_permissions() : mixed
Shows permissions for items within a directory (called from template_file_permissions)
template_permission_show_contents(string $ident, array<string|int, mixed> $contents, int $level[, bool $has_more = false ]) : mixed
A unique ID - typically the directory name
An array of items within the directory
How far to go inside the directory
Whether there are more files to display besides what's in $contents
A progress page showing what permissions changes are being applied
template_action_permissions() : mixed
This is for stuff above the menu in the personal messages section
template_pm_above() : mixed
Just the end of the index bar, nothing special.
template_pm_below() : mixed
Displays a popup with information about your personal messages
template_pm_popup() : mixed
Shows a particular folder (eg inbox or outbox), all the PMs in it, etc.
template_folder() : mixed
Template for displaying a single personal message.
template_single_pm(array<string|int, mixed> $message) : mixed
An array of information about the message to display.
Just list all the personal message subjects - to make templates easier.
template_subject_list() : mixed
The form for the PM search feature
template_search() : mixed
Displays results from a PM search
template_search_results() : mixed
The form for sending a new PM
template_send() : mixed
This template asks the user whether they wish to empty out their folder/messages.
template_ask_delete() : mixed
This template asks the user what messages they want to prune.
template_prune() : mixed
Here we allow the user to setup labels, remove labels and change rules for labels (i.e, do quite a bit)
template_labels() : mixed
Template for reporting a personal message.
template_report_message() : mixed
Little template just to say "Yep, it's been submitted"
template_report_message_complete() : mixed
Manage rules.
template_rules() : mixed
Template for adding/editing a rule.
template_add_rule() : mixed
Template for showing all of a user's PM drafts.
template_showPMDrafts() : mixed
A form for creating and/or editing a poll.
template_main() : mixed
The main template for the post page.
template_main() : mixed
The template for the spellchecker.
template_spellcheck() : mixed
The template for the AJAX quote feature
template_quotefast() : mixed
The form for sending out an announcement
template_announce() : mixed
The confirmation/progress page, displayed after the admin has clicked the button to send the announcement.
template_announcement_send() : mixed
Prints the input fields in the form's header (subject, message icon, guest name & email, etc.)
template_post_header() : mixed
Mod authors can use the 'integrate_post_end' hook to modify or add to these (see Post.php).
Theme authors can customize the output in a couple different ways:
See the documentation in Post.php for more info on the Utils::$context['posting_fields'] array.
The header. Defines the look and layout of the page as well as a form for choosing print options.
template_print_above() : mixed
The main page. This shows the relevant info in a printer-friendly format
template_main() : mixed
The footer.
template_print_below() : mixed
Displays the print page options
template_print_options() : mixed
Minor stuff shown above the main profile - mostly used for error messages and showing that the profile update was successful.
template_profile_above() : mixed
Template for any HTML needed below the profile (closing off divs/tables, etc.)
template_profile_below() : mixed
Template for showing off the spiffy popup of the menu
template_profile_popup() : mixed
The "popup" showing the user's alerts
template_alerts_popup() : mixed
A simple template to say "You don't have any unread alerts".
template_alerts_all_read() : mixed
This template displays a user's details without any option to edit them.
template_summary() : mixed
Template for showing all the posts of the user, in chronological order.
template_showPosts() : mixed
Template for showing all alerts
template_showAlerts() : mixed
Template for showing all of a user's drafts
template_showDrafts() : mixed
Template for showing and managing the buddy list.
template_editBuddies() : mixed
Template for showing the ignore list of the current user.
template_editIgnoreList() : mixed
This template shows an admin information on a users IP addresses used and errors attributed to them.
template_trackActivity() : mixed
The template for trackIP, allowing the admin to see where/who a certain IP has been used.
template_trackIP() : mixed
This template shows an admin which permissions a user have and which group(s) give them each permission.
template_showPermissions() : mixed
Template for user statistics, showing graphs and the like.
template_statPanel() : mixed
Template for editing profile options.
template_edit_options() : mixed
Personal Message settings.
template_profile_pm_settings() : mixed
Template for showing theme settings. Note: template_options() actually adds the theme specific options.
template_profile_theme_settings() : mixed
The template for configuring alerts
template_alert_configuration() : mixed
Template for showing which topics you're subscribed to
template_alert_notifications_topics() : mixed
Template for showing which boards you're subscribed to
template_alert_notifications_boards() : mixed
Template for choosing group membership.
template_groupMembership() : mixed
Template for managing ignored boards
template_ignoreboards() : mixed
Simply loads some theme variables common to several warning templates.
template_load_warning_variables() : mixed
Template for viewing a user's warnings
template_viewWarning() : mixed
Template for issuing warnings
template_issueWarning() : mixed
Template to show for deleting a user's account - now with added delete post capability!
template_deleteAccount() : mixed
Template for the password box/save button stuck at the bottom of every profile page.
template_profile_save() : mixed
Small template for showing an error message upon a save problem in the profile.
template_error_message() : mixed
Display a load of drop down selectors for allowing the user to change group.
template_profile_group_manage() : mixed
Callback function for entering a birthdate!
template_profile_birthdate() : mixed
Show the signature editing box?
template_profile_signature_modify() : mixed
Template for selecting an avatar
template_profile_avatar_select() : mixed
This is just a really little helper to avoid duplicating code unnecessarily
template_max_size(string $type) : mixed
The type of avatar
Select the time format!
template_profile_timeformat_modify() : mixed
Template for picking a theme
template_profile_theme_pick() : mixed
Smiley set picker.
template_profile_smiley_pick() : mixed
Template for setting up and managing Two-Factor Authentication.
template_tfasetup() : mixed
Template for disabling two-factor authentication.
template_tfadisable() : mixed
Template for setting up 2FA backup code
template_tfasetup_backup() : mixed
Simple template for showing the 2FA area when editing a profile.
template_profile_tfa() : mixed
Template for initiating and retrieving profile data exports
template_export_profile_data() : mixed
Template for showing recent posts
template_recent() : mixed
Template for showing unread posts
template_unread() : mixed
Template for showing unread replies (eg new replies to topics you've posted in)
template_replies() : mixed
Before showing users a registration form, show them the registration agreement.
template_registration_agreement() : mixed
Before registering - get their information.
template_registration_form() : mixed
After registration... all done ;).
template_after() : mixed
Template for giving instructions about COPPA activation.
template_coppa() : mixed
An easily printable form for giving permission to access the forum for a minor.
template_coppa_form() : mixed
Show a window containing the spoken verification code.
template_verification_sound() : mixed
The template for the form allowing an admin to register a user from the admin center.
template_admin_register() : mixed
Form for editing the agreement shown for people registering to the forum.
template_edit_agreement() : mixed
Template for editing reserved words.
template_edit_reserved_words() : mixed
template_edit_privacy_policy() : mixed
The main "Here's how you can reset your password" page
template_main() : mixed
The page to pick an option - secret question/answer (if set) or email
template_reminder_pick() : mixed
Just a simple "We sent you an email. Click the link in it to continue." message
template_sent() : mixed
Template for setting the new password
template_set_password() : mixed
The page that asks a user to answer their secret question
template_ask() : mixed
Displays all reported posts.
template_reported_posts() : mixed
A block to show the current top reported posts.
template_reported_posts_block() : mixed
Handles viewing details of and managing a specific report
template_viewmodreport() : mixed
Template for editing a mod comment.
template_edit_comment() : mixed
A block to show the current top reported member profiles.
template_reported_members_block() : mixed
Lists all reported members
template_reported_members() : mixed
Template for viewing and managing a specific report about a user's profile
template_viewmemberreport() : mixed
Choose which type of report to run?
template_report_type() : mixed
This is the standard template for showing reports.
template_main() : mixed
Header of the print page!
template_print_above() : mixed
The main print page
template_print() : mixed
Footer of the print page.
template_print_below() : mixed
The main "report this to the moderator" page
template_main() : mixed
The main search form
template_main() : mixed
The search results page.
template_results() : mixed
This pseudo-template defines all the theme options
template_options() : mixed
This pseudo-template defines all the available theme settings (but not their actual values)
template_settings() : mixed
The form that asks how you want to split things
template_ask() : mixed
A simple confirmation that things were split as expected, with links to the current board and the old and new topics.
template_main() : mixed
The form for selecting which posts to split.
template_select() : mixed
The stats page.
template_main() : mixed
The main sub template - for theme administration.
template_main() : mixed
This lists all themes
template_list_themes() : mixed
This lets you reset themes
template_reset_list() : mixed
This displays the form for setting theme options
template_set_options() : mixed
The page for setting and managing theme settings.
template_set_settings() : mixed
This template allows for the selection of different themes ;)
template_pick() : mixed
Okay, that theme was installed/updated successfully!
template_installed() : mixed
The page for editing themes.
template_edit_list() : mixed
The page allowing you to copy a template from one theme to another.
template_copy_template() : mixed
This lets you browse a list of files in a theme so you can choose which one to edit.
template_edit_browse() : mixed
Wanna edit the stylesheet?
template_edit_style() : mixed
This edits the template.
template_edit_template() : mixed
..
This allows you to edit a file
template_edit_file() : mixed
This handles the Who's Online page
template_main() : mixed
This displays a nice credits page
template_credits() : mixed
This defines the XML for sending the body of a message
template_sendbody() : mixed
This defines the XML for the AJAX quote feature
template_quotefast() : mixed
This defines the XML for the inline edit feature
template_modifyfast() : mixed
The XML for handling things when you're done editing a post inline
template_modifydone() : mixed
This handles things when editing a topic's subject from the messageindex.
template_modifytopicdone() : mixed
The massive XML for previewing posts.
template_post() : mixed
All the XML for previewing a PM
template_pm() : mixed
The XML for previewing a warning
template_warning() : mixed
The XML for hiding/showing stats sections via AJAX
template_stats() : mixed
The XML for selecting items to split
template_split() : mixed
template_button_strip(mixed $button_strip[, mixed $direction = 'top' ][, mixed $strip_options = array() ]) : mixed
template_menu() : mixed
theme_linktree() : mixed
XML for search results
template_results() : mixed
The XML for the Jump To box
template_jump_to() : mixed
The XML for displaying a column of message icons and selecting one via AJAX
template_message_icons() : mixed
The XML for instantly showing whether a username is valid on the registration page
template_check_username() : mixed
This prints XML in its most generic form.
template_generic_xml() : mixed
Recursive function for displaying generic XML data.
template_generic_xml_recursive(array<string|int, mixed> $xml_data, string $parent_ident, string $child_ident, int $level) : mixed
An array of XML data
The parent tag
The child tag
How many levels to indent the code
find_signed_off([mixed $commit = 'HEAD' ][, mixed $childs = array() ][, mixed $level = 0 ]) : mixed
find_gpg([mixed $commit = 'HEAD' ][, mixed $childs = array() ]) : mixed
find_signed_off_parents([mixed $commit = 'HEAD' ]) : mixed
debugPrint(mixed $msg) : mixed
checkLanguageDirectory(mixed $language_dir, mixed $search) : mixed
prepareCLIhandler() : mixed
mb_convert_encoding(mixed $string, mixed $to_encoding[, mixed $from_encoding = null ]) : mixed
mb_decode_mimeheader(mixed $string) : mixed
mb_encode_mimeheader(mixed $string[, mixed $charset = null ][, mixed $transfer_encoding = null ][, mixed $newline = null ][, mixed $indent = null ]) : mixed
mb_decode_numericentity(mixed $string, mixed $map[, mixed $encoding = null ]) : mixed
mb_encode_numericentity(mixed $string, mixed $map[, mixed $encoding = null ][, mixed $hex = false ]) : mixed
mb_convert_case(mixed $string, mixed $mode[, mixed $encoding = null ]) : mixed
mb_internal_encoding([mixed $encoding = null ]) : mixed
mb_language([mixed $language = null ]) : mixed
mb_list_encodings() : mixed
mb_encoding_aliases(mixed $encoding) : mixed
mb_check_encoding([mixed $value = null ][, mixed $encoding = null ]) : mixed
mb_detect_encoding(mixed $string[, mixed $encodings = null ][, mixed $strict = false ]) : mixed
mb_detect_order([mixed $encoding = null ]) : mixed
mb_parse_str(mixed $string[, mixed &$result = array() ]) : mixed
mb_strlen(mixed $string[, mixed $encoding = null ]) : mixed
mb_strpos(mixed $haystack, mixed $needle[, mixed $offset = 0 ][, mixed $encoding = null ]) : mixed
mb_strtolower(mixed $string[, mixed $encoding = null ]) : mixed
mb_strtoupper(mixed $string[, mixed $encoding = null ]) : mixed
mb_substitute_character([mixed $substitute_character = null ]) : mixed
mb_substr(mixed $string, mixed $start[, mixed $length = 2147483647 ][, mixed $encoding = null ]) : mixed
mb_stripos(mixed $haystack, mixed $needle[, mixed $offset = 0 ][, mixed $encoding = null ]) : mixed
mb_stristr(mixed $haystack, mixed $needle[, mixed $before_needle = false ][, mixed $encoding = null ]) : mixed
mb_strrchr(mixed $haystack, mixed $needle[, mixed $before_needle = false ][, mixed $encoding = null ]) : mixed
mb_strrichr(mixed $haystack, mixed $needle[, mixed $before_needle = false ][, mixed $encoding = null ]) : mixed
mb_strripos(mixed $haystack, mixed $needle[, mixed $offset = 0 ][, mixed $encoding = null ]) : mixed
mb_strrpos(mixed $haystack, mixed $needle[, mixed $offset = 0 ][, mixed $encoding = null ]) : mixed
mb_strstr(mixed $haystack, mixed $needle[, mixed $before_needle = false ][, mixed $encoding = null ]) : mixed
mb_get_info([mixed $type = 'all' ]) : mixed
mb_http_output([mixed $encoding = null ]) : mixed
mb_strwidth(mixed $string[, mixed $encoding = null ]) : mixed
mb_substr_count(mixed $haystack, mixed $needle[, mixed $encoding = null ]) : mixed
mb_output_handler(mixed $string, mixed $status) : mixed
mb_http_input([mixed $type = '' ]) : mixed
mb_convert_variables(mixed $toEncoding, mixed $fromEncoding[, mixed &$a = null ][, mixed &$b = null ][, mixed &$c = null ][, mixed &$d = null ][, mixed &$e = null ][, mixed &$f = null ]) : mixed
mb_ord(mixed $string[, mixed $encoding = null ]) : mixed
mb_chr(mixed $codepoint[, mixed $encoding = null ]) : mixed
mb_scrub(mixed $string[, mixed $encoding = null ]) : mixed
mb_str_split(mixed $string[, mixed $length = 1 ][, mixed $encoding = null ]) : mixed
Runs a PHP script that can be stopped only with a SIGKILL (9) signal for 3 seconds.
handleSignal(mixed $signal) : mixed