Mybb 1.4.6
[ class tree: Mybb 1.4.6 ] [ index: Mybb 1.4.6 ] [ all elements ]

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:

filesource:  Source Code for this file








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
[ Top ]



add_shutdown [line 116]

boolean add_shutdown( string $name)

Adds a function to the list of functions to run on shutdown.



Tags:

return:  True if function exists, otherwise false.


Parameters

string   $name   The name of the function.
[ Top ]



alt_trow [line 3307]

string alt_trow( [int $reset = 0])

Select an alternating row colour based on the previous call to this function



Tags:

return:  trow1 or trow2 depending on the previous call


Parameters

int   $reset   1 to reset the row to trow1.
[ Top ]



ban_date2timestamp [line 5375]

int ban_date2timestamp( string $date, [int $stamp = 0])

Format a ban length in to a UNIX timestamp.



Tags:

return:  The UNIX timestamp when the ban will be lifted


Parameters

string   $date   The ban length string
int   $stamp   The optional UNIX timestamp, if 0, current time is used.
[ Top ]



build_archive_link [line 2935]

string build_archive_link( string $type, [int $id = ""])

Builds a URL to an archive mode page



Tags:

return:  The URL


Parameters

string   $type   The type of page (thread|announcement|forum)
int   $id   The ID of the item
[ Top ]



build_breadcrumb [line 2799]

The build_breadcrumb( )

Build the breadcrumb navigation trail from the specified items



Tags:

return:  formatted breadcrumb navigation trail


[ Top ]



build_clickable_smilies [line 2292]

string build_clickable_smilies( )

Build the javascript clickable smilie inserter



Tags:

return:  The clickable smilies list


[ Top ]



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
[ Top ]



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:

return:  Forum jump items


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
[ Top ]



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:

return:  PREG compatible array of terms


Parameters

string   $terms   Incoming terms to highlight
[ Top ]



build_mycode_inserter [line 2212]

string build_mycode_inserter( [ $bind = "message"])

Build the javascript based MyCode inserter



Tags:

return:  The MyCode inserter


Parameters

   $bind  
[ Top ]



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:

return:  The query string generated


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
[ Top ]



build_profile_link [line 4213]

string build_profile_link( [string $username = ""], [int $uid = 0], [string $target = ""], [string $onclick = ""])

Build the profile link.



Tags:

return:  The complete profile link.


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.
[ Top ]



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:

return:  The theme selection list


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)
[ Top ]



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
[ Top ]



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
[ Top ]



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
[ Top ]



convert_through_utf8 [line 3670]

void convert_through_utf8( $str, [ $to = true])



Parameters

   $str  
   $to  
[ Top ]



debug_page [line 2970]

void debug_page( )

Prints a debug information page



[ Top ]



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
[ Top ]



delete_post [line 2023]

void delete_post( int $pid, [ $tid = ""])

Deletes a post from the database



Parameters

int   $pid   The thread ID
   $tid  
[ Top ]



delete_thread [line 2005]

void delete_thread( int $tid)

Deletes a thread from the database



Parameters

int   $tid   The thread ID
[ Top ]



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:

return:  True when in use, false when not.


Parameters

string   $email   The email to check.
string   $uid   User ID of the user (updating only)
[ Top ]



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
[ Top ]



error_no_permission [line 720]

void error_no_permission( )

Presents the user with a "no permission" page



[ Top ]



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:

return:  Array of split string


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.
[ Top ]



expire_warnings [line 5394]

void expire_warnings( )

Expire old warnings in the database.



[ Top ]



fetch_ban_times [line 5337]

array fetch_ban_times( )

Fetch a list of ban times for a user account.



Tags:

return:  Array of ban times


[ Top ]



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:

return:  Permissions for this forum


Parameters

int   $fid   The forum ID
string   $gid   A comma separated list of usergroups
array   $groupperms   Group permissions
[ Top ]



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
[ Top ]



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
[ Top ]



fetch_remote_file [line 5103]

string fetch_remote_file( string $url, [ $post_data = array()])

Fetch the contents of a remote fle.



Tags:

return:  The remote file contents.


Parameters

string   $url   The URL of the remote file
   $post_data  
[ Top ]



fix_mktime [line 2784]

string fix_mktime( string $format, int $year)

Fixes mktime for dates earlier than 1970



Tags:

return:  The correct date format


Parameters

string   $format   The date format to use
int   $year   The year of the date
[ Top ]



format_bdays [line 3834]

string format_bdays( string $display, int $bm, int $bd, int $by, int $wd)

Formats a birthday appropriately



Tags:

return:  The formatted birthday


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
[ Top ]



format_name [line 2179]

