Procedural File: functions.php
Source Location: /inc/functions.php
Page Details:
MyBB 1.4 Copyright © 2008 MyBB Group, All Rights Reserved
Website: http://www.mybboard.net License: http://www.mybboard.net/about/license $Id: functions.php 4350 2009-04-14 23:14:07Z Tikitiki $
Tags:
add_breadcrumb [line 2846]
void add_breadcrumb(
string $name, [string $url = ""])
|
|
Add a breadcrumb menu item to the list.
Parameters
| string |
$name |
The name of the item to add |
| string |
$url |
The URL of the item to add |
add_shutdown [line 116]
boolean add_shutdown(
string $name)
|
|
Adds a function to the list of functions to run on shutdown.
Tags:
Parameters
| string |
$name |
The name of the function. |
alt_trow [line 3307]
string alt_trow(
[int $reset = 0])
|
|
Select an alternating row colour based on the previous call to this function
Tags:
Parameters
| int |
$reset |
1 to reset the row to trow1. |
ban_date2timestamp [line 5375]
int ban_date2timestamp(
string $date, [int $stamp = 0])
|
|
Format a ban length in to a UNIX timestamp.
Tags:
Parameters
| string |
$date |
The ban length string |
| int |
$stamp |
The optional UNIX timestamp, if 0, current time is used. |
build_archive_link [line 2935]
string build_archive_link(
string $type, [int $id = ""])
|
|
Builds a URL to an archive mode page
Tags:
Parameters
| string |
$type |
The type of page (thread|announcement|forum) |
| int |
$id |
The ID of the item |
build_breadcrumb [line 2799]
Build the breadcrumb navigation trail from the specified items
Tags:
build_clickable_smilies [line 2292]
string build_clickable_smilies(
)
|
|
Build the javascript clickable smilie inserter
Tags:
build_forum_breadcrumb [line 2860]
void build_forum_breadcrumb(
int $fid)
|
|
Build the forum breadcrumb nagiation (the navigation to a specific forum including all parent forums)
Parameters
| int |
$fid |
The forum ID to build the navigation for |
build_forum_jump [line 2049]
string build_forum_jump(
[int $pid = "0"], [int $selitem = ""], [int $addselect = "1"], [int $depth = ""], [int $showextras = "1"], [boolean $showall = false], [array $permissions = ""], [string $name = "fid"])
|
|
Builds a forum jump menu
Tags:
Parameters
| int |
$pid |
The parent forum to start with |
| int |
$selitem |
The selected item ID |
| int |
$addselect |
If we need to add select boxes to this cal or not |
| int |
$depth |
The current depth of forums we're at |
| int |
$showextras |
Whether or not to show extra items such as User CP, Forum home |
| boolean |
$showall |
Ignore the showinjump setting and show all forums (for moderation pages) |
| array |
$permissions |
Array of permissions |
| string |
$name |
The name of the forum jump |
build_highlight_array [line 4778]
array build_highlight_array(
string $terms)
|
|
Build a PREG compatible array of search highlight terms to replace in posts.
Tags:
Parameters
| string |
$terms |
Incoming terms to highlight |
build_mycode_inserter [line 2212]
string build_mycode_inserter(
[ $bind = "message"])
|
|
Build the javascript based MyCode inserter
Tags:
Parameters
build_parent_list [line 548]
string build_parent_list(
int $fid, [string $column = "fid"], [string $joiner = "OR"], [string $parentlist = ""])
|
|
Build a parent list of a specific forum, suitable for querying
Tags:
Parameters
| int |
$fid |
The forum ID |
| string |
$column |
The column name to add to the query |
| string |
$joiner |
The joiner for each forum for querying (OR | AND | etc) |
| string |
$parentlist |
The parent list of the forum - if you have it |
build_profile_link [line 4213]
string build_profile_link(
[string $username = ""], [int $uid = 0], [string $target = ""], [string $onclick = ""])
|
|
Build the profile link.
Tags:
Parameters
| string |
$username |
The Username of the profile. |
| int |
$uid |
The user id of the profile. |
| string |
$target |
The target frame |
| string |
$onclick |
Any onclick javascript. |
build_theme_select [line 3539]
string build_theme_select(
string $name, [int $selected = ""], [int $tid = 0], [int $depth = ""], [int $usergroup_override = 0])
|
|
Build a theme selection menu
Tags:
Parameters
| string |
$name |
The name of the menu |
| int |
$selected |
The ID of the selected theme |
| int |
$tid |
The ID of the parent theme to select from |
| int |
$depth |
The current selection depth |
| int |
$usergroup_override |
Whether or not to override usergroup permissions (1 to override) |
build_timezone_select [line 5021]
void build_timezone_select(
string $name, [int $selected = 0], [boolean $short = false])
|
|
Build a time zone selection list.
Parameters
| string |
$name |
The name of the select |
| int |
$selected |
The selected time zone (defaults to GMT) |
| boolean |
$short |
True to generate a "short" list with just timezone and current time |
cache_forums [line 575]
void cache_forums(
[boolean $force = false])
|
|
Load the forum cache in to memory
Parameters
| boolean |
$force |
True to force a reload of the cache |
check_forum_password [line 1233]
void check_forum_password(
int $fid, [boolean $pid = 0])
|
|
Check the password given on a certain forum for validity
Parameters
| int |
$fid |
The forum ID |
| boolean |
$pid |
The Parent ID |
convert_through_utf8 [line 3670]
void convert_through_utf8(
$str, [ $to = true])
|
|
Parameters
debug_page [line 2970]
Prints a debug information page
dec_to_utf8 [line 4877]
void dec_to_utf8(
string $src)
|
|
Converts a decimal reference of a character to its UTF-8 equivilant (Code by Anne van Kesteren, http://annevankesteren.nl/2005/05/character-references)
Parameters
| string |
$src |
Decimal value of a character reference |
delete_post [line 2023]
void delete_post(
int $pid, [ $tid = ""])
|
|
Deletes a post from the database
Parameters
| int |
$pid |
The thread ID |
| |
$tid |
|
delete_thread [line 2005]
void delete_thread(
int $tid)
|
|
Deletes a thread from the database
Parameters
email_already_in_use [line 4707]
boolean email_already_in_use(
string $email, [string $uid = ""])
|
|
Checks to see if the email is already in use by another
Tags:
Parameters
| string |
$email |
The email to check. |
| string |
$uid |
User ID of the user (updating only) |
error [line 642]
void error(
[string $error = ""], [string $title = ""])
|
|
Produce a friendly error message page
Parameters
| string |
$error |
The error message to be shown |
| string |
$title |
The title of the message shown in the title of the page and the error table |
error_no_permission [line 720]
void error_no_permission(
)
|
|
Presents the user with a "no permission" page
escaped_explode [line 5230]
array escaped_explode(
string $delimeter, string $string, [string $escape = ""])
|
|
Split a string based on the specified delimeter, ignoring said delimeter in escaped strings. Ex: the "quick brown fox" jumped, could return 1 => the, 2 => quick brown fox, 3 => jumped
Tags:
Parameters
| string |
$delimeter |
The delimeter to split by |
| string |
$string |
The string to split |
| string |
$escape |
The escape character or string if we have one. |
expire_warnings [line 5394]
Expire old warnings in the database.
fetch_ban_times [line 5337]
Fetch a list of ban times for a user account.
Tags:
fetch_forum_permissions [line 1167]
array fetch_forum_permissions(
int $fid, string $gid, array $groupperms)
|
|
Fetches the permissions for a specific forum/group applying the inheritance scheme. Called by forum_permissions()
Tags:
Parameters
| int |
$fid |
The forum ID |
| string |
$gid |
A comma separated list of usergroups |
| array |
$groupperms |
Group permissions |
fetch_longipv4_range [line 5288]
void fetch_longipv4_range(
string $ip)
|
|
Fetch an IPv4 long formatted range for searching IPv4 IP addresses.
Parameters
| string |
$ip |
The IP address to convert to a range based LONG |
fetch_page_url [line 925]
void fetch_page_url(
string $url, int $page)
|
|
Generate a page URL for use by the multipage function
Parameters
| string |
$url |
The URL being passed |
| int |
$page |
The page number |
fetch_remote_file [line 5103]
string fetch_remote_file(
string $url, [ $post_data = array()])
|
|
Fetch the contents of a remote fle.
Tags:
Parameters
| string |
$url |
The URL of the remote file |
| |
$post_data |
|
fix_mktime [line 2784]
string fix_mktime(
string $format, int $year)
|
|
Fixes mktime for dates earlier than 1970
Tags:
Parameters
| string |
$format |
The date format to use |
| int |
$year |
The year of the date |
format_bdays [line 3834]
string format_bdays(
string $display, int $bm, int $bd, int $by, int $wd)
|
|
Formats a birthday appropriately
Tags:
Parameters
| string |
$display |
The PHP date format string |
| int |
$bm |
The month of the birthday |
| int |
$bd |
The day of the birthday |
| int |
$by |
The year of the birthday |
| int |
$wd |
The weekday of the birthday |
format_name [line 2179]
string format_name(
string $username, int $usergroup, [int $displaygroup = ""])
|
|
Formats a username based on their display group
Tags:
Parameters
| string |
$username |
The username |
| int |
$usergroup |
The usergroup for the user (if not specified, will be fetched) |
| int |
$displaygroup |
The display group for the user (if not specified, will be fetched) |
forum_permissions [line 1087]
array forum_permissions(
[int $fid = 0], [int $uid = 0], [int $gid = 0])
|
|
Build the forum permissions for a specific forum, user or group
Tags:
Parameters
| int |
$fid |
The forum ID to build permissions for (0 builds for all forums) |
| int |
$uid |
The user to build the permissions for (0 will select the uid automatically) |
| int |
$gid |
The group of the user to build permissions for (0 will fetch it) |
generate_post_check [line 466]
string generate_post_check(
)
|
|
Generates a unique code for POST requests to prevent XSS/CSRF attacks
Tags:
get_age [line 3908]
float get_age(
string $birthday)
|
|
Returns the age of a user with specified birthday.
Tags:
Parameters
| string |
$birthday |
The birthday of a user. |
get_announcement_link [line 4198]
string get_announcement_link(
[int $aid = 0])
|
|
Get the announcement link.
Tags:
Parameters
| int |
$aid |
The announement id of the announcement. |
get_attachment_icon [line 2667]
string get_attachment_icon(
string $ext)
|
|
Get the attachment icon for a specific file extension
Tags:
Parameters
| string |
$ext |
The file extension |
get_bdays [line 3806]
array get_bdays(
int $in)
|
|
Workaround for date limitation in PHP to establish the day of a birthday (Provided by meme)
Tags:
Parameters
get_calendar_link [line 4361]
string get_calendar_link(
int $calendar, [int $year = 0], [int $month = 0], [int $day = 0])
|
|
Build the link to a specified date on the calendar
Tags:
Parameters
| int |
$calendar |
The ID of the calendar |
| int |
$year |
The year |
| int |
$month |
The month |
| int |
$day |
The day (optional) |
get_calendar_week_link [line 4399]
string get_calendar_week_link(
int $calendar, int $week, int 2)
|
|
Build the link to a specified week on the calendar
Tags:
Parameters
| int |
2 |
The week |
| int |
$calendar |
The ID of the calendar |
| int |
$week |
The year |
get_child_list [line 603]
void get_child_list(
int $fid, return 1)
|
|
Generate an array of all child and descendant forums for a specific forum.
Parameters
| return |
1 |
Array of descendants |
| int |
$fid |
The forum ID |
get_colored_warning_level [line 2532]
string get_colored_warning_level(
int $level)
|
|
Fetch a color coded version of a warning level (based on it's percentage)
Tags:
Parameters
| int |
$level |
The warning level (percentage of 100) |
get_current_location [line 3437]
string get_current_location(
[boolean $fields = false], [array $ignore = array()])
|
|
Get the current location taking in to account different web serves and systems
Tags:
Parameters
| boolean |
$fields |
True to return as "hidden" fields |
| array |
$ignore |
Array of fields to ignore if first argument is true |
get_event_date [line 4171]
string get_event_date(
array $event)
|
|
Get the event date.
Tags:
Parameters
| array |
$event |
The event data array. |
get_event_link [line 4346]
string get_event_link(
int $eid)
|
|
Build the event link.
Tags:
Parameters
| int |
$eid |
The event ID of the event |
get_event_poster [line 4158]
string get_event_poster(
array $event)
|
|
Get the event poster.
Tags:
Parameters
| array |
$event |
The event data array. |
get_extension [line 2146]
string get_extension(
string $file)
|
|
Returns the extension of a file.
Tags:
Parameters
| string |
$file |
The filename. |
get_forum [line 4448]
array get_forum(
int $fid, [int $active_override = 0])
|
|
Get the forum of a specific forum id.
Tags:
Parameters
| int |
$fid |
The forum id of the forum. |
| int |
$active_override |
(Optional) If set to 1, will override the active forum status |
get_forum_link [line 4263]
string get_forum_link(
int $fid, [int $page = 0])
|
|
Build the forum link.
Tags:
Parameters
| int |
$fid |
The forum id of the forum. |
| int |
$page |
(Optional) The page number of the forum. |
get_friendly_size [line 2600]
string get_friendly_size(
int $size)
|
|
Fetch the friendly size (GB, MB, KB, B) for a specified file size.
Tags:
Parameters
| int |
$size |
The size in bytes |
get_inactive_forums [line 4552]
string get_inactive_forums(
)
|
|
Get inactivate forums.
Tags:
get_ip [line 2557]
Fetch the IP address of the current user.
Tags:
get_moderator_permissions [line 1317]
array get_moderator_permissions(
fid $fid, [uid $uid = "0"], [string $parentslist = ""])
|
|
Return the permissions for a moderator in a specific forum
Tags:
Parameters
| fid |
$fid |
The forum ID |
| uid |
$uid |
The user ID to fetch permissions for (0 assumes current logged in user) |
| string |
$parentslist |
The parent list for the forum (if blank, will be fetched) |
get_parent_list [line 519]
string get_parent_list(
int $fid)
|
|
Return a parent list for the specified forum.
Tags:
Parameters
| int |
$fid |
The forum id to get the parent list for. |
get_post [line 4520]
string get_post(
int $pid)
|
|
Get the post of a post id.
Tags:
Parameters
| int |
$pid |
The post id of the post. |
get_post_icons [line 1430]
Generate a list of the posticons.
Tags:
get_post_link [line 4325]
void get_post_link(
int $pid, [int $tid = 0])
|
|
Build the post link.
Parameters
| int |
$pid |
The post ID of the post |
| int |
$tid |
The thread id of the post. |
get_profile_link [line 4186]
string get_profile_link(
[int $uid = 0])
|
|
Get the profile link.
Tags:
Parameters
| int |
$uid |
The user id of the profile. |
get_reputation [line 2492]
string get_reputation(
int $reputation, [int $uid = 0])
|
|
Get the formatted reputation for a user.
Tags:
Parameters
| int |
$reputation |
The reputation value |
| int |
$uid |
The user ID (if not specified, the generated reputation will not be a link) |
get_server_load [line 1613]
Returns the serverload of the system.
Tags:
get_thread [line 4487]
string get_thread(
int $tid)
|
|
Get the thread of a thread id.
Tags:
Parameters
| int |
$tid |
The thread id of the thread. |
get_thread_link [line 4286]
string get_thread_link(
int $tid, [int $page = 0], [string $action = ''])
|
|
Build the thread link.
Tags:
Parameters
| int |
$tid |
The thread id of the thread. |
| int |
$page |
(Optional) The page number of the thread. |
| string |
$action |
(Optional) The action we're performing (ex, lastpost, newpost, etc) |
get_unviewable_forums [line 2721]
string get_unviewable_forums(
[boolean $only_readable_threads = false])
|
|
Get a list of the unviewable forums for the current user
Tags:
Parameters
| boolean |
$only_readable_threads |
Set to true to only fetch those forums for which users can actually read a thread in. |
get_user [line 4416]
array get_user(
int $uid)
|
|
Get the user data of a user id.
Tags:
Parameters
| int |
$uid |
The user id of the user. |
get_weekday [line 3770]
int get_weekday(
int $month, int $day, int $year)
|
|
Workaround for date limitation in PHP to establish the day of a birthday (Provided by meme)
Tags:
Parameters
| int |
$month |
The month of the birthday |
| int |
$day |
The day of the birthday |
| int |
$year |
The year of the bithday |
gzip_encode [line 2389]
string gzip_encode(
string $contents, [int $level = 1])
|
|
Gzip encodes text to a specified level
Tags:
Parameters
| string |
$contents |
The string to encode |
| int |
$level |
The level (1-9) to encode at |
htmlspecialchars_uni [line 3625]
string htmlspecialchars_uni(
string $message)
|
|
Custom function for htmlspecialchars which takes in to account unicode
Tags:
Parameters
| string |
$message |
The string to format |
inline_error [line 683]
string inline_error(
array $errors, [string $title = ""])
|
|
Produce an error message for displaying inline on a page
Tags:
Parameters
| array |
$errors |
Array of errors to be shown |
| string |
$title |
The title of the error message |
is_banned_email [line 4952]
boolean is_banned_email(
string $email, [boolean $update_lastuse = false])
|
|
Check if a specific email address has been banned.
Tags:
Parameters
| string |
$email |
The email address. |
| boolean |
$update_lastuse |
True if the 'last used' dateline should be updated if a match is found. |
is_banned_ip [line 4981]
boolean is_banned_ip(
string $ip_address, [boolean $update_lastuse = false])
|
|
Checks if a specific IP address has been banned.
Tags:
Parameters
| string |
$ip_address |
The IP address. |
| boolean |
$update_lastuse |
True if the 'last used' dateline should be updated if a match is found. |
is_banned_username [line 4923]
boolean is_banned_username(
string $username, [boolean $update_lastuse = false])
|
|
Checks if a username has been disallowed for registration/use.
Tags:
Parameters
| string |
$username |
The username |
| boolean |
$update_lastuse |
True if the 'last used' dateline should be updated if a match is found. |
is_moderator [line 1366]
bool is_moderator(
[int $fid = "0"], [string $action = ""], [int $uid = "0"])
|
|
Checks if a moderator has permissions to perform an action in a specific forum
Tags:
Parameters
| int |
$fid |
The forum ID (0 assumes global) |
| string |
$action |
The action tyring to be performed. (blank assumes any action at all) |
| int |
$uid |
The user ID (0 assumes current user) |
is_super_admin [line 5206]
boolean is_super_admin(
int $uid)
|
|
Checks if a particular user is a super administrator.
Tags:
Parameters
| int |
$uid |
The user ID to check against the list of super admins |
join_usergroup [line 3331]
void join_usergroup(
int $uid, int $joingroup)
|
|
Add a user to a specific additional user group.
Parameters
| int |
$uid |
The user ID |
| int |
$joingroup |
The user group ID to join |
leave_usergroup [line 3382]
void leave_usergroup(
int $uid, int $leavegroup)
|
|
Remove a user from a specific additional user group
Parameters
| int |
$uid |
The user ID |
| int |
$leavegroup |
The user group ID |
login_attempt_check [line 4589]
bool login_attempt_check(
[bool $fatal = true])
|
|
Checks to make sure a user has not tried to login more times than permitted Will stop execution with call to error() unless
Tags:
Parameters
| bool |
$fatal |
(Optional) The function will stop execution if it finds an error with the login. Default is True |
log_moderator_action [line 2440]
void log_moderator_action(
array $data, [string $action = ""])
|
|
Log the actions of a moderator.
Parameters
| array |
$data |
The data of the moderator's action. |
| string |
$action |
The message to enter for the action the moderator performed. |
mark_reports [line 3115]
void mark_reports(
mixed $id, [string $type = "post"])
|
|
Mark specific reported posts of a certain type as dealt with
Parameters
| mixed |
$id |
An array or int of the ID numbers you're marking as dealt with |
| string |
$type |
The type of item the above IDs are for - post, posts, thread, threads, forum, all |
multipage [line 831]
string multipage(
int $count, int $perpage, int $page, string $url)
|
|
Generate a listing of page - pagination
Tags:
Parameters
| int |
$count |
The number of items |
| int |
$perpage |
The number of items to be shown per page |
| int |
$page |
The current page number |
| string |
$url |
The URL to have page numbers tacked on to (If {page} is specified, the value will be replaced with the page #) |
my_chmod [line 5476]
void my_chmod(
string $file, string $mode)
|
|
Custom chmod function to fix problems with hosts who's server configurations screw up umasks
Parameters
| string |
$file |
The file to chmod |
| string |
$mode |
The mode to chmod(i.e. 0666) |
my_date [line 317]
string my_date(
string $format, [int $stamp = ""], [int $offset = ""], [int $ty = 1], [boolean $adodb = false])
|
|
Turn a unix timestamp in to a "friendly" date/time format for the user.
Tags:
Parameters
| string |
$format |
A date format according to PHP's date structure. |
| int |
$stamp |
The unix timestamp the date should be generated for. |
| int |
$offset |
The offset in hours that should be applied to times. (timezones) |
| int |
$ty |
Whether or not to use today/yesterday formatting. |
| boolean |
$adodb |
Whether or not to use the adodb time class for < 1970 or > 2038 times |
my_get_array_cookie [line 1566]
array|boolean my_get_array_cookie(
string $name, int $id)
|
|
Get the contents from a serialised cookie array.
Tags:
Parameters
| string |
$name |
The cookie identifier. |
| int |
$id |
The cookie content id. |
my_mail [line 416]
void my_mail(
string $to, string $subject, string $message, [string $from = ""], [string $charset = ""], [boolean $headers = ""], [string $keep_alive = false], [string $format = "text"], [string $message_text = ""], [ $return_email = ""])
|
|
Sends an email using PHP's mail function, formatting it appropriately.
Parameters
| string |
$to |
Address the email should be addressed to. |
| string |
$subject |
The subject of the email being sent. |
| string |
$message |
The message being sent. |
| string |
$from |
The from address of the email, if blank, the board name will be used. |
| string |
$charset |
The chracter set being used to send this email. |
| boolean |
$headers |
Do we wish to keep the connection to the mail server alive to send more than one message (SMTP only) |
| string |
$keep_alive |
The format of the email to be sent (text or html). text is default |
| string |
$format |
The text message of the email if being sent in html format, for email clients that don't support html |
| string |
$message_text |
The email address to return to. Defaults to admin return email address. |
| |
$return_email |
|
my_number_format [line 3640]
int my_number_format(
int $number)
|
|
Custom function for formatting numbers.
Tags:
Parameters
| int |
$number |
The number to format. |
my_rmdir_recursive [line 5498]
void my_rmdir_recursive(
string $path, [array $ignore = array()])
|
|
Custom rmdir function to loop through an entire directory and delete all files/folders within
Parameters
| string |
$path |
The path to the directory |
| array |
$ignore |
Any files you wish to ignore (optional) |
my_setcookie [line 1483]
void my_setcookie(
string $name, [string $value = ""], [int $expires = ""], [boolean $httponly = false])
|
|
MyBB setcookie() wrapper.
Parameters
| string |
$name |
The cookie identifier. |
| string |
$value |
The cookie value. |
| int |
$expires |
The timestamp of the expiry date. |
| boolean |
$httponly |
True if setting a HttpOnly cookie (supported by IE, Opera 9, Konqueror) |
my_set_array_cookie [line 1594]
void my_set_array_cookie(
string $name, int $id, string $value)
|
|
Set a serialised cookie array.
Parameters
| string |
$name |
The cookie identifier. |
| int |
$id |
The cookie content id. |
| string |
$value |
The value to set the cookie to. |
my_strlen [line 3959]
int my_strlen(
string $string)
|
|
Checks for the length of a string, mb strings accounted for
Tags:
Parameters
| string |
$string |
The string to check the length of. |
my_strpos [line 4061]
int my_strpos(
string $haystack, string $needle, [int $offset = 0])
|
|
Finds a needle in a haystack and returns it position, mb strings accounted for
Tags:
Parameters
| string |
$haystack |
String to look in (haystack) |
| string |
$needle |
What to look for (needle) |
| int |
$offset |
(optional) How much to offset |
my_strtolower [line 4039]
int my_strtolower(
string $string)
|
|
lowers the case of a string, mb strings accounted for
Tags:
Parameters
| string |
$string |
The string to lower. |
my_strtoupper [line 4086]
int my_strtoupper(
string $string)
|
|
ups the case of a string, mb strings accounted for
Tags:
Parameters
| string |
$string |
The string to up. |
my_substr [line 3997]
int my_substr(
string $string, int $start, [int $length = ""], [bool $handle_entities = false])
|
|
Cuts a string at a specified point, mb strings accounted for
Tags:
Parameters
| string |
$string |
The string to cut. |
| int |
$start |
Where to cut |
| int |
$length |
(optional) How much to cut |
| bool |
$handle_entities |
(optional) Properly handle HTML entities? |
my_unsetcookie [line 1549]
void my_unsetcookie(
string $name)
|
|
Unset a cookie set by MyBB.
Parameters
| string |
$name |
The cookie identifier. |
my_wordwrap [line 3741]
string my_wordwrap(
string $message)
|
|
Replacement function for PHP's wordwrap(). This version does not break up HTML tags, URLs or unicode references.
Tags:
Parameters
| string |
$message |
The string to be word wrapped |
nice_time [line 3163]
string nice_time(
int $stamp, [array $options = array()])
|
|
Fetch a friendly x days, y months etc date stamp from a timestamp
Tags:
Parameters
| int |
$stamp |
The timestamp |
| array |
$options |
Array of options |
output_page [line 17]
void output_page(
string $contents)
|
|
Outputs a page directly to the browser, parsing anything which needs to be parsed.
Parameters
| string |
$contents |
The contents of the page. |
parse_page [line 271]
string parse_page(
string $contents)
|
|
Parses the contents of a page before outputting it.
Tags:
Parameters
| string |
$contents |
The contents of the page. |
random_str [line 2157]
string random_str(
[int $length = "8"])
|
|
Generates a random string.
Tags:
Parameters
| int |
$length |
The length of the string to generate. |
rebuildsettings [line 4729]
rebuild_settings [line 4738]
redirect [line 763]
void redirect(
string $url, [string $message = ""], [ $title = ""])
|
|
Redirect the user to a given URL with a given message
Parameters
| string |
$url |
The URL to redirect the user to |
| string |
$message |
The redirection message to be shown |
| |
$title |
|
reset_breadcrumb [line 2917]
Resets the breadcrumb navigation to the first item, and clears the rest
run_shutdown [line 133]
Runs the shutdown items after the page has been sent to the browser.
send_mail_queue [line 233]
void send_mail_queue(
[int $count = 10])
|
|
Sends a specified amount of messages from the mail queue
Parameters
| int |
$count |
The number of messages to send (Defaults to 20) |
send_page_headers [line 3096]
void send_page_headers(
)
|
|
Outputs the correct page headers.
subforums_count [line 5539]
integer subforums_count(
array $array)
|
|
Counts the number of subforums in a array([pid][disporder][fid]) starting from the pid
Tags:
Parameters
| array |
$array |
The array of forums |
unhtmlentities [line 4106]
int unhtmlentities(
string $string)
|
|
Returns any html entities to their original character
Tags:
Parameters
| string |
$string |
The string to un-htmlentitize. |
unicode_chr [line 5443]
mixed unicode_chr(
string $c)
|
|
Unicode function for php function chr()
Tags:
Parameters
update_first_post [line 3932]
void update_first_post(
int $tid)
|
|
Updates the first posts in a thread.
Parameters
| int |
$tid |
The thread id for which to update the first post id. |
update_forum_count [line 1987]
void update_forum_count(
$fid)
|
|
Parameters
update_forum_counters [line 1740]
void update_forum_counters(
int $fid, [array $changes = array()])
|
|
Updates the forum counters with a specific value (or addition/subtraction of the previous value)
Parameters
| int |
$fid |
The forum ID |
| array |
$changes |
Array of items being updated (threads, posts, unapprovedthreads, unapprovedposts) and their value (ex, 1, +1, -1) |
update_forum_lastpost [line 1846]
void update_forum_lastpost(
int $fid)
|
|
Update the last post information for a specific forum
Parameters
update_stats [line 1675]
void update_stats(
[array $changes = array()])
|
|
Updates the forum statistics with specific values (or addition/subtraction of the previous value)
Parameters
| array |
$changes |
Array of items being updated (numthreads,numposts,numusers) |
update_thread_attachment_count [line 1995]
void update_thread_attachment_count(
$tid)
|
|
Parameters
update_thread_count [line 1991]
void update_thread_count(
$tid)
|
|
Parameters
update_thread_counters [line 1877]
void update_thread_counters(
int $tid, [array $changes = array()])
|
|
Updates the thread counters with a specific value (or addition/subtraction of the previous value)
Parameters
| int |
$tid |
The thread ID |
| array |
$changes |
Array of items being updated (replies, unapprovedposts, attachmentcount) and their value (ex, 1, +1, -1) |
update_thread_data [line 1928]
void update_thread_data(
int $tid)
|
|
Update the first post and lastpost data for a specific thread
Parameters
usergroup_displaygroup [line 1059]
array usergroup_displaygroup(
int $gid)
|
|
Fetch the display group properties for a specific display group
Tags:
Parameters
| int |
$gid |
The group ID to fetch the display properties for |
usergroup_permissions [line 999]
array usergroup_permissions(
[mixed $gid = 0])
|
|
Fetch the usergroup permissions for a specic group or series of groups combined
Tags:
Parameters
| mixed |
$gid |
A list of groups (Can be a single integer, or a list of groups separated by a comma) |
user_permissions [line 953]
array user_permissions(
[int $uid = 0])
|
|
Fetch the permissions for a specific user
Tags:
Parameters
validate_email_format [line 4690]
boolean validate_email_format(
string $email)
|
|
Validates the format of an email address.
Tags:
Parameters
| string |
$email |
The string to check. |
verify_post_check [line 486]
void verify_post_check(
string $code, [boolean $silent = false])
|
|
Verifies a POST check code is valid, if not shows an error (silently returns false on silent parameter)
Parameters
| string |
$code |
The incoming POST check code |
| boolean |
$silent |
Silent mode or not (silent mode will not show the error to the user but returns false) |
|