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 | 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 | 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 | 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 | 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 | Returns name part of the caller file. |
array | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | Clears current user action in shield |
int | cot_shield_hammer(int hammer, string action, int lastseen) Anti-hammer protection |
void | Warn user of shield protection |
void | cot_shield_update(int shield_add, string shield_newaction) Updates shield state |
void | 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 | 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 | 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 |
public string cot_alphaonly(string text)
public mixed cot_auth(string area, string option, string mask)
public array cot_auth_build(int userid, int maingrp)
public void cot_autoload(string class)
public bool cot_block(bool allowed)
public bool cot_blockguests()
public string cot_breadcrumbs(array crumbs, bool home, bool nolast, bool plain, string inrc, string separator)
public int cot_build_age(int birthdate)
public string cot_build_country(string flag)
public string cot_build_email(string email, bool hide)
public string cot_build_filesize(float bytes, int decimals, mixed round, bool binary, string smallestunit)
public string cot_build_flag(string flag)
public string cot_build_friendlynumber(float number, array units, int levels, int decimals, mixed round, string smallestunit)
public string cot_build_group(int grpid, bool title)
public string cot_build_groupicon(string src)
public string cot_build_ipsearch(string ip)
public string cot_build_number(float number, int decimals, mixed round)
public string cot_build_oddeven(int number)
public unknown cot_build_stars(int level)
public string cot_build_timeago(int time, int recently)
public string cot_build_timegap(int t1, int t2, int levels, int decimals, mixed round, string smallestunit)
public string cot_build_timezone(float offset, bool withgmt, bool short)
public unknown cot_build_url(string text, int maxlen)
public string cot_build_user(int id, string user, mixed extra_attrs)
public string cot_captcha_generate(string use_captcha)
public array cot_captcha_list()
public boolean cot_captcha_validate(string value)
public void cot_check(bool condition, string message, string src)
public bool cot_check_email(string res)
public bool cot_check_messages(string src, string class)
public static bool cot_check_xg(bool redirect)
public bool cot_check_xp()
public void cot_clear_messages(string src, string class)
public string cot_confirm_url(string target_url, string ext_name, string msg_code, str msg_key)
public string cot_cutstring(string res, int l)
public string cot_date(string format, int timestamp, bool usertimezone)
public int cot_date2stamp(string date, string format)
public string cot_date2strftime(string format)
public static string cot_declension(int digit, mixed expr, bool onlyword, bool canfrac)
public bool cot_die(bool cond, bool notfound)
public void cot_die_message(integer code, boolean header, string message_title, string message_body, string redirect)
public void cot_diefatal(string text, string title)
public static void cot_display_messages(XTemplate tpl, string block)
public void cot_error(string message, string src)
public bool cot_error_found()
public array cot_generate_usertags(mixed user_data, string tag_prefix, string emptyname, bool allgroups, bool cacheitem)
public string cot_get_caller()
if (cot_get_caller() == 'users.details')
{
// We are called from users.details
}
else if (cot_get_caller() == 'header')
{
// We are called from header
}
public array cot_get_editors()
public array cot_get_messages(string src, string class)
public array cot_get_parsers()
public int cot_get_plural(int plural, string lang, bool is_frac)
public array cot_getextplugins(string hook, string cond)
public string cot_hash(string data, string salt, string algo)
public array cot_hash_funcs()
public string cot_hash_md5(string data, string salt)
public string cot_hash_sha1(string data, string salt)
public string cot_hash_sha256(string data, string salt)
public string cot_http_build_url(array urlp)
public static mixed cot_imageresize(string source, string target, int target_width, int target_height, string crop, string fillcolor, int quality, bool sharpen)
public image cot_imagesharpen(image resource, int source_width, int target_width, mixed imgdata)
public boolean cot_img_check_memory(string file_path, string extra_size)
public string cot_implode_messages(string src, string class)
public mixed cot_import(string name, string source, string filter, int maxlen, bool dieonerror, bool buffer)
public void cot_import_buffer_save()
public mixed cot_import_buffered(string name, mixed value, mixed null)
public mixed cot_import_date(string name, bool usertimezone, bool returnarray, string source)
public boolean|array cot_import_list(mixed nameslist, string source, array origindata, string nameprefix, string filter, bool arrayprefix, int maxlen, bool dieonerror, bool buffer)
public array cot_import_pagenav(string var_name, int max_items)
public boolean|array cot_import_tabledata(For parameters, mixed nameslist, bool buffer)
public string cot_incfile(string name, string type, string part)
public string cot_lang_determine()
public mixed cot_langfile(string name, string type, string default, string lang)
public void cot_load_structure()
public void cot_log(string text, string group)
public void cot_log_import(string s, string e, string v, string o)
public bool cot_mail(string fmail, string subject, string body, string headers, bool customtemplate, string additional_parameters, bool html)
public void cot_message(string text, string class, string src)
public int cot_mktime(int hour, int minute, int second, int month, int date, int year)
public bool cot_module_active(string name)
public string cot_outputfilters(string output)
public string cot_outputfilters_callback($m m)
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)
public string cot_parse(string text, bool enable_markup, string parser)
public string cot_parse_autourls(string text)
public array cot_parse_str(string str)
public void cot_parse_url(array url)
public bool cot_plugin_active(string name)
public string cot_randomstring(int length, string charlist)
public string cot_rc(string name, array params)
public bool cot_rc_add_embed(string identifier, string code, string scope, string type, int order)
public bool cot_rc_add_file(string path, mixed scope, int order)
public void cot_rc_add_standard()
public string cot_rc_attr_string(mixed attrs)
public void cot_rc_embed(string code, bool prepend, string type)
public void cot_rc_embed_footer(string code, string type)
public string cot_rc_link(string url, string text, mixed attrs)
public void cot_rc_link_file(string path, bool prepend)
public void cot_rc_link_footer(string path)
public string cot_rc_minify(string code, string type)
public string cot_rc_modify(string rc, mixed attrs)
public void cot_redirect(string url)
public int cot_rmdir(string dir)
public mixed cot_schemefile()
public string cot_selectbox_theme(string selected_theme, string selected_scheme, string title, mixed input_name)
public static bool cot_sendheaders(string content_type, string response_code, int last_modified)
public bool cot_setcookie(string name, string value, int expire, string path, string domain, bool secure, bool httponly)
public void cot_shield_clearaction()
public int cot_shield_hammer(int hammer, string action, int lastseen)
public void cot_shield_protect()
public void cot_shield_update(int shield_add, string shield_newaction)
public void cot_shutdown()
public string cot_stamp2date(int stamp)
public string cot_string_truncate(string text, integer length, boolean considerhtml, boolean exact, string cuttext)
public array cot_structure_buildpath(string area, string cat)
public array cot_structure_children(string area, string cat, bool allsublev, bool firstcat, bool userrights, bool sqlprep)
public mixed cot_structure_parents(string area, string cat, string type)
public mixed cot_themes_info(string theme_name)
public array cot_timezone_list(bool withgmt, bool dst)
public static mixed cot_timezone_offset(string tz, bool hours, bool dst)
public array cot_timezone_search(string countrycode, int gmtoffset)
public array cot_timezone_transitions(string tz)
public string cot_title(string area, array params, bool escape, mixed mask)
public string cot_tplfile(mixed base, string type, bool admin)
public static string cot_translit_decode(string str)
public string cot_translit_encode(string str)
public string cot_unique(int length)
public void cot_unregister_globals()
public void cot_uriredir_apply(bool cfg_redir)
public void cot_uriredir_redirect(string uri)
public void cot_uriredir_store()
public string cot_url(string name, mixed params, string tail, bool htmlspecialchars_bypass, bool ignore_appendix)
public bool cot_url_check(string url)
public string cot_url_modify(array params, string tail, bool htmlspecialchars_bypass, bool ignore_appendix)
public void cot_url_sanitize(string url)
public string cot_user_full_name(array|int user)
public string cot_wraptext(string str, int wrap)
public string cot_xg()
public string cot_xp()
public void imageconvolution(mixed src, mixed filter, mixed filter_div, mixed offset)
public boolean strptime(string date, string format)