string format_name( string $username, int $usergroup, [int $displaygroup = ""])

Formats a username based on their display group



Tags:

return:  The formatted username


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)
[ Top ]



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:

return:  Forum permissions for the specific forum or forums


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)
[ Top ]



generate_post_check [line 466]

string generate_post_check( )

Generates a unique code for POST requests to prevent XSS/CSRF attacks



Tags:

return:  The generated code


[ Top ]



get_age [line 3908]

float get_age( string $birthday)

Returns the age of a user with specified birthday.



Tags:

return:  The age of a user with that birthday.


Parameters

string   $birthday   The birthday of a user.
[ Top ]



get_announcement_link [line 4198]

string get_announcement_link( [int $aid = 0])

Get the announcement link.



Tags:

return:  The url to the announcement.


Parameters

int   $aid   The announement id of the announcement.
[ Top ]



get_attachment_icon [line 2667]

string get_attachment_icon( string $ext)

Get the attachment icon for a specific file extension



Tags:

return:  The attachment icon


Parameters

string   $ext   The file extension
[ Top ]



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:

return:  The number of days in each month of that year


Parameters

int   $in   The year.
[ Top ]



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:

return:  The URL of the calendar


Parameters

int   $calendar   The ID of the calendar
int   $year   The year
int   $month   The month
int   $day   The day (optional)
[ Top ]



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:

return:  The URL of the calendar


Parameters

int   2   The week
int   $calendar   The ID of the calendar
int   $week   The year
[ Top ]



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
[ Top ]



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:

return:  Formatted warning level


Parameters

int   $level   The warning level (percentage of 100)
[ Top ]



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:

return:  The current URL being accessed


Parameters

boolean   $fields   True to return as "hidden" fields
array   $ignore   Array of fields to ignore if first argument is true
[ Top ]



get_event_date [line 4171]

string get_event_date( array $event)

Get the event date.



Tags:

return:  The event date.


Parameters

array   $event   The event data array.
[ Top ]



get_event_link [line 4346]

string get_event_link( int $eid)

Build the event link.



Tags:

return:  The URL of the event


Parameters

int   $eid   The event ID of the event
[ Top ]



get_event_poster [line 4158]

string get_event_poster( array $event)

Get the event poster.



Tags:

return:  The link to the event poster.


Parameters

array   $event   The event data array.
[ Top ]



get_extension [line 2146]

string get_extension( string $file)

Returns the extension of a file.



Tags:

return:  The extension of the file.


Parameters

string   $file   The filename.
[ Top ]



get_forum [line 4448]

array get_forum( int $fid, [int $active_override = 0])

Get the forum of a specific forum id.



Tags:

return:  The database row of a forum.


Parameters

int   $fid   The forum id of the forum.
int   $active_override   (Optional) If set to 1, will override the active forum status
[ Top ]



get_forum_link [line 4263]

string get_forum_link( int $fid, [int $page = 0])

Build the forum link.



Tags:

return:  The url to the forum.


Parameters

int   $fid   The forum id of the forum.
int   $page   (Optional) The page number of the forum.
[ Top ]



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:

return:  The friendly file size


Parameters

int   $size   The size in bytes
[ Top ]



get_inactive_forums [line 4552]

string get_inactive_forums( )

Get inactivate forums.



Tags:

return:  The comma separated values of the inactivate forum.


[ Top ]



get_ip [line 2557]

string get_ip( )

Fetch the IP address of the current user.



Tags:

return:  The IP address.


[ Top ]



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:

return:  Array of moderator permissions for the specific forum


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)
[ Top ]



get_parent_list [line 519]

string get_parent_list( int $fid)

Return a parent list for the specified forum.



Tags:

return:  The comma-separated parent list.


Parameters

int   $fid   The forum id to get the parent list for.
[ Top ]



get_post [line 4520]

string get_post( int $pid)

Get the post of a post id.



Tags:

return:  The database row of the post.


Parameters

int   $pid   The post id of the post.
[ Top ]



get_post_icons [line 1430]

string get_post_icons( )

Generate a list of the posticons.



Tags:

return:  The template of posticons.


[ Top ]



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.
[ Top ]



get_profile_link [line 4186]

string get_profile_link( [int $uid = 0])

Get the profile link.



Tags:

return:  The url to the profile.


Parameters

int   $uid   The user id of the profile.
[ Top ]



get_reputation [line 2492]

string get_reputation( int $reputation, [int $uid = 0])

Get the formatted reputation for a user.



Tags:

return:  The formatted repuation


Parameters

int   $reputation   The reputation value
int   $uid   The user ID (if not specified, the generated reputation will not be a link)
[ Top ]



