Functions


Functions Summary
string

cot_alphaonly(string text)

Strips everything but alphanumeric, hyphens and underscores

mixed

cot_auth(string area, string option, string mask)

Returns specific access permissions

array

cot_auth_build(int userid, int maingrp)

Builds Access Control List (ACL) for a specific user

void

cot_autoload(string class)

Generic autoloader function to be used with spl_autoload_register

bool

cot_block(bool allowed)

Block user if he is not allowed to access the page

bool

cot_blockguests()

Block guests from viewing the page

string

cot_breadcrumbs(array crumbs, bool home, bool nolast, bool plain, string inrc, string separator)

Renders breadcrumbs string from array of path crumbs

int

cot_build_age(int birthdate)

Calculates age out of date of birth.

string

cot_build_country(string flag)

Returns country text button

string

cot_build_email(string email, bool hide)

Returns user email link

string

cot_build_filesize(float bytes, int decimals, mixed round, bool binary, string smallestunit)

Generate human-readable filesize.

string

cot_build_flag(string flag)

Returns country flag button

string

cot_build_friendlynumber(float number, array units, int levels, int decimals, mixed round, string smallestunit)

Generic function for generating a human-readable number with localized units.

string

cot_build_group(int grpid, bool title)

Returns group link (button)

string

cot_build_groupicon(string src)

Returns user group icon

string

cot_build_ipsearch(string ip)

Returns IP Search link

string

cot_build_number(float number, int decimals, mixed round)

Wrapper for number_format() using locale number formatting and optional rounding.

string

cot_build_oddeven(int number)

Odd/even class choser for row

unknown

cot_build_stars(int level)

Returns stars image for user level

string

cot_build_timeago(int time, int recently)

Returns readable time difference or 'Just now'.

string

cot_build_timegap(int t1, int t2, int levels, int decimals, mixed round, string smallestunit)

Returns time gap between two timestamps

string

cot_build_timezone(float offset, bool withgmt, bool short)

Returns timezone offset formatted according to ISO 8601

unknown

cot_build_url(string text, int maxlen)

Returns link for URL

string

cot_build_user(int id, string user, mixed extra_attrs)

Returns link to user profile

string

cot_captcha_generate(string use_captcha)

Generates a captcha

array

cot_captcha_list()

Returns the list of currently installed captchas

boolean

cot_captcha_validate(string value)

Valides a captcha value

void

cot_check(bool condition, string message, string src)

If condition is true, triggers an error with given message and source

bool

cot_check_email(string res)

Checks the email

bool

cot_check_messages(string src, string class)

Checks if there are messages to display

static bool

cot_check_xg(bool redirect)

Checks GET anti-XSS parameter

bool

cot_check_xp()

Checks POST anti-XSS parameter

void

cot_clear_messages(string src, string class)

Clears error and other messages after they have bin displayed

string

cot_confirm_url(string target_url, string ext_name, string msg_code, str msg_key)

Generates an URL used to confirm an action performed by target URL

string

cot_cutstring(string res, int l)

Truncates a string

string

cot_date(string format, int timestamp, bool usertimezone)

Localized version of PHP date()

int

cot_date2stamp(string date, string format)

Converts date into UNIX timestamp.

string

cot_date2strftime(string format)

Convert a date format to a strftime format.

static string

cot_declension(int digit, mixed expr, bool onlyword, bool canfrac)

Makes correct plural forms of words

bool

cot_die(bool cond, bool notfound)

Terminates script execution and performs redirect

void

cot_die_message(integer code, boolean header, string message_title, string message_body, string redirect)

Terminates script execution and displays message page

void

cot_diefatal(string text, string title)

Terminates script execution with fatal error

static void

cot_display_messages(XTemplate tpl, string block)

Renders different messages on page

void

cot_error(string message, string src)

Records an error message to be displayed on results page

bool

cot_error_found()

Checks if any errors have been previously detected during current script execution

array

cot_generate_usertags(mixed user_data, string tag_prefix, string emptyname, bool allgroups, bool cacheitem)

Returns all user tags for XTemplate

string

cot_get_caller()

Returns name part of the caller file.

array

cot_get_editors()

Returns the list of available rich text editors

array

cot_get_messages(string src, string class)

Returns an array of messages for a specific source and/or class

array

cot_get_parsers()

Returns the list of available markup parsers

int

cot_get_plural(int plural, string lang, bool is_frac)

Used in cot_declension to get rules for concrete languages

array

cot_getextplugins(string hook, string cond)

Returns a list of plugins registered for a hook

string

cot_hash(string data, string salt, string algo)

Hashes a value with given salt and specified hash algo.

array

cot_hash_funcs()

Returns the list of available hash algos for use with configs.

string

cot_hash_md5(string data, string salt)

Simple MD5 hash wrapper.

string

cot_hash_sha1(string data, string salt)

SHA1 hash func for use with cot_hash().

string

cot_hash_sha256(string data, string salt)

SHA256 hash func for use with cot_hash().

string

cot_http_build_url(array urlp)

Builds URL string from URL parts

static mixed

cot_imageresize(string source, string target, int target_width, int target_height, string crop, string fillcolor, int quality, bool sharpen)

Resize an image

image

cot_imagesharpen(image resource, int source_width, int target_width, mixed imgdata)

Sharpen an image after resize

boolean

cot_img_check_memory(string file_path, string extra_size)

Checks if PHP can have enough memory to process an image

string

cot_implode_messages(string src, string class)

Collects all messages and implodes them into a single string

mixed

cot_import(string name, string source, string filter, int maxlen, bool dieonerror, bool buffer)

Imports data from the outer world

void

cot_import_buffer_save()

Puts POST data into the cross-request buffer

mixed

cot_import_buffered(string name, mixed value, mixed null)

Attempts to fetch a buffered value for a variable previously imported if the currently imported value is empty

mixed

cot_import_date(string name, bool usertimezone, bool returnarray, string source)

Imports date stamp

boolean|array

cot_import_list(mixed nameslist, string source, array origindata, string nameprefix, string filter, bool arrayprefix, int maxlen, bool dieonerror, bool buffer)

Imports data from the outer world by list of Variable names Relies on `cot_import` function

array

cot_import_pagenav(string var_name, int max_items)

Imports pagination indexes

boolean|array

cot_import_tabledata(For parameters, mixed nameslist, bool buffer)

Imports data from the outer world as indexed array of records imported by cot_import_list.

string

cot_incfile(string name, string type, string part)

Returns path to include file

string

cot_lang_determine()

Returns a exists language from HTTP_ACCEPT_LANGUAGE

mixed

cot_langfile(string name, string type, string default, string lang)

Returns a language file path for an extension or core part.

void

cot_load_structure()

Loads comlete category structure into array

void

cot_log(string text, string group)

Logs an event

void

cot_log_import(string s, string e, string v, string o)

Logs wrong input

bool

cot_mail(string fmail, string subject, string body, string headers, bool customtemplate, string additional_parameters, bool html)

Sends mail with standard PHP mail().

void

