addon_installed (line 365)
Check to see if an addon is installed.
boolean
addon_installed
(ID_TEXT $addon)
-
ID_TEXT
$addon: The module name
array_peek (line 603)
Peek at a stack element.
mixed
array_peek
(array $array, [integer $depth_down = 1])
-
array
$array: The stack to peek in
-
integer
$depth_down: The depth into the stack we are peaking
brand_base_url (line 1189)
Find the base URL for documentation.
URLPATH
brand_base_url
()
browser_matches (line 1203)
See's if the current browser matches some special property code. Assumes users are keeping up on newish browsers (except for IE users, who are 6+)
boolean
browser_matches
(string $code)
-
string
$code: The property code
collapse_1d_complexity (line 740)
Take a list of maps of just one element, and make it into a single map
array
collapse_1d_complexity
(string $key, array $list)
-
string
$key: The key of our maps that reside in our map
-
array
$list: The map of maps
collapse_2d_complexity (line 722)
Take a list of maps of just two elements, and make it into a single map
array
collapse_2d_complexity
(string $key, string $value, array $list)
-
string
$key: The key key of our maps that reside in our map
-
string
$value: The value key of our maps that reside in our map
-
array
$list: The map of maps
compare_ip_address (line 903)
Compare two IP addresses for potential correlation. Not as simple as equality due to '*' syntax.
boolean
compare_ip_address
(string $wild, IP $full)
-
string
$wild: The general IP address that is potentially wildcarded
-
IP
$full: The specific IP address we are checking
compare_ip_address_ip4 (line 921)
Compare two IP addresses for potential correlation. Not as simple as equality due to '*' syntax. IP4-only variant
boolean
compare_ip_address_ip4
(string $wild, array $full_parts)
-
string
$wild: The general IP address that is potentially wildcarded
-
array
$full_parts: The exploded parts of the specific IP address we are checking
compare_ip_address_ip6 (line 938)
Compare two IP addresses for potential correlation. Not as simple as equality due to '*' syntax. IP6-only variant
boolean
compare_ip_address_ip6
(string $wild, array $full_parts)
-
string
$wild: The general IP address that is potentially wildcarded
-
array
$full_parts: The exploded parts of the specific IP address we are checking
cron_installed (line 866)
Find if Cron is installed
boolean
cron_installed
()
escape_html (line 1160)
Get the specified string, but with all characters escaped.
string
escape_html
(mixed $string)
-
mixed
$string: The input string
find_template_place (line 88)
Search for a template.
?array
find_template_place
(ID_TEXT $codename, ?LANGUAGE_NAME $lang, ID_TEXT $theme, string $suffix, string $type)
-
ID_TEXT
$codename: The codename of the template being loaded
-
?LANGUAGE_NAME
$lang: The language to load the template in (templates can embed language references) (NULL: users own language)
-
ID_TEXT
$theme: The theme to use
-
string
$suffix: File type suffix of template file (e.g. .tpl)
-
string
$type: Subdirectory type to look in
flatten_slashed_array (line 1455)
Turn an array into a humanely readable string.
string
flatten_slashed_array
(array $array)
-
array
$array: Array to convert
float_format (line 404)
Format the given float number as a nicely formatted string.
string
float_format
(float $val, [integer $frac_digits = 2])
-
float
$val: The value to format
-
integer
$frac_digits: The number of fractional digits
float_to_raw_string (line 381)
Convert a float to a "technical string representation of a float".
string
float_to_raw_string
(float $num, [integer $dec_keep = 0])
-
float
$num: The number
-
integer
$dec_keep: The number of decimals to keep
fractional_edit (line 322)
Find whether a fractional edit is underway.
boolean
fractional_edit
()
geolocate_ip (line 879)
Find the country an IP address long is located in
?string
geolocate_ip
([?IP $ip = NULL])
-
?IP
$ip: The IP to geolocate (NULL: current user's IP)
get_bot_type (line 1398)
Get the name of a webcrawler bot, or NULL if no bot detected
?string
get_bot_type
()
get_browser_string (line 833)
Get a string of the users web browser
string
get_browser_string
()
get_flagrant (line 953)
Get the XHTML for the flagrant text message.
tempcode
get_flagrant
()
get_ip_address (line 782)
Attempt to get the IP address of the current user
IP
get_ip_address
([integer $amount = 4])
-
integer
$amount: The number of groups to include in the IP address (rest will be replaced with *'s). For IP6, this is doubled.
get_loaded_tags (line 1606)
Get Tempcode for tags, based on loaded up from SEO keywords (seo_meta_load_for).
tempcode
get_loaded_tags
([?ID_TEXT $limit_to = NULL])
-
?ID_TEXT
$limit_to: The search code for this tag content (e.g. downloads) (NULL: there is none)
get_members_viewing (line 1067)
Get a map of members viewing the specified ocPortal location.
?array
get_members_viewing
([?ID_TEXT $page = NULL], [?ID_TEXT $type = NULL], [?SHORT_TEXT $id = NULL], [boolean $forum_layer = false])
-
?ID_TEXT
$page: The page they need to be viewing (NULL: don't care)
-
?ID_TEXT
$type: The page-type they need to be viewing (NULL: don't care)
-
?SHORT_TEXT
$id: The type-id they need to be viewing (NULL: don't care)
-
boolean
$forum_layer: Whether this has to be done over the forum driver (multi site network)
get_num_users_peak (line 1148)
Get the largest amount of users ever to be on the site at the same time.
integer
get_num_users_peak
()
get_num_users_site (line 1103)
Get the number of users on the site in the last 5 minutes. The function also maintains the statistic via the sessions table.
integer
get_num_users_site
()
get_os_string (line 843)
Get the user's operating system
string
get_os_string
()
get_page_name (line 662)
Get the name of the current page
ID_TEXT
get_page_name
()
get_rand_password (line 1544)
Get a randomised password.
string
get_rand_password
()
get_zone_default_page (line 1646)
Get the default page for a zone.
ID_TEXT
get_zone_default_page
(ID_TEXT $zone_name)
-
ID_TEXT
$zone_name: Zone name
globalise (line 525)
Turn the tempcode lump into a standalone page (except for header/footer which is assumed already handled elsewhere).
tempcode
globalise
(tempcode $middle, [?mixed $message = NULL], [string $type = ''], [boolean $include_header_and_footer = false])
-
tempcode
$middle: The tempcode to put into a nice frame
-
?mixed
$message: 'Additional' message (NULL: none)
-
string
$type: The type of special message
-
boolean
$include_header_and_footer: Whether to automatically include the header and footer templates
has_cookies (line 1503)
Determine whether the user's browser supports cookies or not.
Unfortunately this function will only return true once a user has been to the site more than once... ocPortal will set a cookie, and if it perseveres, that indicates cookies work.
boolean
has_cookies
()
has_js (line 1531)
Determine whether the user's browser supports JavaScript or not.
Unfortunately this function will only return true once a user has been to the site more than once... Javascript will set a cookie, indicating it works.
boolean
has_js
()
has_no_forum (line 352)
Find whether we have no forum on this website.
boolean
has_no_forum
()
init__support (line 28)
Standard code module initialisation function.
void
init__support
()
integer_format (line 418)
Format the given integer number as a nicely formatted string.
string
integer_format
(integer $val)
-
integer
$val: The value to format
intelligent_write_error (line 284)
Discern the cause of a file-write error, and show an appropriate error message.
void
intelligent_write_error
(PATH $path)
-
PATH
$path: File path that could not be written
intelligent_write_error_inline (line 306)
Discern the cause of a file-write error, and return an appropriate error message.
tempcode
intelligent_write_error_inline
(PATH $path)
-
PATH
$path: File path that could not be written
is_mobile (line 1313)
Look at the user's browser, and decide if they are viewing on a mobile device or not.
boolean
is_mobile
([?string $user_agent = NULL])
-
?string
$user_agent: The user agent (NULL: get from environment, current user's browser)
is_wide (line 158)
Find whether panels will be shown.
BINARY
is_wide
()
is_wide_high (line 145)
Find whether panels and the header/footer areas won't be shown.
BINARY
is_wide_high
()
is_writable_wrap (line 246)
Find whether a file/directory is writeable. This function is designed to get past that the PHP is_writable function does not work properly on Windows.
boolean
is_writable_wrap
(PATH $path)
-
PATH
$path: The file path
list_to_map (line 696)
Take a list of maps, and make one of the values of each array the index of a map to the map
array
list_to_map
(string $map_value, array $list)
-
string
$map_value: The key key of our maps that reside in our map
-
array
$list: The list of maps
log_it (line 993)
Log an action
void
log_it
(ID_TEXT $type, [?SHORT_TEXT $a = NULL], [?SHORT_TEXT $b = NULL])
-
ID_TEXT
$type: The type of activity just carried out (a lang string)
-
?SHORT_TEXT
$a: The most important parameter of the activity (e.g. id) (NULL: none)
-
?SHORT_TEXT
$b: A secondary (perhaps, human readable) parameter of the activity (e.g. caption) (NULL: none)
make_xhtml_strict (line 579)
Take a Tempcode object and run some hackerish code to make it XHTML-strict.
object Tempcode
make_xhtml_strict
(object Tempcode $global)
-
object Tempcode
$global: object
match_key_match (line 617)
See if the current URL matches the given ocPortal match tags.
boolean
match_key_match
(string $match_tag, [boolean $support_post = false])
-
string
$match_tag: Match tags
-
boolean
$support_post: Check against POSTed data too
member_tracking_update (line 1037)
Update the member tracker for the currently viewing user.
void
member_tracking_update
()
mixed (line 1554)
Assign this to explicitly declare that a variable may be of mixed type, and initialise to NULL.
?mixed
mixed
()
multi_sort (line 432)
Helper function to sort a list of maps by the value at $key in each of those maps.
integer
multi_sort
(array $a, array $b)
-
array
$a: The first to compare
-
array
$b: The second to compare
ocf_require_all_forum_stuff (line 502)
Require all code relating to the OCF forum
void
ocf_require_all_forum_stuff
()
ocp_mb_strlen (line 173)
Get string length, with utf-8 awareness where possible/required.
integer
ocp_mb_strlen
(string $in)
-
string
$in: The string to get the length of.
ocp_mb_strtolower (line 216)
Make a string lowercase, with utf-8 awareness where possible/required.
string
ocp_mb_strtolower
(string $in)
ocp_mb_strtoupper (line 231)
Make a string uppercase, with utf-8 awareness where possible/required.
string
ocp_mb_strtoupper
(string $in)
ocp_mb_substr (line 190)
Return part of a string, with utf-8 awareness where possible/required.
~string
ocp_mb_substr
(string $in, integer $from, [?integer $amount = NULL], [boolean $force = false])
-
string
$in: The subject.
-
integer
$from: The start position.
-
?integer
$amount: The length to extract (NULL: all remaining).
-
boolean
$force: Whether to force unicode as on.
ocp_srv (line 757)
Get server environment variables.
string
ocp_srv
(string $key)
-
string
$key: The variable name
ocp_tempnam (line 558)
Create file with unique file name, but works around compatibility issues between servers.
~string
ocp_tempnam
(string $prefix)
-
string
$prefix: The prefix of the temporary file name.
php_addslashes (line 1005)
Escape a string to fit within PHP double quotes.
string
php_addslashes
(string $in)
read_multi_code (line 1440)
Read a multi code from a named parameter stub.
SHORT_TEXT
read_multi_code
(ID_TEXT $param)
-
ID_TEXT
$param: The parameter stub (stub of a series of POST parameters, made by ocf_get_forum_multi_code_field's field or similar).
remove_duplicate_rows (line 1019)
Remove any duplication inside the list of rows (each row being a map). Duplication is defined by rows with correspinding IDs.
array
remove_duplicate_rows
(array $rows, [string $id_field = 'id'])
-
array
$rows: The rows to remove duplication of
-
string
$id_field: The ID field
seo_meta_get_for (line 1566)
Get meta information for specified resource
array
seo_meta_get_for
(ID_TEXT $type, ID_TEXT $id)
-
ID_TEXT
$type: The type of resource (e.g. download)
-
ID_TEXT
$id: The ID of the resource
seo_meta_load_for (line 1591)
Load the specified resource's meta information into the system for use on this page.
Also, if the title is specified then this is used for the page title.
void
seo_meta_load_for
(ID_TEXT $type, ID_TEXT $id, [?string $title = NULL])
-
ID_TEXT
$type: The type of resource (e.g. download)
-
ID_TEXT
$id: The ID of the resource
-
?string
$title: The page-specific title to use, in Comcode or plain-text format with possible HTML entities included [Comcode will later be stripped] (NULL: none)
strlen_sort (line 334)
Helper function for usort to sort a list by string length.
integer
strlen_sort
(string $a, string $b)
-
string
$a: The first string to compare
-
string
$b: The second string to compare
wordfilter_text (line 1475)
Get a word-filtered version of the specified text.
string
wordfilter_text
(string $text)
-
string
$text: Text to filter
xmlentities (line 1490)
XML escape the input string.
string
xmlentities
(string $string, [integer $quote_style = ENT_COMPAT])
-
string
$string: Input string
-
integer
$quote_style: Quote style