get_server_load [line 1613]

int get_server_load( )

Returns the serverload of the system.



Tags:

return:  The serverload of the system.


[ Top ]



get_thread [line 4487]

string get_thread( int $tid)

Get the thread of a thread id.



Tags:

return:  The database row of the thread.


Parameters

int   $tid   The thread id of the thread.
[ Top ]



get_thread_link [line 4286]

string get_thread_link( int $tid, [int $page = 0], [string $action = ''])

Build the thread link.



Tags:

return:  The url to the thread.


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)
[ Top ]



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:

return:  Comma separated values list of the forum IDs which the user cannot view


Parameters

boolean   $only_readable_threads   Set to true to only fetch those forums for which users can actually read a thread in.
[ Top ]



get_user [line 4416]

array get_user( int $uid)

Get the user data of a user id.



Tags:

return:  The users data


Parameters

int   $uid   The user id of the user.
[ Top ]



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:

return:  The numeric day of the week for the birthday


Parameters

int   $month   The month of the birthday
int   $day   The day of the birthday
int   $year   The year of the bithday
[ Top ]



gzip_encode [line 2389]

string gzip_encode( string $contents, [int $level = 1])

Gzip encodes text to a specified level



Tags:

return:  The encoded string


Parameters

string   $contents   The string to encode
int   $level   The level (1-9) to encode at
[ Top ]



htmlspecialchars_uni [line 3625]

string htmlspecialchars_uni( string $message)

Custom function for htmlspecialchars which takes in to account unicode



Tags:

return:  The string with htmlspecialchars applied


Parameters

string   $message   The string to format
[ Top ]



inline_error [line 683]

string inline_error( array $errors, [string $title = ""])

Produce an error message for displaying inline on a page



Tags:

return:  The inline error HTML


Parameters

array   $errors   Array of errors to be shown
string   $title   The title of the error message
[ Top ]



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:

return:  True if banned, false if not banned


Parameters

string   $email   The email address.
boolean   $update_lastuse   True if the 'last used' dateline should be updated if a match is found.
[ Top ]



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:

return:  True if banned, false if not banned.


Parameters

string   $ip_address   The IP address.
boolean   $update_lastuse   True if the 'last used' dateline should be updated if a match is found.
[ Top ]



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:

return:  True if banned, false if not banned


Parameters

string   $username   The username
boolean   $update_lastuse   True if the 'last used' dateline should be updated if a match is found.
[ Top ]



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:

return:  Returns true if the user has permission, false if they do not


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)
[ Top ]



is_super_admin [line 5206]

boolean is_super_admin( int $uid)

Checks if a particular user is a super administrator.



Tags:

return:  True if a super admin, false if not


Parameters

int   $uid   The user ID to check against the list of super admins
[ Top ]



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
[ Top ]



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
[ Top ]



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:

return:  Number of logins when success, false if failed.


Parameters

bool   $fatal   (Optional) The function will stop execution if it finds an error with the login. Default is True
[ Top ]



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.
[ Top ]



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
[ Top ]



multipage [line 831]

string multipage( int $count, int $perpage, int $page, string $url)

Generate a listing of page - pagination



Tags:

return:  The generated pagination


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 #)
[ Top ]



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)
[ Top ]



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:

return:  The formatted timestamp.


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
[ Top ]



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:

return:  The cookie id's content array or false when non-existent.


Parameters

string   $name   The cookie identifier.
int   $id   The cookie content id.
[ Top ]



my_mail [line 416]

void my_mail( string $to, string $subject, string $message, [string $from = &quot;&quot;], [string $charset = &quot;&quot;], [boolean $headers = &quot;&quot;], [string $keep_alive = false], [string $format = &quot;text&quot;], [string $message_text = &quot;&quot;], [ $return_email = &quot;&quot;])

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  
[ Top ]



my_number_format [line 3640]

int my_number_format( int $number)

Custom function for formatting numbers.



Tags:

return:  The formatted number.


Parameters

int   $number   The number to format.
[ Top ]



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)
[ Top ]



my_setcookie [line 1483]