cot_message(string text, string class, string src)

Records a generic message to be displayed on results page

int

cot_mktime(int hour, int minute, int second, int month, int date, int year)

Creates UNIX timestamp out of a date

bool

cot_module_active(string name)

Checks if a module is currently installed and active

string

cot_outputfilters(string output)

Applies output filters, adds XSS protection to POST forms Note: XSS can be switched off by adding "xp-off" class to form

string

cot_outputfilters_callback($m m)

Used with cot_outputfilters It is needed because php 5.2 does not support anonymous functions.

array

cot_pagenav(string module, mixed params, int current, int entries, int perpage, string characters, string hash, bool ajax, string target_div, string ajax_module, string ajax_params)

Page navigation (pagination) builder.

string

cot_parse(string text, bool enable_markup, string parser)

Parses text body

string

cot_parse_autourls(string text)

Automatically detect and parse URLs in text into HTML

array

cot_parse_str(string str)

Splits a query string into keys and values array.

void

cot_parse_url(array url)

Splits URL for its parts Same as `parse_str` but with workaround for URL with omitted scheme for old PHP versions

bool

cot_plugin_active(string name)

Checks if a plugin is currently installed and active

string

cot_randomstring(int length, string charlist)

Generates random string within specified charlist

string

cot_rc(string name, array params)

Resource string formatter function.

bool

cot_rc_add_embed(string identifier, string code, string scope, string type, int order)

Puts a portion of embedded code into the header/footer CSS/JS resource registry.

bool

cot_rc_add_file(string path, mixed scope, int order)

Puts a JS/CSS file into the footer resource registry to be consolidated with other such resources and stored in cache.

void

cot_rc_add_standard()

Registers standard resources

string

cot_rc_attr_string(mixed attrs)

Converts custom attributes to a string if necessary

void

cot_rc_embed(string code, bool prepend, string type)

A shortcut for plain output of an embedded stylesheet/javascript in the header of the page

void

cot_rc_embed_footer(string code, string type)

A shortcut for plain output of an embedded stylesheet/javascript in the footer of the page

string

cot_rc_link(string url, string text, mixed attrs)

Quick link resource pattern

void

cot_rc_link_file(string path, bool prepend)

A shortcut for plain output of a link to a CSS/JS file in the header of the page

void

cot_rc_link_footer(string path)

A shortcut to append a JavaScript or CSS file to {FOOTER_JS} tag

string

cot_rc_minify(string code, string type)

JS/CSS minification function

string

cot_rc_modify(string rc, mixed attrs)

Modifies rc string

void

cot_redirect(string url)

Displays redirect page

int

cot_rmdir(string dir)

Removes a directory recursively

mixed

cot_schemefile()

Returns path to a CSS file for user selected color scheme.

string

cot_selectbox_theme(string selected_theme, string selected_scheme, string title, mixed input_name)

Returns Theme/Scheme selection dropdown

static bool

cot_sendheaders(string content_type, string response_code, int last_modified)

Sends standard HTTP headers and disables browser cache

bool

cot_setcookie(string name, string value, int expire, string path, string domain, bool secure, bool httponly)

Set cookie with optional HttpOnly flag

void

cot_shield_clearaction()

Clears current user action in shield

int

cot_shield_hammer(int hammer, string action, int lastseen)

Anti-hammer protection

void

cot_shield_protect()

Warn user of shield protection

void

cot_shield_update(int shield_add, string shield_newaction)

Updates shield state

void

cot_shutdown()

Performs actions required right before shutdown

string

cot_stamp2date(int stamp)

Converts UNIX timestamp into MySQL date

string

cot_string_truncate(string text, integer length, boolean considerhtml, boolean exact, string cuttext)

Truncates text.

array

cot_structure_buildpath(string area, string cat)

Builds category path for cot_breadcrumbs()

array

cot_structure_children(string area, string cat, bool allsublev, bool firstcat, bool userrights, bool sqlprep)

Gets an array of category children

mixed

cot_structure_parents(string area, string cat, string type)

Gets an array of category parents

mixed

cot_themes_info(string theme_name)

Returns themes info data for all available themes or a specified one

array

cot_timezone_list(bool withgmt, bool dst)

Returns a list of timezones sorted by GMT offset.

static mixed

cot_timezone_offset(string tz, bool hours, bool dst)

Returns the offset from GMT in seconds or hours, with or without DST.

array

cot_timezone_search(string countrycode, int gmtoffset)

Returns a list of possible timezones based on country and/or GMT offset.

array

cot_timezone_transitions(string tz)

Returns previous, current and next transition in a certain timezone.

string

cot_title(string area, array params, bool escape, mixed mask)

Generates a title string by replacing submasks with assigned values

string

cot_tplfile(mixed base, string type, bool admin)

Returns path to a template file.

static string

cot_translit_decode(string str)

Backwards transition for cot_translit_encode

string

cot_translit_encode(string str)

Transliterates a string if transliteration is available

string

cot_unique(int length)

Generates random string within hexadecimal range

void

cot_unregister_globals()

Unregisters globals if globals are On

void

cot_uriredir_apply(bool cfg_redir)

Apply URI-redir that stored in session

void

cot_uriredir_redirect(string uri)

Checks URI-redir for xg before redirect

void

cot_uriredir_store()

Store URI-redir to session

string

cot_url(string name, mixed params, string tail, bool htmlspecialchars_bypass, bool ignore_appendix)

Transforms parameters into URL by following user-defined rules.

bool

cot_url_check(string url)

Checks if an absolute URL belongs to current site or its subdomains

string

cot_url_modify(array params, string tail, bool htmlspecialchars_bypass, bool ignore_appendix)

Constructs a modified version of a current URL.

void

cot_url_sanitize(string url)

Sanitize given URL to prevent XSS

string

cot_user_full_name(array|int user)

Displays User full name Format of full name is language specific and defined by $R['users_full_name'] resource string.

string

cot_wraptext(string str, int wrap)

Wraps text

string

cot_xg()

Returns XSS protection variable for GET URLs

string

cot_xp()

Returns XSS protection field for POST forms

void

imageconvolution(mixed src, mixed filter, mixed filter_div, mixed offset)

boolean

strptime(string date, string format)

strptime() for Windows

Function Detail

system\functions.php at line 204

cot_alphaonly

public string cot_alphaonly(string text)
Strips everything but alphanumeric, hyphens and underscores
Parameters:
text - Input
Returns:

system\functions.php at line 1396

cot_auth

public mixed cot_auth(string area, string option, string mask)
Returns specific access permissions
Parameters:
area - Cotonti area
option - Option to access
mask - Access mask
Returns:

system\functions.php at line 1452

cot_auth_build

public array cot_auth_build(int userid, int maingrp)
Builds Access Control List (ACL) for a specific user
Parameters:
userid - User ID
maingrp - User main group
Returns:
Global:
CotDB $db

system\functions.php at line 214

cot_autoload

public void cot_autoload(string class)
Generic autoloader function to be used with spl_autoload_register
Parameters:
class - Class name

