[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/inc/ -> functions.php (summary)

MyBB 1.6 Copyright 2010 MyBB Group, All Rights Reserved Website: http://mybb.com License: http://mybb.com/about/license

File Size: 6549 lines (158 kb)
Included or required: 4 times
Referenced: 4 times
Includes or requires: 8 files
 inc/class_core.php
 inc/mailhandlers/php.php
 inc/class_plugins.php
 inc/settings.php
 inc/mailhandlers/smtp.php
 inc/class_moderation.php
 inc/class_mailhandler.php
 inc/class_datacache.php

Defines 140 functions

  output_page()
  add_shutdown()
  run_shutdown()
  send_mail_queue()
  parse_page()
  my_date()
  my_mail()
  generate_post_check()
  verify_post_check()
  get_parent_list()
  build_parent_list()
  cache_forums()
  get_child_list()
  error()
  inline_error()
  error_no_permission()
  redirect()
  multipage()
  fetch_page_url()
  user_permissions()
  usergroup_permissions()
  usergroup_displaygroup()
  forum_permissions()
  fetch_forum_permissions()
  check_forum_password()
  get_moderator_permissions()
  is_moderator()
  get_post_icons()
  my_setcookie()
  my_unsetcookie()
  my_get_array_cookie()
  my_set_array_cookie()
  my_unserialize()
  get_server_load()
  get_memory_usage()
  update_stats()
  update_forum_counters()
  update_forum_lastpost()
  update_thread_counters()
  update_thread_data()
  update_forum_count()
  update_thread_count()
  update_thread_attachment_count()
  delete_thread()
  delete_post()
  build_forum_jump()
  get_extension()
  random_str()
  format_name()
  build_mycode_inserter()
  build_clickable_smilies()
  build_prefixes()
  build_prefix_select()
  gzip_encode()
  log_moderator_action()
  get_reputation()
  get_colored_warning_level()
  get_ip()
  get_friendly_size()
  get_attachment_icon()
  get_unviewable_forums()
  fix_mktime()
  build_breadcrumb()
  add_breadcrumb()
  build_forum_breadcrumb()
  reset_breadcrumb()
  build_archive_link()
  debug_page()
  send_page_headers()
  mark_reports()
  nice_time()
  alt_trow()
  join_usergroup()
  leave_usergroup()
  get_current_location()
  build_theme_select()
  htmlspecialchars_uni()
  my_number_format()
  convert_through_utf8()
  my_wordwrap()
  get_weekday()
  get_bdays()
  format_bdays()
  get_age()
  update_first_post()
  my_strlen()
  my_substr()
  my_strtolower()
  my_strpos()
  my_strtoupper()
  unhtmlentities()
  unichr()
  get_event_poster()
  get_event_date()
  get_profile_link()
  get_announcement_link()
  build_profile_link()
  get_forum_link()
  get_thread_link()
  get_post_link()
  get_event_link()
  get_calendar_link()
  get_calendar_week_link()
  get_user()
  get_forum()
  get_thread()
  get_post()
  get_inactive_forums()
  login_attempt_check()
  validate_email_format()
  email_already_in_use()
  rebuildsettings()
  rebuild_settings()
  build_highlight_array()
  dec_to_utf8()
  is_banned_username()
  is_banned_email()
  is_banned_ip()
  build_timezone_select()
  fetch_remote_file()
  is_super_admin()
  escaped_explode()
  escaped_explode_escape()
  fetch_longipv4_range()
  fetch_ban_times()
  ban_date2timestamp()
  expire_warnings()
  my_chmod()
  my_rmdir_recursive()
  subforums_count()
  my_ip2long()
  my_long2ip()
  verify_files()
  signed()
  secure_seed_rng()
  my_rand()
  trim_blank_chrs()
  match_sequence()
  gd_version()
  utf8_handle_4byte_string()

Functions
Functions that are not part of a class:

output_page($contents)   X-Ref
Outputs a page directly to the browser, parsing anything which needs to be parsed.

param: string The contents of the page.

add_shutdown($name, $arguments=array()   X-Ref
Adds a function or class to the list of code to run on shutdown.

param: mixed The name of the function.
param: mixed An array of arguments for the function
return: boolean True if function exists, otherwise false.

run_shutdown()   X-Ref
Runs the shutdown items after the page has been sent to the browser.


send_mail_queue($count=10)   X-Ref
Sends a specified amount of messages from the mail queue

param: int The number of messages to send (Defaults to 10)

parse_page($contents)   X-Ref
Parses the contents of a page before outputting it.

param: string The contents of the page.
return: string The parsed page.

my_date($format, $stamp="", $offset="", $ty=1, $adodb=false)   X-Ref
Turn a unix timestamp in to a "friendly" date/time format for the user.

param: string A date format according to PHP's date structure.
param: int The unix timestamp the date should be generated for.
param: int The offset in hours that should be applied to times. (timezones)
param: int Whether or not to use today/yesterday formatting.
param: boolean Whether or not to use the adodb time class for < 1970 or > 2038 times
return: string The formatted timestamp.

my_mail($to, $subject, $message, $from="", $charset="", $headers="", $keep_alive=false, $format="text", $message_text="", $return_email="")   X-Ref
Sends an email using PHP's mail function, formatting it appropriately.

param: string Address the email should be addressed to.
param: string The subject of the email being sent.
param: string The message being sent.
param: string The from address of the email, if blank, the board name will be used.
param: string The chracter set being used to send this email.
param: boolean Do we wish to keep the connection to the mail server alive to send more than one message (SMTP only)
param: string The format of the email to be sent (text or html). text is default
param: string The text message of the email if being sent in html format, for email clients that don't support html
param: string The email address to return to. Defaults to admin return email address.

generate_post_check()   X-Ref
Generates a unique code for POST requests to prevent XSS/CSRF attacks

return: string The generated code

verify_post_check($code, $silent=false)   X-Ref
Verifies a POST check code is valid, if not shows an error (silently returns false on silent parameter)

param: string The incoming POST check code
param: boolean Silent mode or not (silent mode will not show the error to the user but returns false)

get_parent_list($fid)   X-Ref
Return a parent list for the specified forum.

param: int The forum id to get the parent list for.
return: string The comma-separated parent list.

build_parent_list($fid, $column="fid", $joiner="OR", $parentlist="")   X-Ref
Build a parent list of a specific forum, suitable for querying

param: int The forum ID
param: string The column name to add to the query
param: string The joiner for each forum for querying (OR | AND | etc)
param: string The parent list of the forum - if you have it
return: string The query string generated

cache_forums($force=false)   X-Ref
Load the forum cache in to memory

param: boolean True to force a reload of the cache

get_child_list($fid)   X-Ref
Generate an array of all child and descendant forums for a specific forum.

param: int The forum ID
param: return Array of descendants

error($error="", $title="")   X-Ref
Produce a friendly error message page

param: string The error message to be shown
param: string The title of the message shown in the title of the page and the error table

inline_error($errors, $title="")   X-Ref
Produce an error message for displaying inline on a page

param: array Array of errors to be shown
param: string The title of the error message
return: string The inline error HTML

error_no_permission()   X-Ref
Presents the user with a "no permission" page


redirect($url, $message="", $title="")   X-Ref
Redirect the user to a given URL with a given message

param: string The URL to redirect the user to
param: string The redirection message to be shown

multipage($count, $perpage, $page, $url, $breadcrumb=false)   X-Ref
Generate a listing of page - pagination

param: int The number of items
param: int The number of items to be shown per page
param: int The current page number
param: string The URL to have page numbers tacked on to (If {page} is specified, the value will be replaced with the page #)
return: string The generated pagination

fetch_page_url($url, $page)   X-Ref
Generate a page URL for use by the multipage function

param: string The URL being passed
param: int The page number

user_permissions($uid=0)   X-Ref
Fetch the permissions for a specific user

param: int The user ID
return: array Array of user permissions for the specified user

usergroup_permissions($gid=0)   X-Ref
Fetch the usergroup permissions for a specic group or series of groups combined

param: mixed A list of groups (Can be a single integer, or a list of groups separated by a comma)
return: array Array of permissions generated for the groups

usergroup_displaygroup($gid)   X-Ref
Fetch the display group properties for a specific display group

param: int The group ID to fetch the display properties for
return: array Array of display properties for the group

forum_permissions($fid=0, $uid=0, $gid=0)   X-Ref
Build the forum permissions for a specific forum, user or group

param: int The forum ID to build permissions for (0 builds for all forums)
param: int The user to build the permissions for (0 will select the uid automatically)
param: int The group of the user to build permissions for (0 will fetch it)
return: array Forum permissions for the specific forum or forums

fetch_forum_permissions($fid, $gid, $groupperms)   X-Ref
Fetches the permissions for a specific forum/group applying the inheritance scheme.
Called by forum_permissions()

param: int The forum ID
param: string A comma separated list of usergroups
param: array Group permissions
return: array Permissions for this forum

check_forum_password($fid, $pid=0)   X-Ref
Check the password given on a certain forum for validity

param: int The forum ID
param: boolean The Parent ID

get_moderator_permissions($fid, $uid="0", $parentslist="")   X-Ref
Return the permissions for a moderator in a specific forum

param: fid The forum ID
param: uid The user ID to fetch permissions for (0 assumes current logged in user)
param: string The parent list for the forum (if blank, will be fetched)
return: array Array of moderator permissions for the specific forum

is_moderator($fid="0", $action="", $uid="0")   X-Ref
Checks if a moderator has permissions to perform an action in a specific forum

param: int The forum ID (0 assumes global)
param: string The action tyring to be performed. (blank assumes any action at all)
param: int The user ID (0 assumes current user)
return: bool Returns true if the user has permission, false if they do not

get_post_icons()   X-Ref
Generate a list of the posticons.

return: string The template of posticons.

my_setcookie($name, $value="", $expires="", $httponly=false)   X-Ref
MyBB setcookie() wrapper.

param: string The cookie identifier.
param: string The cookie value.
param: int The timestamp of the expiry date.
param: boolean True if setting a HttpOnly cookie (supported by IE, Opera 9, Konqueror)

my_unsetcookie($name)   X-Ref
Unset a cookie set by MyBB.

param: string The cookie identifier.

my_get_array_cookie($name, $id)   X-Ref
Get the contents from a serialised cookie array.

param: string The cookie identifier.
param: int The cookie content id.
return: array|boolean The cookie id's content array or false when non-existent.

my_set_array_cookie($name, $id, $value, $expires="")   X-Ref
Set a serialised cookie array.

param: string The cookie identifier.
param: int The cookie content id.
param: string The value to set the cookie to.

my_unserialize($data)   X-Ref
Verifies that data passed is an array

param: array Data to unserialize
return: array Unserialized data array

get_server_load()   X-Ref
Returns the serverload of the system.

return: int The serverload of the system.

get_memory_usage()   X-Ref
Returns the amount of memory allocated to the script.

return: int The amount of memory allocated to the script.

update_stats($changes=array()   X-Ref
Updates the forum statistics with specific values (or addition/subtraction of the previous value)

param: array Array of items being updated (numthreads,numposts,numusers)

update_forum_counters($fid, $changes=array()   X-Ref
Updates the forum counters with a specific value (or addition/subtraction of the previous value)

param: int The forum ID
param: array Array of items being updated (threads, posts, unapprovedthreads, unapprovedposts) and their value (ex, 1, +1, -1)

update_forum_lastpost($fid)   X-Ref
Update the last post information for a specific forum

param: int The forum ID

update_thread_counters($tid, $changes=array()   X-Ref
Updates the thread counters with a specific value (or addition/subtraction of the previous value)

param: int The thread ID
param: array Array of items being updated (replies, unapprovedposts, attachmentcount) and their value (ex, 1, +1, -1)

update_thread_data($tid)   X-Ref
Update the first post and lastpost data for a specific thread

param: int The thread ID

update_forum_count($fid)   X-Ref
No description

update_thread_count($tid)   X-Ref
No description

update_thread_attachment_count($tid)   X-Ref
No description

delete_thread($tid)   X-Ref
Deletes a thread from the database

param: int The thread ID

delete_post($pid, $tid="")   X-Ref
Deletes a post from the database

param: int The thread ID

build_forum_jump($pid="0", $selitem="", $addselect="1", $depth="", $showextras="1", $showall=false, $permissions="", $name="fid")   X-Ref
Builds a forum jump menu

param: int The parent forum to start with
param: int The selected item ID
param: int If we need to add select boxes to this cal or not
param: int The current depth of forums we're at
param: int Whether or not to show extra items such as User CP, Forum home
param: boolean Ignore the showinjump setting and show all forums (for moderation pages)
param: array Array of permissions
param: string The name of the forum jump
return: string Forum jump items

get_extension($file)   X-Ref
Returns the extension of a file.

param: string The filename.
return: string The extension of the file.

random_str($length="8")   X-Ref
Generates a random string.

param: int The length of the string to generate.
return: string The random string.

format_name($username, $usergroup, $displaygroup="")   X-Ref
Formats a username based on their display group

param: string The username
param: int The usergroup for the user (if not specified, will be fetched)
param: int The display group for the user (if not specified, will be fetched)
return: string The formatted username

build_mycode_inserter($bind="message")   X-Ref
Build the javascript based MyCode inserter

return: string The MyCode inserter

build_clickable_smilies()   X-Ref
Build the javascript clickable smilie inserter

return: string The clickable smilies list

build_prefixes($pid=0)   X-Ref
Builds thread prefixes and returns a selected prefix (or all)

param: int The prefix ID (0 to return all)
return: array The thread prefix's values (or all thread prefixes)

build_prefix_select($fid, $selected_pid=0, $multiple=0)   X-Ref
Build the thread prefix selection menu

param: mixed The forum ID (integer ID or string all)
param: mixed The selected prefix ID (integer ID or string any)
return: string The thread prefix selection menu

gzip_encode($contents, $level=1)   X-Ref
Gzip encodes text to a specified level

param: string The string to encode
param: int The level (1-9) to encode at
return: string The encoded string

log_moderator_action($data, $action="")   X-Ref
Log the actions of a moderator.

param: array The data of the moderator's action.
param: string The message to enter for the action the moderator performed.

get_reputation($reputation, $uid=0)   X-Ref
Get the formatted reputation for a user.

param: int The reputation value
param: int The user ID (if not specified, the generated reputation will not be a link)
return: string The formatted repuation

get_colored_warning_level($level)   X-Ref
Fetch a color coded version of a warning level (based on it's percentage)

param: int The warning level (percentage of 100)
return: string Formatted warning level

get_ip()   X-Ref
Fetch the IP address of the current user.

return: string The IP address.

get_friendly_size($size)   X-Ref
Fetch the friendly size (GB, MB, KB, B) for a specified file size.

param: int The size in bytes
return: string The friendly file size

get_attachment_icon($ext)   X-Ref
Get the attachment icon for a specific file extension

param: string The file extension
return: string The attachment icon

get_unviewable_forums($only_readable_threads=false)   X-Ref
Get a list of the unviewable forums for the current user

param: boolean Set to true to only fetch those forums for which users can actually read a thread in.
return: string Comma separated values list of the forum IDs which the user cannot view

fix_mktime($format, $year)   X-Ref
Fixes mktime for dates earlier than 1970

param: string The date format to use
param: int The year of the date
return: string The correct date format

build_breadcrumb()   X-Ref
Build the breadcrumb navigation trail from the specified items

return: The formatted breadcrumb navigation trail

add_breadcrumb($name, $url="")   X-Ref
Add a breadcrumb menu item to the list.

param: string The name of the item to add
param: string The URL of the item to add

build_forum_breadcrumb($fid, $multipage=array()   X-Ref
Build the forum breadcrumb nagiation (the navigation to a specific forum including all parent forums)

param: int The forum ID to build the navigation for
param: array The multipage drop down array of information

reset_breadcrumb()   X-Ref
Resets the breadcrumb navigation to the first item, and clears the rest


build_archive_link($type, $id="")   X-Ref
Builds a URL to an archive mode page

param: string The type of page (thread|announcement|forum)
param: int The ID of the item
return: string The URL

debug_page()   X-Ref
Prints a debug information page


send_page_headers()   X-Ref
Outputs the correct page headers.


mark_reports($id, $type="post")   X-Ref
Mark specific reported posts of a certain type as dealt with

param: mixed An array or int of the ID numbers you're marking as dealt with
param: string The type of item the above IDs are for - post, posts, thread, threads, forum, all

nice_time($stamp, $options=array()   X-Ref
Fetch a friendly x days, y months etc date stamp from a timestamp

param: int The timestamp
param: array Array of options
return: string The friendly formatted timestamp

alt_trow($reset=0)   X-Ref
Select an alternating row colour based on the previous call to this function

param: int 1 to reset the row to trow1.
return: string trow1 or trow2 depending on the previous call

join_usergroup($uid, $joingroup)   X-Ref
Add a user to a specific additional user group.

param: int The user ID
param: int The user group ID to join

leave_usergroup($uid, $leavegroup)   X-Ref
Remove a user from a specific additional user group

param: int The user ID
param: int The user group ID

get_current_location($fields=false, $ignore=array()   X-Ref
Get the current location taking in to account different web serves and systems

param: boolean True to return as "hidden" fields
param: array Array of fields to ignore if first argument is true
return: string The current URL being accessed

build_theme_select($name, $selected="", $tid=0, $depth="", $usergroup_override=false)   X-Ref
Build a theme selection menu

param: string The name of the menu
param: int The ID of the selected theme
param: int The ID of the parent theme to select from
param: int The current selection depth
param: boolean Whether or not to override usergroup permissions (true to override)
return: string The theme selection list

htmlspecialchars_uni($message)   X-Ref
Custom function for htmlspecialchars which takes in to account unicode

param: string The string to format
return: string The string with htmlspecialchars applied

my_number_format($number)   X-Ref
Custom function for formatting numbers.

param: int The number to format.
return: int The formatted number.

convert_through_utf8($str, $to=true)   X-Ref
No description

my_wordwrap($message)   X-Ref
Replacement function for PHP's wordwrap(). This version does not break up HTML tags, URLs or unicode references.

param: string The string to be word wrapped
return: string The word wraped string

get_weekday($month, $day, $year)   X-Ref
Workaround for date limitation in PHP to establish the day of a birthday (Provided by meme)

param: int The month of the birthday
param: int The day of the birthday
param: int The year of the bithday
return: int The numeric day of the week for the birthday

get_bdays($in)   X-Ref
Workaround for date limitation in PHP to establish the day of a birthday (Provided by meme)

param: int The year.
return: array The number of days in each month of that year

format_bdays($display, $bm, $bd, $by, $wd)   X-Ref
Formats a birthday appropriately

param: string The PHP date format string
param: int The month of the birthday
param: int The day of the birthday
param: int The year of the birthday
param: int The weekday of the birthday
return: string The formatted birthday

get_age($birthday)   X-Ref
Returns the age of a user with specified birthday.

param: string The birthday of a user.
return: float The age of a user with that birthday.

update_first_post($tid)   X-Ref
Updates the first posts in a thread.

param: int The thread id for which to update the first post id.

my_strlen($string)   X-Ref
Checks for the length of a string, mb strings accounted for

param: string The string to check the length of.
return: int The length of the string.

my_substr($string, $start, $length="", $handle_entities = false)   X-Ref
Cuts a string at a specified point, mb strings accounted for

param: string The string to cut.
param: int Where to cut
param: int (optional) How much to cut
param: bool (optional) Properly handle HTML entities?
return: int The cut part of the string.

my_strtolower($string)   X-Ref
lowers the case of a string, mb strings accounted for

param: string The string to lower.
return: int The lowered string.

my_strpos($haystack, $needle, $offset=0)   X-Ref
Finds a needle in a haystack and returns it position, mb strings accounted for

param: string String to look in (haystack)
param: string What to look for (needle)
param: int (optional) How much to offset
return: int false on needle not found, integer position if found

my_strtoupper($string)   X-Ref
ups the case of a string, mb strings accounted for

param: string The string to up.
return: int The uped string.

unhtmlentities($string)   X-Ref
Returns any html entities to their original character

param: string The string to un-htmlentitize.
return: int The un-htmlentitied' string.

unichr($c)   X-Ref
Returns any ascii to it's character (utf-8 safe).

param: string The ascii to characterize.
return: int The characterized ascii.

get_event_poster($event)   X-Ref
Get the event poster.

param: array The event data array.
return: string The link to the event poster.

get_event_date($event)   X-Ref
Get the event date.

param: array The event data array.
return: string The event date.

get_profile_link($uid=0)   X-Ref
Get the profile link.

param: int The user id of the profile.
return: string The url to the profile.

get_announcement_link($aid=0)   X-Ref
Get the announcement link.

param: int The announement id of the announcement.
return: string The url to the announcement.

build_profile_link($username="", $uid=0, $target="", $onclick="")   X-Ref
Build the profile link.

param: string The Username of the profile.
param: int The user id of the profile.
param: string The target frame
param: string Any onclick javascript.
return: string The complete profile link.

get_forum_link($fid, $page=0)   X-Ref
Build the forum link.

param: int The forum id of the forum.
param: int (Optional) The page number of the forum.
return: string The url to the forum.

get_thread_link($tid, $page=0, $action='')   X-Ref
Build the thread link.

param: int The thread id of the thread.
param: int (Optional) The page number of the thread.
param: string (Optional) The action we're performing (ex, lastpost, newpost, etc)
return: string The url to the thread.

get_post_link($pid, $tid=0)   X-Ref
Build the post link.

param: int The post ID of the post
param: int The thread id of the post.

get_event_link($eid)   X-Ref
Build the event link.

param: int The event ID of the event
return: string The URL of the event

get_calendar_link($calendar, $year=0, $month=0, $day=0)   X-Ref
Build the link to a specified date on the calendar

param: int The ID of the calendar
param: int The year
param: int The month
param: int The day (optional)
return: string The URL of the calendar

get_calendar_week_link($calendar, $week)   X-Ref
Build the link to a specified week on the calendar

param: int The ID of the calendar
param: int The year
param: int The week
return: string The URL of the calendar

get_user($uid)   X-Ref
Get the user data of a user id.

param: int The user id of the user.
return: array The users data

get_forum($fid, $active_override=0)   X-Ref
Get the forum of a specific forum id.

param: int The forum id of the forum.
param: int (Optional) If set to 1, will override the active forum status
return: array The database row of a forum.

get_thread($tid, $recache = false)   X-Ref
Get the thread of a thread id.

param: int The thread id of the thread.
param: boolean Whether or not to recache the thread.
return: string The database row of the thread.

get_post($pid)   X-Ref
Get the post of a post id.

param: int The post id of the post.
return: string The database row of the post.

get_inactive_forums()   X-Ref
Get inactivate forums.

return: string The comma separated values of the inactivate forum.

login_attempt_check($fatal = true)   X-Ref
Checks to make sure a user has not tried to login more times than permitted
Will stop execution with call to error() unless

param: bool (Optional) The function will stop execution if it finds an error with the login. Default is True
return: bool Number of logins when success, false if failed.

validate_email_format($email)   X-Ref
Validates the format of an email address.

param: string The string to check.
return: boolean True when valid, false when invalid.

email_already_in_use($email, $uid="")   X-Ref
Checks to see if the email is already in use by another

param: string The email to check.
param: string User ID of the user (updating only)
return: boolean True when in use, false when not.

rebuildsettings()   X-Ref
No description

rebuild_settings()   X-Ref
Rebuilds settings.php


build_highlight_array($terms)   X-Ref
Build a PREG compatible array of search highlight terms to replace in posts.

param: string Incoming terms to highlight
return: array PREG compatible array of terms

dec_to_utf8($src)   X-Ref
Converts a decimal reference of a character to its UTF-8 equivalent
(Code by Anne van Kesteren, http://annevankesteren.nl/2005/05/character-references)

param: string Decimal value of a character reference

is_banned_username($username, $update_lastuse=false)   X-Ref
Checks if a username has been disallowed for registration/use.

param: string The username
param: boolean True if the 'last used' dateline should be updated if a match is found.
return: boolean True if banned, false if not banned

is_banned_email($email, $update_lastuse=false)   X-Ref
Check if a specific email address has been banned.

param: string The email address.
param: boolean True if the 'last used' dateline should be updated if a match is found.
return: boolean True if banned, false if not banned

is_banned_ip($ip_address, $update_lastuse=false)   X-Ref
Checks if a specific IP address has been banned.

param: string The IP address.
param: boolean True if the 'last used' dateline should be updated if a match is found.
return: boolean True if banned, false if not banned.

build_timezone_select($name, $selected=0, $short=false)   X-Ref
Build a time zone selection list.

param: string The name of the select
param: int The selected time zone (defaults to GMT)
param: boolean True to generate a "short" list with just timezone and current time

fetch_remote_file($url, $post_data=array()   X-Ref
Fetch the contents of a remote fle.

param: string The URL of the remote file
return: string The remote file contents.

is_super_admin($uid)   X-Ref
Checks if a particular user is a super administrator.

param: int The user ID to check against the list of super admins
return: boolean True if a super admin, false if not

escaped_explode($delimeter, $string, $escape="")   X-Ref
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

param: string The delimeter to split by
param: string The string to split
param: string The escape character or string if we have one.
return: array Array of split string

escaped_explode_escape($string)   X-Ref
No description

fetch_longipv4_range($ip)   X-Ref
Fetch an IPv4 long formatted range for searching IPv4 IP addresses.

param: string The IP address to convert to a range based LONG

fetch_ban_times()   X-Ref
Fetch a list of ban times for a user account.

return: array Array of ban times

ban_date2timestamp($date, $stamp=0)   X-Ref
Format a ban length in to a UNIX timestamp.

param: string The ban length string
param: int The optional UNIX timestamp, if 0, current time is used.
return: int The UNIX timestamp when the ban will be lifted

expire_warnings()   X-Ref
Expire old warnings in the database.


my_chmod($file, $mode)   X-Ref
Custom chmod function to fix problems with hosts who's server configurations screw up umasks

param: string The file to chmod
param: string The mode to chmod(i.e. 0666)

my_rmdir_recursive($path, $ignore=array()   X-Ref
Custom rmdir function to loop through an entire directory and delete all files/folders within

param: string The path to the directory
param: array Any files you wish to ignore (optional)

subforums_count($array)   X-Ref
Counts the number of subforums in a array([pid][disporder][fid]) starting from the pid

param: array The array of forums
return: integer The number of sub forums

my_ip2long($ip)   X-Ref
Fix for PHP's ip2long to guarantee a 32-bit signed integer value is produced (this is aimed
at 64-bit versions of PHP)

param: string The IP to convert
return: integer IP in 32-bit signed format

my_long2ip($long)   X-Ref
As above, fix for PHP's long2ip on 64-bit versions

param: integer The IP to convert (will accept 64-bit IPs as well)
return: string IP in IPv4 format

verify_files($path=MYBB_ROOT, $count=0)   X-Ref
Processes a checksum list on MyBB files and returns a result set

param: array The array of checksums and their corresponding files
return: array The bad files

signed($int)   X-Ref
Returns a signed value equal to an integer

param: int The integer
return: string The signed equivalent

secure_seed_rng($count=8)   X-Ref
Returns a securely generated seed for PHP's RNG (Random Number Generator)

param: int Length of the seed bytes (8 is default. Provides good cryptographic variance)
return: int An integer equivalent of a secure hexadecimal seed

my_rand($min=null, $max=null, $force_seed=false)   X-Ref
Wrapper function for mt_rand. Automatically seeds using a secure seed once.

param: int Optional lowest value to be returned (default: 0)
param: int Optional highest value to be returned (default: mt_getrandmax())
param: boolean True forces it to reseed the RNG first
return: int An integer equivalent of a secure hexadecimal seed

trim_blank_chrs($string, $charlist=false)   X-Ref
More robust version of PHP's trim() function. It includes a list of UTF-16 blank characters
from http://kb.mozillazine.org/Network.IDN.blacklist_chars

param: string The string to trim from
param: string Optional. The stripped characters can also be specified using the charlist parameter
return: string The trimmed string

match_sequence($string, $array, $i=0, $n=0)   X-Ref
No description

gd_version()   X-Ref
Obtain the version of GD installed.

return: float Version of GD

utf8_handle_4byte_string($input, $return=true)   X-Ref
Handles 4 byte UTF-8 characters.

This can be used to either reject strings which contain 4 byte UTF-8
characters, or replace them with question marks. This is limited to UTF-8
collated databases using MySQL.

Original: http://www.avidheap.org/2013/a-quick-way-to-normalize-a-utf8-string-when-your-mysql-database-is-not-utf8mb4

param: string The string to be checked.
param: bool If false don't return the string, only the boolean result.
return: mixed Return a string if the second parameter is true, boolean otherwise.



Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1