void my_setcookie( string $name, [string $value = &quot;&quot;], [int $expires = &quot;&quot;], [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)
[ Top ]



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.
[ Top ]



my_strlen [line 3959]

int my_strlen( string $string)

Checks for the length of a string, mb strings accounted for



Tags:

return:  The length of the string.


Parameters

string   $string   The string to check the length of.
[ Top ]



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:

return:  false on needle not found, integer position if found


Parameters

string   $haystack   String to look in (haystack)
string   $needle   What to look for (needle)
int   $offset   (optional) How much to offset
[ Top ]



my_strtolower [line 4039]

int my_strtolower( string $string)

lowers the case of a string, mb strings accounted for



Tags:

return:  The lowered string.


Parameters

string   $string   The string to lower.
[ Top ]



my_strtoupper [line 4086]

int my_strtoupper( string $string)

ups the case of a string, mb strings accounted for



Tags:

return:  The uped string.


Parameters

string   $string   The string to up.
[ Top ]



my_substr [line 3997]

int my_substr( string $string, int $start, [int $length = &quot;&quot;], [bool $handle_entities = false])

Cuts a string at a specified point, mb strings accounted for



Tags:

return:  The cut part of the string.


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?
[ Top ]



my_unsetcookie [line 1549]

void my_unsetcookie( string $name)

Unset a cookie set by MyBB.



Parameters

string   $name   The cookie identifier.
[ Top ]



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:

return:  The word wraped string


Parameters

string   $message   The string to be word wrapped
[ Top ]



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:

return:  The friendly formatted timestamp


Parameters

int   $stamp   The timestamp
array   $options   Array of options
[ Top ]



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.
[ Top ]



parse_page [line 271]

string parse_page( string $contents)

Parses the contents of a page before outputting it.



Tags:

return:  The parsed page.


Parameters

string   $contents   The contents of the page.
[ Top ]



random_str [line 2157]

string random_str( [int $length = &quot;8&quot;])

Generates a random string.



Tags:

return:  The random string.


Parameters

int   $length   The length of the string to generate.
[ Top ]



rebuildsettings [line 4729]

void rebuildsettings( )



[ Top ]



rebuild_settings [line 4738]

void rebuild_settings( )

Rebuilds settings.php



[ Top ]



redirect [line 763]

void redirect( string $url, [string $message = &quot;&quot;], [ $title = &quot;&quot;])

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  
[ Top ]



reset_breadcrumb [line 2917]

void reset_breadcrumb( )

Resets the breadcrumb navigation to the first item, and clears the rest



[ Top ]



run_shutdown [line 133]

void run_shutdown( )

Runs the shutdown items after the page has been sent to the browser.



[ Top ]



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)
[ Top ]



send_page_headers [line 3096]

void send_page_headers( )

Outputs the correct page headers.



[ Top ]



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:

return:  The number of sub forums


Parameters

array   $array   The array of forums
[ Top ]



unhtmlentities [line 4106]

int unhtmlentities( string $string)

Returns any html entities to their original character



Tags:

return:  The un-htmlentitied' string.


Parameters

string   $string   The string to un-htmlentitize.
[ Top ]



unicode_chr [line 5443]

mixed unicode_chr( string $c)

Unicode function for php function chr()



Tags:

return:  The unicoded chr()


Parameters

string   $c   The character
[ Top ]



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.
[ Top ]



update_forum_count [line 1987]

void update_forum_count( $fid)



Parameters

   $fid  
[ Top ]



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)
[ Top ]



update_forum_lastpost [line 1846]

void update_forum_lastpost( int $fid)

Update the last post information for a specific forum



Parameters

int   $fid   The forum ID
[ Top ]



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)
[ Top ]



update_thread_attachment_count [line 1995]

void update_thread_attachment_count( $tid)



Parameters

   $tid  
[ Top ]



update_thread_count [line 1991]

void update_thread_count( $tid)



Parameters

   $tid  
[ Top ]



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)
[ Top ]



update_thread_data [line 1928]

void update_thread_data( int $tid)

Update the first post and lastpost data for a specific thread



Parameters

int   $tid   The thread ID
[ Top ]



usergroup_displaygroup [line 1059]

array usergroup_displaygroup( int $gid)

Fetch the display group properties for a specific display group



Tags:

return:  Array of display properties for the group


Parameters

int   $gid   The group ID to fetch the display properties for
[ Top ]



usergroup_permissions [line 999]

array usergroup_permissions( [mixed $gid = 0])

Fetch the usergroup permissions for a specic group or series of groups combined



Tags:

return:  Array of permissions generated for the groups


Parameters

mixed   $gid   A list of groups (Can be a single integer, or a list of groups separated by a comma)
[ Top ]



user_permissions [line 953]

array user_permissions( [int $uid = 0])

Fetch the permissions for a specific user



Tags:

return:  Array of user permissions for the specified user


Parameters

int   $uid   The user ID
[ Top ]



validate_email_format [line 4690]

boolean validate_email_format( string $email)

Validates the format of an email address.



Tags:

return:  True when valid, false when invalid.


Parameters

string   $email   The string to check.
[ Top ]



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)
[ Top ]



Documentation generated on Wed, 27 May 2009 13:35:48 -0700 by phpDocumentor 1.4.1