system\functions.php at line 1493

cot_block

public bool cot_block(bool allowed)
Block user if he is not allowed to access the page
Parameters:
allowed - Authorization result
Returns:

system\functions.php at line 1510

cot_blockguests

public bool cot_blockguests()
Block guests from viewing the page
Returns:

system\functions.php at line 1537

cot_breadcrumbs

public string cot_breadcrumbs(array crumbs, bool home, bool nolast, bool plain, string inrc, string separator)
Renders breadcrumbs string from array of path crumbs
Parameters:
crumbs - Path crumbs as an array: { {$url1, $title1}, {$url2, $title2},..}
home - Whether to include link to home page in the root
nolast - If TRUE, last crumb will be rendered as plain text rather than hyperlink
plain - If TRUE plain titles will be rendered instead of hyperlinks
inrc - Item template
separator - Items separator
Returns:

system\functions.php at line 1607

cot_build_age

public int cot_build_age(int birthdate)
Calculates age out of date of birth.
Parameters:
birthdate - Timestamp or a string according to format 'YYYY-MM-DD'
Returns:
Age in years or NULL on failure

system\functions.php at line 1660

cot_build_country

public string cot_build_country(string flag)
Returns country text button
Parameters:
flag - Country code
Returns:

system\functions.php at line 1677

cot_build_email

public string cot_build_email(string email, bool hide)
Returns user email link
Parameters:
email - E-mail address
hide - Hide email option
Returns:

system\functions.php at line 1709

cot_build_filesize

public string cot_build_filesize(float bytes, int decimals, mixed round, bool binary, string smallestunit)
Generate human-readable filesize.
Parameters:
bytes - Filesize in bytes
decimals - Number of decimals to show.
round - Round up to this number of decimals. Set false to disable or null to inherit from $decimals.
binary - Use binary instead of decimal calculation. Set TRUE for the IEC binary standard where 1 Kibibyte = 1024 bytes Set FALSE for the SI/IEEE decimal standard where 1 Kilobyte = 1000 bytes
smallestunit - Key of the smallest unit to show. Any number smaller than this will return 'Less than 1 ...'. Effectively its a way to cut off $units at a certain key.
Returns:

system\functions.php at line 1737

cot_build_flag

public string cot_build_flag(string flag)
Returns country flag button
Parameters:
flag - Country code
Returns:

system\functions.php at line 1772

cot_build_friendlynumber

public string cot_build_friendlynumber(float number, array units, int levels, int decimals, mixed round, string smallestunit)
Generic function for generating a human-readable number with localized units.
Parameters:
number - Input number to convert, based on the unit with size (key) 1.
units - Array of units as $relativesize => $unit. Example: array('3600' => 'hours', '60' => 'minutes', '1' => 'seconds'). Where 'seconds' is the base unit, since it has a value of 1. Hours has a value of 3600, since one hour contains 3600 seconds. Values can be given as strings or integers.
levels - Number of levels to return. "3 hours 45 minutes" = 2 levels.
decimals - Number of decimals to show in last level. "2 minutes 20.5 seconds" = 2 levels, 1 decimals.
round - Number of decimals to round the last level up to, can also be negative, see round(). Set false to disable or null to inherit from $decimals.
smallestunit - Key of the smallest unit to show. Any number smaller than this will return 'Less than 1 ...'. Effectively its a way to cut off $units at a certain key.
Returns:

system\functions.php at line 2086

cot_build_group

public string cot_build_group(int grpid, bool title)
Returns group link (button)
Parameters:
grpid - Group ID
title - Return group title instead of name
Returns:

system\functions.php at line 2120

cot_build_groupicon

public string cot_build_groupicon(string src)
Returns user group icon
Parameters:
src - Image file path
Returns:

system\functions.php at line 1845

cot_build_ipsearch

public string cot_build_ipsearch(string ip)
Returns IP Search link
Parameters:
ip - IP mask
Returns:

system\functions.php at line 1874

cot_build_number

public string cot_build_number(float number, int decimals, mixed round)
Wrapper for number_format() using locale number formatting and optional rounding.
Parameters:
number - Number to format
decimals - Number of decimals to return
round - Round up to this number of decimals. Set false to disable or null to inherit from $decimals.
Returns:

system\functions.php at line 1891

cot_build_oddeven

public string cot_build_oddeven(int number)
Odd/even class choser for row
Parameters:
number - Row number
Returns:

system\functions.php at line 1902

cot_build_stars

public unknown cot_build_stars(int level)
Returns stars image for user level
Parameters:
level - User level
Returns:

system\functions.php at line 1922

cot_build_timeago

public string cot_build_timeago(int time, int recently)
Returns readable time difference or 'Just now'.
Parameters:
time - Timestamp
recently - Seconds during which to show 'Just now'
Returns:

system\functions.php at line 1951

cot_build_timegap

public string cot_build_timegap(int t1, int t2, int levels, int decimals, mixed round, string smallestunit)
Returns time gap between two timestamps
Parameters:
t1 - Timestamp 1 (oldest, smallest value).
t2 - Timestamp 2 (latest, largest value).
levels - Number of concatenated units to return.
decimals - Number of decimals to show on last level.
round - Round up last level to this number of decimals. Set false to disable or null to inherit from $decimals.
smallestunit - Key of the smallest unit to show. Any number smaller than this will return 'Less than 1 ...'. Effectively its a way to cut off $units at a certain key.
Returns:

system\functions.php at line 1980

cot_build_timezone

public string cot_build_timezone(float offset, bool withgmt, bool short)
Returns timezone offset formatted according to ISO 8601
Parameters:
offset - Timezone offset in seconds or hours. Set NULL for unknown timezone.
withgmt - Include 'GMT' in the returned string.
short - Use format without minutes, like GMT+1
Returns:
Textual timezone like GMT+1:00

system\functions.php at line 2005

cot_build_url

public unknown cot_build_url(string text, int maxlen)
Returns link for URL
Parameters:
text - URL
maxlen - Max. allowed length
Returns:

system\functions.php at line 2028

cot_build_user

public string cot_build_user(int id, string user, mixed extra_attrs)
Returns link to user profile
Parameters:
id - User ID
user - User name
extra_attrs - Extra link tag attributes as a string or associative array, e.g. array('class' => 'usergrp_admin')
Returns:

system\functions.php at line 4778

cot_captcha_generate

public string cot_captcha_generate(string use_captcha)
Generates a captcha
Global:
array $cfg
array $cot_captcha
Parameters:
use_captcha - The CAPTCHA to manually use
Returns:

system\functions.php at line 4812

cot_captcha_list

public array cot_captcha_list()
Returns the list of currently installed captchas
Global:
array $cot_captcha Captcha registry
Returns:

system\functions.php at line 4824

cot_captcha_validate

public boolean cot_captcha_validate(string value)
Valides a captcha value
Global:
array $cfg
Parameters:
value - Captcha input for validation
Returns:

system\functions.php at line 2727

cot_check

public void cot_check(bool condition, string message, string src)
If condition is true, triggers an error with given message and source
Parameters:
condition - Boolean condition
message - Error message or message key
src - Error source field name

system\functions.php at line 862

cot_check_email

public bool cot_check_email(string res)
Checks the email
Parameters:
res - input string
Returns:
True if email valid

system\functions.php at line 2742

cot_check_messages

public bool cot_check_messages(string src, string class)
Checks if there are messages to display
Parameters:
src - If non-emtpy, check messages in this specific source only
class - If non-empty, check messages of this specific class only
Returns:

system\functions.php at line 4856

cot_check_xg

public static bool cot_check_xg(bool redirect)
Checks GET anti-XSS parameter
Parameters:
redirect - Redirect to message on failure
Returns:

system\functions.php at line 4876

cot_check_xp

public bool cot_check_xp()
Checks POST anti-XSS parameter
Returns:

system\functions.php at line 2795

cot_clear_messages

public void cot_clear_messages(string src, string class)
Clears error and other messages after they have bin displayed
Parameters:
src - If non-emtpy, clear messages in this specific source only
class - If non-empty, clear messages of this specific class only
See Also:
cot_error()
cot_message()

system\functions.php at line 5099

cot_confirm_url

public string cot_confirm_url(string target_url, string ext_name, string msg_code, str msg_key)
Generates an URL used to confirm an action performed by target URL
Parameters:
target_url - Target URL which performs the action
ext_name - Module/plugin name to peform the action
msg_code - Language string key which contains confirmation request text
Returns:

system\functions.php at line 243

cot_cutstring

public string cot_cutstring(string res, int l)
Truncates a string
Parameters:
res - Source string
l - Length
Returns:

system\functions.php at line 3507

cot_date

public string cot_date(string format, int timestamp, bool usertimezone)
Localized version of PHP date()
See Also:
http://php.net/manual/en/function.date.php
Parameters:
format - Date/time format as defined in $Ldt or according to PHP date() format
timestamp - Unix timestamp
usertimezone - Offset the date with current user's timezone
Returns:

system\functions.php at line 3623

cot_date2stamp

public int cot_date2stamp(string date, string format)
Converts date into UNIX timestamp. Like strptime() but using formatting as specified for date().
Parameters:
date - Formatted date as a string.
format - Format on which to base the conversion. Defaults to MySQL date format. Can also be set to 'auto', in which case it will rely on strtotime for parsing.
Returns:
UNIX timestamp or NULL for 0000-00-00

system\functions.php at line 3664

cot_date2strftime

public string cot_date2strftime(string format)
Convert a date format to a strftime format. Timezone conversion is done for unix. Windows users must exchange %z and %Z. Unsupported date formats : S, n, t, L, B, G, u, e, I, P, Z, c, r Unsupported strftime formats : %U, %W, %C, %g, %r, %R, %T, %X, %c, %D, %F, %x
See Also:
http://php.net/manual/en/function.strftime.php
Parameters:
format - A format for date().
Returns:
Format usable for strftime().

system\functions.php at line 5558

cot_declension

public static string cot_declension(int digit, mixed expr, bool onlyword, bool canfrac)
Makes correct plural forms of words
Global:
string $lang Current language
Parameters:
digit - Numeric value
expr - Word or expression
onlyword - Return only words, without numbers
canfrac - - Numeric value can be Decimal Fraction
Returns:

system\functions.php at line 2864

cot_die

public bool cot_die(bool cond, bool notfound)
Terminates script execution and performs redirect
Parameters:
cond - Really die?
notfound - Page not found?
Returns:

system\functions.php at line 2918

cot_die_message

public void cot_die_message(integer code, boolean header, string message_title, string message_body, string redirect)
Terminates script execution and displays message page
Parameters:
code - Message code
header - Render page header
message_title - Custom page title
message_body - Custom message body
redirect - Optional URL to redirect after 3 seconds

system\functions.php at line 2881

cot_diefatal

public void cot_diefatal(string text, string title)
Terminates script execution with fatal error
Parameters:
text - Reason
title - Message title

system\functions.php at line 3054

cot_display_messages

public static void cot_display_messages(XTemplate tpl, string block)
Renders different messages on page
Parameters:
tpl - Current template object reference
block - Current template block

system\functions.php at line 3106

cot_error

public void cot_error(string message, string src)
Records an error message to be displayed on results page
Global:
int $cot_error Global error counter
Parameters:
message - Message lang string code or full text
src - Error source identifier, such as field name for invalid input
See Also:
cot_message()

system\functions.php at line 3120

cot_error_found

public bool cot_error_found()
Checks if any errors have been previously detected during current script execution
Global:
int $cot_error Global error counter
string $error_string Obsolete error message container string
Returns:
TRUE if any errors were found, FALSE otherwise

system\functions.php at line 2136

cot_generate_usertags

public array cot_generate_usertags(mixed user_data, string tag_prefix, string emptyname, bool allgroups, bool cacheitem)
Returns all user tags for XTemplate
Parameters:
user_data - User Info Array
tag_prefix - Prefix for tags
emptyname - Name text if user is not exist
allgroups - Build info about all user groups
cacheitem - Cache tags
Returns:
Global:
CotDB $db

system\functions.php at line 267

cot_get_caller

public string cot_get_caller()
Returns name part of the caller file. Use this in plugins to detect from which file current hook part was included. Example: if (cot_get_caller() == 'users.details') { // We are called from users.details } else if (cot_get_caller() == 'header') { // We are called from header }
Returns:
Caller file basename without .php suffix on success, 'unknown' or error

system\functions.php at line 4200

cot_get_editors

public array cot_get_editors()
Returns the list of available rich text editors
Returns:

system\functions.php at line 3133

cot_get_messages

public array cot_get_messages(string src, string class)
Returns an array of messages for a specific source and/or class
Parameters:
src - Message source identifier. Search in all sources if empty
class - Message class. Search for all classes if empty
Returns:
Array of message strings

system\functions.php at line 4222

cot_get_parsers

public array cot_get_parsers()
Returns the list of available markup parsers
Returns:

system\functions.php at line 5605

cot_get_plural

public int cot_get_plural(int plural, string lang, bool is_frac)
Used in cot_declension to get rules for concrete languages
Parameters:
plural - Numeric value
lang - Target language code
is_frac - true if numeric value is fraction, otherwise false
Returns:

system\functions.php at line 288

cot_getextplugins

public array cot_getextplugins(string hook, string cond)
Returns a list of plugins registered for a hook
Parameters:
hook - Hook name
cond - Permissions
Returns:
Global:
Cache $cache

system\functions.php at line 4891

cot_hash

public string cot_hash(string data, string salt, string algo)
Hashes a value with given salt and specified hash algo.
Global:
array $cot_hash_func
Parameters:
data - Data to be hash-protected
salt - Hashing salt, usually a random value
algo - Hashing algo name, must be registered in $cot_hash_funcs
Returns:
Hashed value

system\functions.php at line 4909

cot_hash_funcs

public array cot_hash_funcs()
Returns the list of available hash algos for use with configs.
Global:
array $cot_hash_func
Returns:

system\functions.php at line 4922

cot_hash_md5

public string cot_hash_md5(string data, string salt)
Simple MD5 hash wrapper. Old passwords use this func.
Parameters:
data - Data to be hashed
salt - Hashing salt, usually a random value
Returns:
MD5 hash of the data

system\functions.php at line 4934

cot_hash_sha1

public string cot_hash_sha1(string data, string salt)
SHA1 hash func for use with cot_hash().
Parameters:
data - Data to be hashed
salt - Hashing salt, usually a random value
Returns:
SHA1 hash of the data

system\functions.php at line 4946

cot_hash_sha256

public string cot_hash_sha256(string data, string salt)
SHA256 hash func for use with cot_hash(). Default since Cotonti 0.9.11.
Parameters:
data - Data to be hashed
salt - Hashing salt, usually a random value
Returns:
SHA256 hash of the data

system\functions.php at line 5389

cot_http_build_url

public string cot_http_build_url(array urlp)
Builds URL string from URL parts
Parameters:
Returns:
URL Array of URL parts
See Also:
`cot_parse_url()`

system\functions.php at line 2288

cot_imageresize

public static mixed cot_imageresize(string source, string target, int target_width, int target_height, string crop, string fillcolor, int quality, bool sharpen)
Resize an image
Parameters:
source - Original image path.
target - Target path for saving, or 'return' to return the resized image data directly.
target_width - Maximum width of resized image.
target_height - Maximum height of resized image.
crop - Crop the image to a certain ratio. Set to 'fit' to calculate ratio from target width and height.
fillcolor - Color fill a transparent gif or png.
quality - JPEG quality
sharpen - Sharpen JPEG image after resize.
Returns:
Boolean or image resource, depending on $target

system\functions.php at line 2495

cot_imagesharpen

public image cot_imagesharpen(image resource, int source_width, int target_width, mixed imgdata)
Sharpen an image after resize
Parameters:
resource - $imgdata Image resource from an image creation function
source_width - Width of image before resize
target_width - Width of image to sharpen (after resize)
Returns:
resource

system\functions.php at line 2518

cot_img_check_memory

public boolean cot_img_check_memory(string file_path, string extra_size)
Checks if PHP can have enough memory to process an image
Parameters:
file_path - Path to an image
extra_size - Extra size to adjust to the estimate (in MB)
Returns:
TRUE if enough memory is available, FALSE otherwise

system\functions.php at line 3191

cot_implode_messages

public string cot_implode_messages(string src, string class)
Collects all messages and implodes them into a single string
Parameters:
src - Origin of the target messages
class - Group messages of selected class only. Empty to group all
Returns:
Composite HTML string
See Also:
cot_error()
cot_get_messages()
cot_message()

system\functions.php at line 339

cot_import

public mixed cot_import(string name, string source, string filter, int maxlen, bool dieonerror, bool buffer)
Imports data from the outer world
Parameters:
name - Variable name
source - Source type: G/GET, P/POST, C/COOKIE, R/REQUEST, PUT, DELETE or D/DIRECT (variable filtering)
filter - Filter type
maxlen - Length limit
dieonerror - Die with fatal error on wrong input
buffer - Try to load from input buffer (previously submitted) if current value is empty
Returns:

system\functions.php at line 691

cot_import_buffer_save

public void cot_import_buffer_save()
Puts POST data into the cross-request buffer

system\functions.php at line 717

cot_import_buffered

public mixed cot_import_buffered(string name, mixed value, mixed null)
Attempts to fetch a buffered value for a variable previously imported if the currently imported value is empty
Parameters:
name - Input name
value - Currently imported value
null - null import
Returns:
Input value or NULL if the variable is not in the buffer

system\functions.php at line 749

cot_import_date

public mixed cot_import_date(string name, bool usertimezone, bool returnarray, string source)
Imports date stamp
Parameters:
name - Variable name preffix
usertimezone - Use user timezone
returnarray - Return Date Array
source - Source type: P (POST), C (COOKIE) or D (variable filtering)
Returns:

system\functions.php at line 600

cot_import_list

public boolean|array cot_import_list(mixed nameslist, string source, array origindata, string nameprefix, string filter, bool arrayprefix, int maxlen, bool dieonerror, bool buffer)
Imports data from the outer world by list of Variable names Relies on `cot_import` function
Parameters:
nameslist - List of Variables names to import, can be:
string 'name1, name2 , ...' - list of variable names comma separated.
array('name1', 'name2', ...) - list of variable names only. In that case $filter parameter must be specified.
array('name1' => 'TYPE1', 'name2' => 'TYPE2' ,...) - list of variable names with their filter types
source - Source type: G/GET, P/POST, C/COOKIE, R/REQUEST, PUT, DELETE or D/DIRECT (variable filtering)
origindata - Array with origin data that will be extended with imported one
nameprefix - Unified prefix for Variables names
filter - Filter type, can be set as:
string 'FLT' - single filter string for all Variables
string 'FLT1, FLT2, ...' - comma separated string with filters corresponding to Variable names
array('FLT1', 'FLT2', ...) - array of filters
Overrides Filter types specified in $nameslist. If passed as list - number of Filters must be equal to count of variables names in $nameslist.
arrayprefix - Use $nameprefix for array fields
maxlen - Length limit
dieonerror - Die with fatal error on wrong input
buffer - Try to load from input buffer (previously submitted) if current value is empty
Returns:
Returns combined array of data or FALSE if wrong parameters set

system\functions.php at line 809

cot_import_pagenav

public array cot_import_pagenav(string var_name, int max_items)
Imports pagination indexes
Parameters:
var_name - URL parameter name, e.g. 'pg' or 'd'
max_items - Max items per page
Returns:
Array containing 3 items: page number, database offset and argument for URLs

system\functions.php at line 658

cot_import_tabledata

public boolean|array cot_import_tabledata(For parameters, mixed nameslist, bool buffer)
Imports data from the outer world as indexed array of records imported by cot_import_list. Used to import table editing data as one array ordered by index (IDs) of table lines.
Parameters:
parameters - see `cot_import_list`:
Returns:
Returns indexed array of data or FALSE if wrong parameters setted

system\functions.php at line 3284

cot_incfile

public string cot_incfile(string name, string type, string part)
Returns path to include file
Parameters:
name - Extension or API name
type - Extension type: 'module', 'plug' or 'core' for core API
part - Name of the extension part
Returns:
File path

system\functions.php at line 3371

cot_lang_determine

public string cot_lang_determine()
Returns a exists language from HTTP_ACCEPT_LANGUAGE
Returns:

system\functions.php at line 3315

cot_langfile

public mixed cot_langfile(string name, string type, string default, string lang)
Returns a language file path for an extension or core part.
Parameters:
name - Part name (area code or plugin name)
type - Part type: 'plug', 'module' or 'core'
default - Default (fallback) language code
lang - Set this to override global $lang
Returns:
Langfile path or FALSE if no suitable files were found

system\functions.php at line 1225

cot_load_structure

public void cot_load_structure()
Loads comlete category structure into array
Global:
CotDB $db

system\functions.php at line 3223

cot_log

public void cot_log(string text, string group)
Logs an event
Parameters:
text - Event description
group - Event group
Global:
CotDB $db

system\functions.php at line 3244

cot_log_import

public void cot_log_import(string s, string e, string v, string o)
Logs wrong input
Parameters:
s - Source type
e - Filter type
v - Variable name
o - Value

system\functions.php at line 882

cot_mail

public bool cot_mail(string fmail, string subject, string body, string headers, bool customtemplate, string additional_parameters, bool html)
Sends mail with standard PHP mail(). If cot_mail_custom() function exists, it will be called instead of the PHP function. This way custom mail delivery methods, such as SMTP, are supported.
Global:
$cfg
Parameters:
fmail - Recipient
subject - Subject
body - Message body
headers - Message headers
customtemplate - Use custom template
additional_parameters - Additional parameters passed to sendmail
Returns:

system\functions.php at line 3258

cot_message

public void cot_message(string text, string class, string src)
Records a generic message to be displayed on results page
Parameters:
text - Message lang string code or full text
class - Message class: 'error', 'ok', 'warning'
src - Message source identifier
See Also:
cot_error()

system\functions.php at line 3561

cot_mktime

public int cot_mktime(int hour, int minute, int second, int month, int date, int year)
Creates UNIX timestamp out of a date
Parameters:
hour - Hours
minute - Minutes
second - Seconds
month - Month
date - Day of the month
year - Year
Returns:

system\functions.php at line 957

cot_module_active

public bool cot_module_active(string name)
Checks if a module is currently installed and active
Global:
array $cot_modules Module registry
Parameters:
name - Module name
Returns:

system\functions.php at line 970

cot_outputfilters

public string cot_outputfilters(string output)
Applies output filters, adds XSS protection to POST forms Note: XSS can be switched off by adding "xp-off" class to form
Parameters:
Returns:

system\functions.php at line 991

cot_outputfilters_callback

public string cot_outputfilters_callback($m m)
Used with cot_outputfilters It is needed because php 5.2 does not support anonymous functions. So during the installation we can not even show an error message.
Parameters:
Returns:

system\functions.php at line 3843

cot_pagenav

public array cot_pagenav(string module, mixed params, int current, int entries, int perpage, string characters, string hash, bool ajax, string target_div, string ajax_module, string ajax_params)
Page navigation (pagination) builder. Uses URL transformation and resource strings, returns an associative array, containing: ['prev'] - first and previous page buttons ['main'] - buttons with page numbers, including current ['next'] - next and last page buttons ['last'] - last page with number
Parameters:
module - Site area or script name
params - URL parameters as array or parameter string
current - Current page offset
entries - Total rows
perpage - Rows per page
characters - It is symbol for parametre which transfer pagination
hash - Hash part of the url (including #)
ajax - Add AJAX support
target_div - Target div ID if $ajax is true
ajax_module - Site area name for ajax if different from $module
ajax_params - URL parameters for ajax if $ajax_module is not empty
Returns:

system\functions.php at line 4247

cot_parse

public string cot_parse(string text, bool enable_markup, string parser)
Parses text body
Parameters:
text - Source text
enable_markup - Enable markup or plain text output
parser - Non-default parser to use
Returns:

system\functions.php at line 4307

cot_parse_autourls

public string cot_parse_autourls(string text)
Automatically detect and parse URLs in text into HTML
Parameters:
text - Text body
Returns:

system\functions.php at line 5196

cot_parse_str

public array cot_parse_str(string str)
Splits a query string into keys and values array. In comparison with built-in parse_str() function, this doesn't apply addslashes and urldecode to parameters and does not support arrays and complex parameters.
Parameters:
str - Query string
Returns:

system\functions.php at line 5361

cot_parse_url

public void cot_parse_url(array url)
Splits URL for its parts Same as `parse_str` but with workaround for URL with omitted scheme for old PHP versions
Parameters:
url - Array of URL parts
See Also:
http://php.net/manual/en/function.parse-str.php

system\functions.php at line 1003

cot_plugin_active

public bool cot_plugin_active(string name)
Checks if a plugin is currently installed and active
Global:
array $cot_plugins_active Active plugins registry
Parameters:
name - Plugin name
Returns:

system\functions.php at line 1205

cot_randomstring

public string cot_randomstring(int length, string charlist)
Generates random string within specified charlist
Parameters:
length - String length
charlist - Allowed characters, defaults to alphanumeric chars
Returns:
and numbers ($pass)

system\functions.php at line 4517

cot_rc

public string cot_rc(string name, array params)
Resource string formatter function. Takes a string with predefined variable substitution, e.g. 'My {$pet} likes {$food}. And {$pet} is hungry!' and an assotiative array of substitution values, e.g. array('pet' => 'rabbit', 'food' => 'carrots') and assembles a formatted result. If {$var} cannot be found in $args, it will be taken from global scope. You can also use parameter strings instead of arrays, e.g. 'pet=rabbit&food=carrots'. Or omit the second parameter in case all substitutions are globals.
Global:
array $R Resource strings
array $L Language strings, support resource sequences too
Parameters:
name - Name of the $R item or a resource string itself
params - Associative array of arguments or a parameter string
Returns:
Assembled resource string

system\functions.php at line 4618

cot_rc_add_embed

public bool cot_rc_add_embed(string identifier, string code, string scope, string type, int order)
Puts a portion of embedded code into the header/footer CSS/JS resource registry. It is strongly recommended to use files for CSS/JS whenever possible and call cot_rc_add_file() function for them instead of embedding code into the page and using this function. This function should be used for dynamically generated code, which cannot be stored in static files.
Global:
array $cot_rc_reg_css Header CSS resource registry
Cache $cache
Parameters:
identifier - Alphanumeric identifier for the piece, used to control updates, etc.
code - Embedded stylesheet or script code
scope - Resource scope. See description of this parameter in cot_rc_add_file() docs.
type - Resource type: 'js' or 'css'
order - Order priority number
Returns:
This function always returns TRUE
See Also:
cot_rc_add_file()
Deprecated:
Will be removed in v.1.0. Use Resources::addEmbed() instead

system\functions.php at line 4648

cot_rc_add_file

public bool cot_rc_add_file(string path, mixed scope, int order)
Puts a JS/CSS file into the footer resource registry to be consolidated with other such resources and stored in cache. It is recommened to use files instead of embedded code and use this function instead of cot_rc_add_js_embed(). Use this way for any sort of static JavaScript or CSS linking. Do not put any private data in any of resource files - it is not secure. If you really need it, then use direct output instead.
Global:
array $cot_rc_reg JavaScript/CSS footer/header resource registry
Cache $cache
Parameters:
path - Path to a *.js script or *.css stylesheet
scope - Resource scope. Scope is a selector of domain where resource is used. Valid scopes are: 'global' - global for entire site, will be included everywhere, this is the most static and persistent scope; 'guest' - for unregistered visitors only; 'user' - for registered members only; 'group_123' - for members of a specific group (maingrp), in this example of group with id=123. It is recommended to use 'global' scope whenever possible because it delivers best caching opportunities.
order - Order priority number
Returns:
Returns TRUE normally, FALSE is file was not found
Deprecated:
Will be removed in v.1.0. Use Resources::addFile() instead

system\functions.php at line 4656

cot_rc_add_standard

public void cot_rc_add_standard()
Registers standard resources

system\functions.php at line 4549

cot_rc_attr_string

public string cot_rc_attr_string(mixed attrs)
Converts custom attributes to a string if necessary
Parameters:
attrs - A string or associative array
Returns:

system\functions.php at line 4688

cot_rc_embed

public void cot_rc_embed(string code, bool prepend, string type)
A shortcut for plain output of an embedded stylesheet/javascript in the header of the page
Global:
array $out Output snippets
Parameters:
code - Stylesheet or javascript code
prepend - Prepend this file before other head outputs
type - Resource type: 'js' or 'css'
Deprecated:
Will be removed in v.1.0. Resources::embed() instead

system\functions.php at line 4704

cot_rc_embed_footer

public void cot_rc_embed_footer(string code, string type)
A shortcut for plain output of an embedded stylesheet/javascript in the footer of the page
Global:
array $out Output snippets
Parameters:
code - Stylesheet or javascript code
type - Resource type: 'js' or 'css'
Deprecated:
Will be removed in v.1.0. Resources::embedFooter() instead

system\functions.php at line 4717

cot_rc_link

public string cot_rc_link(string url, string text, mixed attrs)
Quick link resource pattern
Parameters:
url - Link href
text - Tag contents
attrs - Additional attributes as a string or an associative array
Returns:
HTML link

system\functions.php at line 4732 public void cot_rc_link_file(string path, bool prepend)
A shortcut for plain output of a link to a CSS/JS file in the header of the page
Global:
array $out Output snippets
Parameters:
path - Stylesheet *.css or script *.js path/url
prepend - Prepend this file before other header outputs
Deprecated:
Will be removed in v.1.0. Use Resources::linkFile() instead

system\functions.php at line 4747 public void cot_rc_link_footer(string path)
A shortcut to append a JavaScript or CSS file to {FOOTER_JS} tag
Global:
array $out Output snippets
Parameters:
path - JavaScript or CSS file path
Deprecated:
Will be removed in v.1.0. Resources::linkFileFooter() instead

system\functions.php at line 4761

cot_rc_minify

public string cot_rc_minify(string code, string type)
JS/CSS minification function
Parameters:
code - Code to minify
type - Type: 'js' or 'css'
Returns:
Minified code
Deprecated:
Will be removed in v.1.0. Resources::linkFileFooter() instead

system\functions.php at line 4573

cot_rc_modify

public string cot_rc_modify(string rc, mixed attrs)
Modifies rc string
Parameters:
rc - A resource string
attrs - A string or associative array
Returns:

system\functions.php at line 5122

cot_redirect

public void cot_redirect(string url)
Displays redirect page
Parameters:
url - Target URI

system\functions.php at line 1014

cot_rmdir

public int cot_rmdir(string dir)
Removes a directory recursively
Parameters:
dir - Directory path
Returns:
Number of files and folders removed

system\functions.php at line 3405

cot_schemefile

public mixed cot_schemefile()
Returns path to a CSS file for user selected color scheme. The default search order is: 1) `css` subfolder of user selected theme 2) Main folder of user selected theme
Returns:
Filename with full path to CSS file or FALSE if not found

system\functions.php at line 2685

cot_selectbox_theme

public string cot_selectbox_theme(string selected_theme, string selected_scheme, string title, mixed input_name)
Returns Theme/Scheme selection dropdown
Parameters:
selected_theme - Seleced theme
selected_scheme - Seleced color scheme
title - Dropdown name
Returns:

system\functions.php at line 1053

cot_sendheaders

public static bool cot_sendheaders(string content_type, string response_code, int last_modified)
Sends standard HTTP headers and disables browser cache
Parameters:
content_type - Content-Type value (without charset)
response_code - HTTP response code, e.g. '404 Not Found'
last_modified - Last modified time
Returns:

system\functions.php at line 1097

cot_setcookie

public bool cot_setcookie(string name, string value, int expire, string path, string domain, bool secure, bool httponly)
Set cookie with optional HttpOnly flag
Parameters:
name - The name of the cookie
value - The value of the cookie
expire - The time the cookie expires in unixtime
path - The path on the server in which the cookie will be available on.
domain - The domain that the cookie is available.
secure - Indicates that the cookie should only be transmitted over a secure HTTPS connection. When set to TRUE, the cookie will only be set if a secure connection exists.
httponly - HttpOnly flag
Returns:

system\functions.php at line 4954

cot_shield_clearaction

public void cot_shield_clearaction()
Clears current user action in shield

system\functions.php at line 4967

cot_shield_hammer

public int cot_shield_hammer(int hammer, string action, int lastseen)
Anti-hammer protection
Parameters:
hammer - Hammer rate
action - Action type
lastseen - User last seen timestamp
Returns:

system\functions.php at line 5002

cot_shield_protect

public void cot_shield_protect()
Warn user of shield protection

system\functions.php at line 5021

cot_shield_update

public void cot_shield_update(int shield_add, string shield_newaction)
Updates shield state
Parameters:
shield_add - Hammer
shield_newaction - New action type

system\functions.php at line 1136

cot_shutdown

public void cot_shutdown()
Performs actions required right before shutdown
Global:
CotDB $db
Cache $cache

system\functions.php at line 3649

cot_stamp2date

public string cot_stamp2date(int stamp)
Converts UNIX timestamp into MySQL date
Parameters:
stamp - UNIX timestamp
Returns:
MySQL date

system\functions.php at line 4325

cot_string_truncate

public string cot_string_truncate(string text, integer length, boolean considerhtml, boolean exact, string cuttext)
Truncates text. Cuts a string to the length of $length
Parameters:
text - String to truncate.
length - Length of returned string, including ellipsis.
considerhtml - If true, HTML tags would be handled correctly *
exact - If false, $text will not be cut mid-word
cuttext - Adds text if truncated
Returns:
trimmed string.

system\functions.php at line 1639

cot_structure_buildpath

public array cot_structure_buildpath(string area, string cat)
Builds category path for cot_breadcrumbs()
Parameters:
area - Area code
cat - Category code
Returns:
See Also:
cot_breadcrumbs()

system\functions.php at line 1324

cot_structure_children

public array cot_structure_children(string area, string cat, bool allsublev, bool firstcat, bool userrights, bool sqlprep)
Gets an array of category children
Parameters:
area - Area code
cat - Cat code
allsublev - All sublevels array
firstcat - Add main cat
userrights - Check userrights
sqlprep - use $db->prep function
Returns:
Global:
CotDB $db

system\functions.php at line 1367

cot_structure_parents

public mixed cot_structure_parents(string area, string cat, string type)
Gets an array of category parents
Parameters:
area - Area code
cat - Cat code
type - Type 'full', 'first', 'last'
Returns:

system\functions.php at line 2613

cot_themes_info

public mixed cot_themes_info(string theme_name)
Returns themes info data for all available themes or a specified one
Parameters:
theme_name - Name of theme to get info. Returns list for all themes if no name specified.
Returns:
Array of Theme info data or Theme info data or FALSE

system\functions.php at line 3688

cot_timezone_list

public array cot_timezone_list(bool withgmt, bool dst)
Returns a list of timezones sorted by GMT offset.
Parameters:
withgmt - Return 'GMT' as the first option, otherwise it won't be included
dst - Include DST in timezone offsets, if DST is in effect there right now
Returns:
Multidimensional array. Each timezone has the following keys: 'identifier' - PHP timezone name, e.g. "America/El_Salvador" 'offset' - GMT offset in seconds, e.g. -21600 'title' - Localized timezone name, e.g. "America/El Salvador" 'description' - Hourly GMT offset and localized name, e.g. "GMT-06:00 America/El Salvador"

system\functions.php at line 3733

cot_timezone_offset

public static mixed cot_timezone_offset(string tz, bool hours, bool dst)
Returns the offset from GMT in seconds or hours, with or without DST. Example: Europe/Amsterdam returns 3600 (GMT+1) in the winter, but 7200 (GMT+2) in the summer (DST). Whether or not to apply DST is determined automatically by PHP, but can be disabled. A list of supported timezone identifiers is here: http://php.net/manual/en/timezones.php
Parameters:
tz - Timezone identifier (e.g. Europe/Amsterdam)
hours - Return hours instead of seconds
dst - Include DST in offset if DST is in effect right now
Returns:
Timezone difference in seconds (int) or hours (float)

system\functions.php at line 3766

cot_timezone_search

public array cot_timezone_search(string countrycode, int gmtoffset)
Returns a list of possible timezones based on country and/or GMT offset.
Parameters:
countrycode - 2 char lowercase country code
gmtoffset - Offset from GMT in seconds
Returns:
Numeric array of timezone identifiers

system\functions.php at line 3793

cot_timezone_transitions

public array cot_timezone_transitions(string tz)
Returns previous, current and next transition in a certain timezone. Useful for detecting if DST is currently in effect.
Parameters:
tz - Timezone identifier, must be one of PHP supported timezones
Returns:
Multidimensional array with keys 'previous', 'current' and 'next', each containing an element of the result of DateTimeZone::getTransitions
See Also:
http://www.php.net/manual/en/datetimezone.gettransitions.php

system\functions.php at line 1162

cot_title

public string cot_title(string area, array params, bool escape, mixed mask)
Generates a title string by replacing submasks with assigned values
Parameters:
area - Area maskname or actual mask
params - An associative array of available parameters
escape - Escape HTML special characters
Returns:

system\functions.php at line 3428

cot_tplfile

public string cot_tplfile(mixed base, string type, bool admin)
Returns path to a template file. The default search order is: 1) Current theme folder (plugins/ subdir for plugins, admin/ subdir for admin) 2) Default theme folder (if current is not default) 3) tpl subdir in module/plugin folder (fallback template)
Parameters:
base - Item name (string), or base names (array)
type - Extension type: 'plug', 'module' or 'core'
admin - Use admin theme file if present. Tries to determine from base string by default.
Returns:

system\functions.php at line 5531

cot_translit_decode

public static string cot_translit_decode(string str)
Backwards transition for cot_translit_encode
Parameters:
str - Encoded string
Returns:

system\functions.php at line 5508

cot_translit_encode

public string cot_translit_encode(string str)
Transliterates a string if transliteration is available
Parameters:
str - Source string
Returns:

system\functions.php at line 1185

cot_unique

public string cot_unique(int length)
Generates random string within hexadecimal range
Parameters:
length - Length
Returns:

system\functions.php at line 5034

cot_unregister_globals

public void cot_unregister_globals()
Unregisters globals if globals are On
See Also:
http://www.php.net/manual/en/faq.misc.php#faq.misc.registerglobals

system\functions.php at line 5454

cot_uriredir_apply

public void cot_uriredir_apply(bool cfg_redir)
Apply URI-redir that stored in session
Parameters:
cfg_redir - Configuration of redirect back
Global:
$redirect

system\functions.php at line 5469

cot_uriredir_redirect

public void cot_uriredir_redirect(string uri)
Checks URI-redir for xg before redirect
Parameters:
uri - Target URI

system\functions.php at line 5335

cot_uriredir_store

public void cot_uriredir_store()
Store URI-redir to session
Global:
$sys

system\functions.php at line 5222

cot_url

public string cot_url(string name, mixed params, string tail, bool htmlspecialchars_bypass, bool ignore_appendix)
Transforms parameters into URL by following user-defined rules. This function can be overloaded by cot_url_custom().
Parameters:
name - Module or script name
params - URL parameters as array or parameter string
tail - URL postfix, e.g. anchor
htmlspecialchars_bypass - If TRUE, will not convert & to & and so on.
ignore_appendix - If TRUE, $cot_url_appendix will be ignored for this URL
Returns:
Valid HTTP URL

system\functions.php at line 5324

cot_url_check

public bool cot_url_check(string url)
Checks if an absolute URL belongs to current site or its subdomains
Parameters:
url - Absolute URL
Returns:

system\functions.php at line 5291

cot_url_modify

public string cot_url_modify(array params, string tail, bool htmlspecialchars_bypass, bool ignore_appendix)
Constructs a modified version of a current URL.
Parameters:
params - Modified params
tail - URL postfix, e.g. anchor
htmlspecialchars_bypass - If TRUE, will not convert & to & and so on.
ignore_appendix - If TRUE, $cot_url_appendix will be ignored for this URL
Returns:
Valid HTTP URL

system\functions.php at line 5417

cot_url_sanitize

public void cot_url_sanitize(string url)
Sanitize given URL to prevent XSS
Parameters:
url - URL to process (absolute or not)

system\functions.php at line 2053

cot_user_full_name

public string cot_user_full_name(array|int user)
Displays User full name Format of full name is language specific and defined by $R['users_full_name'] resource string.
Parameters:
user - User Data or User ID
Returns:

system\functions.php at line 4491

cot_wraptext

public string cot_wraptext(string str, int wrap)
Wraps text
Parameters:
str - Source text
wrap - Wrapping boundary
Returns:

system\functions.php at line 5070

cot_xg

public string cot_xg()
Returns XSS protection variable for GET URLs
Returns:

system\functions.php at line 5081

cot_xp

public string cot_xp()
Returns XSS protection field for POST forms
Returns:

system\functions.php at line 2421

imageconvolution

public void imageconvolution(mixed src, mixed filter, mixed filter_div, mixed offset)

system\functions.php at line 3583

strptime

public boolean strptime(string date, string format)
strptime() for Windows
Author:
ex/yks toolkit
License:
MIT
Returns: