UNA
|
Functions | |
DesignBoxContent ($sTitle, $sContent, $iTemplateNum=BX_DB_DEF, $mixedMenu=false) | |
send_headers_page_changed () | |
MsgBox ($sText, $iTimer=0) | |
PopupBox ($sName, $sTitle, $sContent, $isHiddenByDefault=false) | |
getVersionComment () | |
getSiteStatUser () | |
bx_time_js ($iUnixTimestamp, $sFormatIdentifier=BX_FORMAT_DATE, $bForceFormat=false) | |
bx_time_utc ($iUnixTimestamp) | |
bx_get_logged_profile_id () | |
isLogged () | |
getLoggedId () | |
getLoggedPassword () | |
isMember ($iId=0) | |
if(!function_exists("isAdmin")) | isRole ($iRole, $iId=0) |
bx_login ($iId, $bRememberMe=false) | |
bx_logout ($bNotify=true) | |
check_logged () | |
bx_check_password ($sLogin, $sPassword, $iRole=BX_DOL_ROLE_MEMBER) | |
bx_check_login ($iID, $sPassword, $iRole=BX_DOL_ROLE_MEMBER) | |
bx_require_authentication ($bStudio=false, $bAjaxMode=false, $sForceRelocate='') | |
bx_login_form ($bStudio=false, $bAjaxMode=false, $sForceRelocate='') | |
title2uri ($sValue) | |
uri2title ($sValue) | |
strmaxtextlen ($sInput, $iMaxLen=60, $sEllipsisSign='…') | |
html2txt ($content, $tags="") | |
bx_process_input ($mixedData, $iDataType=BX_DATA_TEXT, $mixedParams=false, $isCheckMagicQuotes=true) | |
bx_process_output ($mixedData, $iDataType=BX_DATA_TEXT, $mixedParams=false) | |
bx_is_macros_in_content (&$s) | |
bx_process_macros ($s) | |
bx_process_pass ($mixedData, $iDataType=BX_DATA_TEXT, $mixedParams=false, $isCheckMagicQuotes=true) | |
htmlspecialchars_adv ( $string) | |
sendMailTemplate ($sTemplateName, $iAccountId=0, $iProfileId=0, $aReplaceVars=array(), $iEmailType=BX_EMAIL_NOTIFY, $bAddToQueue=false) | |
sendMailTemplateSystem ($sTemplateName, $aReplaceVars=array(), $iEmailType=BX_EMAIL_SYSTEM, $bAddToQueue=false) | |
sendMail ($mRecipientEmails, $sMailSubject, $sMailBody, $iRecipientID=0, $aPlus=array(), $iEmailType=BX_EMAIL_NOTIFY, $sEmailFlag='html', $isDisableAlert=false, $aCustomHeaders=array(), $bAddToQueue=false) | |
_sendMail ($sRecipientEmail, $sMailSubject, $sMailBody, $iRecipientID=0, $aPlus=array(), $iEmailType=BX_EMAIL_NOTIFY, $sEmailFlag='html', $isDisableAlert=false, $aCustomHeaders=array(), $bAddToQueue=false) | |
get_templates_array ($bEnabledOnly=true, $bShortInfo=true) | |
bx_get_image_exif_and_size ($oStorage, $oTranscoder, $iContentId) | |
bx_get_svg_image_size ($sUrl) | |
extFileExists ( $sFileSrc) | |
getVisitorIP () | |
genFlag ($sLang='', $oTemplate=null) | |
echoDbg ( $what, $desc='') | |
echoDbgLog ($mWhat, $sDesc='unused', $sFileName='unused') | |
bx_is_dbg () | |
dbgTiming ($sStartMicrotime) | |
echoJson ($a) | |
clear_xss ($val) | |
uriGenerate ($sValue, $sTable, $sField, $aParams=[]) | |
uriFilter ($s, $aParams=[]) | |
uriCheckUniq ($sValue, $sTable, $sField, $aCond=[]) | |
get_mb_replace ($sPattern, $sReplace, $s) | |
get_mb_len ($s) | |
get_mb_substr ($s, $iStart, $iLen) | |
bx_mb_substr_replace ($s, $sReplace, $iPosStart, $iLength) | |
bx_mb_strpos ($s, $sReplacement, $iStart=0) | |
bx_import ($sClassName, $mixedModule=array()) | |
bx_autoload ($sClassName) | |
bx_instance ($sClassName, $aParams=array(), $mixedModule=array()) | |
bx_js_string ($mixedInput, $iQuoteType=BX_ESCAPE_STR_AUTO) | |
bx_html_attribute ($mixedInput, $iQuoteType=BX_ESCAPE_STR_AUTO) | |
bx_php_string_apos ($mixedInput) | |
bx_php_string_quot ($mixedInput) | |
bx_file_get_contents ($sFileUrl, $aParams=array(), $sMethod='get', $aHeaders=array(), &$sHttpCode=null, $aBasicAuth=array(), $iTimeout=0, $aCustomCurlParams=array()) | |
bx_make_utf8 ($s) | |
bx_get_site_info ($sSourceUrl, $aProcessAdditionalTags=array()) | |
bx_get_site_info_fix_relative_url ($sSourceUrl, $s) | |
bx_parse_html_tag ($sContent, $sTag, $sAttrNameName, $sAttrNameValue, $sAttrContentName, $sCharset=false, $bSpecialCharsDecode=true) | |
return_bytes ($val) | |
genRndPwd ($iLength=8, $bSpecialCharacters=true) | |
genRndSalt () | |
encryptUserPwd ($sPwd, $sSalt) | |
encryptUserId ($sId) | |
bx_get_reset_password_key ($sValue, $sField='email', $iLifetime=0) | |
bx_get_reset_password_link ($sValue, $sField='email', $iLifetime=0) | |
bx_get_reset_password_link_by_key ($sKey) | |
bx_get_reset_password_redirect ($iAccountId) | |
bx_get ($sName, $sMethod=false) | |
bx_set ($sName, $sValue, $sMethod=false) | |
bx_get_with_prefix ($sPrefix, $sMethod=false) | |
bx_get_base_url_inline ($aParams=array()) | |
bx_get_base_url_popup ($aParams=array()) | |
bx_get_base_url ($sPageLink) | |
bx_get_page_info () | |
bx_get_location_bounds_latlng ($fLatitude, $fLongitude, $iRadiusInKm) | |
bx_encode_url_params ($a, $aExcludeKeys=array(), $aOnlyKeys=false) | |
bx_parse_str ($s) | |
bx_append_url_params ($sUrl, $mixedParams, $bEncodeParams=true, $aIgnoreParams=[]) | |
bx_process_url_param ($sValue, $sPattern="/^[\d\w_-]+$/") | |
bx_rrmdir ($directory) | |
bx_clear_folder ($sPath, $aExts=array()) | |
bx_ltrim_str ($sString, $sPrefix, $sReplace='') | |
bx_rtrim_str ($sString, $sPrefix, $sReplace='') | |
bx_trim_nl_duplicates ($s) | |
bx_convert_array2attrs ($a, $sClasses=false, $sStyles=false) | |
bx_unicode_urldecode ($s) | |
bx_audit ($iContentId, $sContentModule, $sAction, $aParams, $iProfileId=0) | |
bx_alert ($sUnit, $sAction, $iObjectId, $iSender=false, $aExtras=array()) | |
bx_is_srv ($mixedModule, $sMethod, $sClass="Module", $bIgnoreInactive=false) | |
bx_is_srv_ii ($mixedModule, $sMethod, $sClass="Module") | |
bx_srv ($mixed, $sMethod, $aParams=array(), $sClass='Module', $bIgnoreCache=false, $bIgnoreInactive=false) | |
bx_srv_ii ($mixed, $sMethod, $aParams=array(), $sClass='Module', $bIgnoreCache=false) | |
bx_srv_ic ($mixed, $sMethod, $aParams=array(), $sClass='Module', $bIgnoreInactive=false) | |
bx_replace_markers ($mixed, $aMarkers) | |
bx_site_hash ($sSalt='', $isSkipVersion=false) | |
bx_gen_method_name ($s, $aWordsDelimiter=array('_')) | |
bx_trigger_error ($sMsg, $iNumLevelsBack=0) | |
bx_get_ver ($bInvalidateCache=false) | |
bx_check_debug_mode () | |
bx_check_maintenance_mode ($bShowHttpError=false) | |
bx_check_minimal_requirements ($bShowHttpError=false) | |
bx_check_redirect_to_correct_hostname ($bProcessRedirect=false) | |
bx_get_self_url () | |
bx_check_redirect_to_remove_install_folder ($bProcessRedirect=false) | |
bx_show_service_unavailable_error_and_exit ($sMsg=false, $iRetryAfter=86400) | |
bx_smart_readfile ($sPath, $sFilename='', $sMimeType='application/octet-stream', $iCacheAge=0, $sCachePrivacy='public', $sContentDisposition='inline') | |
bx_linkify ($text, $sAttrs='', $bHtmlSpecialChars=false) | |
bx_linkify_embeded ($sText) | |
bx_linkify_html ($sHtmlOrig, $sAttrs='') | |
bx_proto () | |
bx_has_proto ($sLink) | |
bx_is_empty_array ($a) | |
bx_is_full_array ($a) | |
bx_is_url_in_content ($sContent, $bSkipLocalUrls=false) | |
bx_is_dynamic_request () | |
bx_is_htmx_request () | |
bx_get_htmx_target () | |
bx_get_htmx_attrs ($aAttrs, $mPreload=false) | |
bx_idn_to_utf8 ($sUrl, $bReturnDomain=false) | |
bx_idn_to_ascii ($sUrl, $bReturnDomain=false) | |
bx_idn_to ($sMethod, $sUrl, $bReturnDomain=false) | |
bx_is_mobile () | |
bx_get_device_pixel_ratio () | |
bx_log ($sObject, $mixed) | |
bx_birthday2age ($sBirthday) | |
bx_setcookie ($sName, $sValue="", $oExpiresOrOptions=0, $sPath='auto', $sDomain='', $bSecure='auto', $bHttpOnly=false) | |
bx_get_ip_hash ($sIp) | |
is_private_ip ($sIp) | |
bx_absolute_url ($sUrl, $sPrefix=BX_DOL_URL_ROOT) | |
bx_is_api () | |
bx_api_get_sql ($q) | |
bx_api_check_access () | |
bx_api_get_base_url () | |
bx_api_get_relative_url ($sUrl, $sPrefix=BX_DOL_URL_ROOT) | |
bx_api_get_block ($sType, $sData, $aParams=[]) | |
bx_api_get_msg ($sMessage, $aParams=[]) | |
bx_api_get_image ($sStorage, $iId) | |
bx_api_get_browse_params ($sParams, $bParamsOnly=false) | |
Variables | |
const | BX_DB_CONTENT_ONLY 0 |
const | BX_DB_DEF 1 |
const | BX_DB_EMPTY 2 |
const | BX_DB_NO_CAPTION 3 |
const | BX_DB_PADDING_CONTENT_ONLY 10 |
const | BX_DB_PADDING_DEF 11 |
const | BX_DB_PADDING_NO_CAPTION 13 |
const | BX_DB_MENU_TEMPLATE_TABS 25 |
const | BX_DB_MENU_TEMPLATE_POPUP 26 |
const | BX_DB_HIDDEN_PHONE 1 |
const | BX_DB_HIDDEN_TABLET 2 |
const | BX_DB_HIDDEN_DESKTOP 3 |
const | BX_DB_HIDDEN_MOBILE 4 |
const | BX_FORMAT_DATE 'sys_format_date' |
const | BX_FORMAT_TIME 'sys_format_time' |
const | BX_FORMAT_DATE_TIME 'sys_format_datetime' |
const | BX_MENU_TEMPLATE_SUBMENU 8 |
const | BX_MENU_TEMPLATE_SUBMENU_MORE_AUTO 18 |
const | BX_MENU_TEMPLATE_CUSTOM_HOR 15 |
const | BX_MENU_TEMPLATE_CUSTOM_VER 20 |
$oZ = new BxDolAlerts('system', 'design_included', 0) | |
const | BX_DOL_START microtime () |
const | BX_DOL_URL_PLUGINS BX_DOL_URL_ROOT . 'plugins/' |
const | BX_DOL_URL_PLUGINS_PUBLIC BX_DOL_URL_ROOT . 'plugins_public/' |
const | BX_DOL_URL_MODULES BX_DOL_URL_ROOT . 'modules/' |
const | BX_DOL_URL_CACHE_PUBLIC BX_DOL_URL_ROOT . 'cache_public/' |
const | BX_DOL_URL_BASE BX_DOL_URL_ROOT . 'template/' |
const | BX_DIRECTORY_PATH_INC BX_DIRECTORY_PATH_ROOT . 'inc/' |
const | BX_DIRECTORY_PATH_BASE BX_DIRECTORY_PATH_ROOT . 'template/' |
const | BX_DIRECTORY_PATH_CACHE BX_DIRECTORY_PATH_ROOT . 'cache/' |
const | BX_DIRECTORY_PATH_CACHE_PUBLIC BX_DIRECTORY_PATH_ROOT . 'cache_public/' |
const | BX_DIRECTORY_PATH_CLASSES BX_DIRECTORY_PATH_ROOT . 'inc/classes/' |
const | BX_DIRECTORY_PATH_PLUGINS BX_DIRECTORY_PATH_ROOT . 'plugins/' |
const | BX_DIRECTORY_PATH_PLUGINS_PUBLIC BX_DIRECTORY_PATH_ROOT . 'plugins_public/' |
const | BX_DIRECTORY_PATH_MODULES BX_DIRECTORY_PATH_ROOT . 'modules/' |
const | BX_DIRECTORY_PATH_TMP BX_DIRECTORY_PATH_ROOT . 'tmp/' |
const | BX_DIRECTORY_PATH_LOGS BX_DIRECTORY_PATH_ROOT . 'logs/' |
const | BX_DIRECTORY_STORAGE BX_DIRECTORY_PATH_ROOT . 'storage/' |
const | BX_DOL_DIR_RIGHTS 0777 |
const | BX_DOL_FILE_RIGHTS 0666 |
const | BX_DOL_STORAGE_OBJ_FILES 'sys_files' |
const | BX_DOL_STORAGE_OBJ_IMAGES 'sys_images' |
if (!defined( 'BX_DOL_INT_MAX')) define( 'BX_DOL_INT_MAX' | |
const | BX_DOL_TRANSCODER_OBJ_ICON_APPLE 'sys_icon_apple' |
const | BX_DOL_TRANSCODER_OBJ_ICON_ANDROID 'sys_icon_android' |
const | BX_DOL_TRANSCODER_OBJ_ICON_ANDROID_SPLASH 'sys_icon_android_splash' |
const | BX_DOL_TRANSCODER_OBJ_ICON_FACEBOOK 'sys_icon_facebook' |
const | BX_DOL_TRANSCODER_OBJ_ICON_FAVICON 'sys_icon_favicon' |
const | BX_DOL_TRANSCODER_OBJ_COVER 'sys_cover' |
const | BX_DOL_TRANSCODER_OBJ_COVER_UNIT_PROFILE 'sys_cover_unit_profile' |
const | BX_DOL_MODULE_SUBTYPE_PROFILE (!defined('BX_DOL_MODULE_TYPE_MODULE')) 1 |
const | BX_DOL_MODULE_SUBTYPE_CONTEXT 2 |
const | BX_DOL_MODULE_SUBTYPE_TEXT 3 |
const | BX_DOL_MODULE_SUBTYPE_FILE 4 |
const | BX_DOL_MODULE_SUBTYPE_PAYMENT 5 |
const | BX_DOL_MODULE_SUBTYPE_NOTIFICATION 6 |
const | BX_DOL_MODULE_SUBTYPE_CONNECT 7 |
const | BX_PAYMENT_TYPE_SINGLE 'single' |
const | BX_PAYMENT_TYPE_RECURRING 'recurring' |
const | BX_PAYMENT_EMPTY_ID 0 |
const | BX_DOL_STUDIO_FOLDER 'studio' |
const | BX_DOL_URL_STUDIO BX_DOL_URL_ROOT . BX_DOL_STUDIO_FOLDER . '/' |
const | BX_DOL_URL_STUDIO_BASE BX_DOL_URL_STUDIO . 'template/' |
const | BX_DOL_DIR_STUDIO BX_DIRECTORY_PATH_ROOT . BX_DOL_STUDIO_FOLDER . '/' |
const | BX_DOL_DIR_STUDIO_INC BX_DOL_DIR_STUDIO . 'inc/' |
const | BX_DOL_DIR_STUDIO_CLASSES BX_DOL_DIR_STUDIO . 'classes/' |
const | BX_DOL_DIR_STUDIO_BASE BX_DOL_DIR_STUDIO . 'template/' |
const | BX_DOL_ROLE_GUEST 0 |
const | BX_DOL_ROLE_MEMBER 1 |
const | BX_DOL_ROLE_ADMIN 2 |
const | BX_DOL_STUDIO_ROLE_MASTER 1 |
const | BX_DOL_STUDIO_ROLE_OPERATOR 2 |
const | BX_PROFILE_STATUS_SUSPENDED 'suspended' |
const | BX_PROFILE_STATUS_ACTIVE 'active' |
const | BX_PROFILE_STATUS_PENDING 'pending' |
const | BX_ACCOUNT_SESSION_KEY_FOR_2FA_LOGIN_ACCOUNT_ID '2FA_LOGIN_ACCOUNT_ID' |
const | BX_ACCOUNT_SESSION_KEY_FOR_2FA_LOGIN_IS_REMEMBER '2FA_LOGIN_IS_REMEMBER' |
const | BX_ACCOUNT_SESSION_KEY_FOR_PHONE_ACTIVATEION_CODE 'PHONE_ACTIVATEION_CODE' |
const | BX_ACCOUNT_CONFIRMATION_NONE 'none' |
const | BX_ACCOUNT_CONFIRMATION_EMAIL 'email' |
const | BX_ACCOUNT_CONFIRMATION_PHONE 'phone' |
const | BX_ACCOUNT_CONFIRMATION_EMAIL_PHONE 'email_and_phone' |
const | BX_ACCOUNT_CONFIRMATION_EMAIL_OR_PHONE 'email_or_phone' |
const | BX_DOL_TEMPLATE_CODE_KEY 'skin' |
const | BX_DOL_TEMPLATE_MIX_KEY 'mix' |
const | BX_DOL_TEMPLATE_DEFAULT_CODE 'protean' |
const | BX_DOL_TEMPLATE_FOLDER_ROOT 'template' |
const | BX_DOL_STUDIO_TEMPLATE_CODE_KEY 'sskin' |
const | BX_DOL_STUDIO_TEMPLATE_DEFAULT_CODE 'protean' |
$o = new BxDolAlerts('system', 'begin', 0) | |
const | BX_DOL_LINK_CLASS 'bx-link' |
const | BX_DATA_TEXT 1 |
const | BX_DATA_TEXT_MULTILINE 2 |
const | BX_DATA_INT 3 |
const | BX_DATA_FLOAT 4 |
const | BX_DATA_CHECKBOX 5 |
const | BX_DATA_HTML 6 |
const | BX_DATA_DATE 7 |
const | BX_DATA_DATETIME 12 |
const | BX_DATA_DATE_TS 8 |
const | BX_DATA_DATETIME_TS 9 |
const | BX_DATA_DATE_TS_UTC 10 |
const | BX_DATA_DATETIME_TS_UTC 11 |
const | BX_DATA_DATE_UTC 13 |
const | BX_DATA_DATETIME_UTC 14 |
const | BX_SLASHES_AUTO 0 |
const | BX_SLASHES_ADD 1 |
const | BX_SLASHES_STRIP 2 |
const | BX_SLASHES_NO_ACTION 3 |
const | BX_ESCAPE_STR_AUTO 0 |
const | BX_ESCAPE_STR_APOS 1 |
const | BX_ESCAPE_STR_QUOTE 2 |
const | BX_EMAIL_SYSTEM 0 |
const | BX_EMAIL_NOTIFY 1 |
const | BX_EMAIL_MASS 2 |
const | BX_MAINTENANCE_FILE '.bx_maintenance' |
Copyright (c) UNA, Inc - https://una.io MIT License - https://opensource.org/licenses/MIT
Copyright (c) UNA, Inc - https://una.io MIT License - https://opensource.org/licenses/MIT
Copyright (c) UNA, Inc - https://una.io MIT License - https://opensource.org/licenses/MIT
Copyright (c) UNA, Inc - https://una.io MIT License - https://opensource.org/licenses/MIT
_sendMail | ( | $sRecipientEmail, | |
$sMailSubject, | |||
$sMailBody, | |||
$iRecipientID = 0, | |||
$aPlus = array(), | |||
$iEmailType = BX_EMAIL_NOTIFY, | |||
$sEmailFlag = 'html', | |||
$isDisableAlert = false, | |||
$aCustomHeaders = array(), | |||
$bAddToQueue = false ) |
system
check_send_mail
email
- [string] recipient emailsubject
- [string] email subjectbody
- [string] email bodyheader
- [string] email headers, headers are separated with double new line characterparams
- [string] parameters for php mail functionrecipient
- [array] recipient info arrayemail_type
- [int] email type, one of the following BX_EMAIL_SYSTEM, BX_EMAIL_NOTIFY, BX_EMAIL_MASShtml
- [boolean] true
if email content is HTML, if false
then email content is textcustom_headers
- [array] custom email headers array as key&value pairsoverride_result
- [boolean] override result of sendMail
function, if true
then mail sending should continue as usual, if false
then mail sending should stop
It's equivalent to 'system', 'check_send_mail' - hook for disabling mail sending
It's equivalent to 'system', 'check_send_mail' - hook for disabling mail sending except override_result
parameter in $extra_params is missing
bx_alert | ( | $sUnit, | |
$sAction, | |||
$iObjectId, | |||
$iSender = false, | |||
$aExtras = array() ) |
Raise an alert
string | $sUnit | - system type |
string | $sAction | - system action |
int | $iObjectId | - object id |
int | $iSender | - sender (action's author) profile id, if it is false - then currectly logged in profile id is used |
array | $aExtras | - extra parameters |
bx_audit | ( | $iContentId, | |
$sContentModule, | |||
$sAction, | |||
$aParams, | |||
$iProfileId = 0 ) |
Raise an audit event
int | $iContentId | - content id |
string | $sContentModule | - module name |
string | $sAction | - system action key |
array | $aParams | - array of parameters |
bx_autoload | ( | $sClassName | ) |
used in spl_autoload_register() function, so no need to call bx_import for system classes
bx_check_login | ( | $iID, | |
$sPassword, | |||
$iRole = BX_DOL_ROLE_MEMBER ) |
Check encrypted password (ex., from Cookie)
bx_check_maintenance_mode | ( | $bShowHttpError = false | ) |
Check if site maintetance mode is enabled. Maintetance mode is enabled when '.bx_maintenance' file exists in the script root folder, please note that this is hidden file and some file managers don't show it.
$bShowHttpError | show 503 HTTP error if site is in mainenance mode |
bx_check_minimal_requirements | ( | $bShowHttpError = false | ) |
Check for minimal requirements. if BX_DISABLE_REQUIREMENTS_CHECK is defined then this requirements checking is skipped.
$bShowHttpError | show 503 HTTP error if site doesn't meet minimal requirements |
bx_check_password | ( | $sLogin, | |
$sPassword, | |||
$iRole = BX_DOL_ROLE_MEMBER ) |
Check unencrypted password
system
encrypt_password_after
info
- [array] contains account info from $oAccount->getInfo()pwd
- [string] the password entered by the userpassword
- [string] the password after encription, to save in db
account
check_login
error_msg
- [string] by ref, contains string with error description, can be overridden in hook processing
bx_check_redirect_to_correct_hostname | ( | $bProcessRedirect = false | ) |
Check if redirect to the correct hostname is required, for example redirect from site.com to www.site.com
$bProcessRedirect | process redirect and exit if needed |
bx_check_redirect_to_remove_install_folder | ( | $bProcessRedirect = false | ) |
Check if redirect to remove install folder. If BX_SKIP_INSTALL_CHECK is defined then this redirect checking is skipped.
$bProcessRedirect | process redirect and exit if needed |
bx_convert_array2attrs | ( | $a, | |
$sClasses = false, | |||
$sStyles = false ) |
Convert array to attributes string
Example:
$a | - array of attributes |
$sClasses | - classes to merge with 'class' attribute |
$sStyles | - styles to merge with 'style' attribute |
bx_file_get_contents | ( | $sFileUrl, | |
$aParams = array(), | |||
$sMethod = 'get', | |||
$aHeaders = array(), | |||
& | $sHttpCode = null, | ||
$aBasicAuth = array(), | |||
$iTimeout = 0, | |||
$aCustomCurlParams = array() ) |
Gets file contents by URL.
string | $sFileUrl | - file URL to be read. |
array | $aParams | - an array of parameters to be pathed with URL. |
string | $sMethod | - post or get. |
array | $aHeaders | - custom headers. |
string | $sHttpCode | - HTTP code to return |
array | $aBasicAuth | - array with 'user' and 'password' for Basic HTTP Auth |
bx_gen_method_name | ( | $s, | |
$aWordsDelimiter = array('_') ) |
Transform string to method name string, for example it changes 'some_method' string to 'SomeMethod' string
$s | string where words are separated with underscore |
$aWordsDelimiter | word delimeters |
bx_get_logged_profile_id | ( | ) |
bx_get_self_url | ( | ) |
Get URL of current page
bx_get_site_info_fix_relative_url | ( | $sSourceUrl, | |
$s ) |
Fix relative URL to make it absolute
$sSourceUrl | main URL |
$s | URL to fix |
bx_get_ver | ( | $bInvalidateCache = false | ) |
Get system DB version, for files version
bx_has_proto | ( | $sLink | ) |
Checks protocol in the link
bx_html_attribute | ( | $mixedInput, | |
$iQuoteType = BX_ESCAPE_STR_AUTO ) |
Return input string/array ready to pass to html attribute with filtered symbols like ', " etc
$mixedInput | - string/array which should be filtered |
$iQuoteType | - string escaping BX_ESCAPE_STR_AUTO, BX_ESCAPE_STR_APOS or BX_ESCAPE_STR_QUOTE |
bx_import | ( | $sClassName, | |
$mixedModule = array() ) |
Import class file, it automatically detects class path by its prefix or module array/name
$sClassName | - full class name or class postfix(withoit prefix) in the case of module class |
$mixedModule | - module array or module name in the case of module class |
bx_instance | ( | $sClassName, | |
$aParams = array(), | |||
$mixedModule = array() ) |
Gets an instance of class pathing necessary parameters if it's necessary.
string | $sClassName | class name. |
array | $aParams | an array of parameters to be pathed to the constructor of the class. |
array | $mixedModule | an array with module description. Is used when the requested class is located in some module. |
bx_is_srv | ( | $mixedModule, | |
$sMethod, | |||
$sClass = "Module", | |||
$bIgnoreInactive = false ) |
Check whether serice method exists or not
$mixed | module name or module id |
$sMethod | service method name in format 'method_name', corresponding class metod is serviceMethodName |
$sClass | class to search for service method, by default it is main module class |
bx_is_srv_ii | ( | $mixedModule, | |
$sMethod, | |||
$sClass = "Module" ) |
Check whether serice method exists or not in 'Ignore Inactive' mode.
bx_js_string | ( | $mixedInput, | |
$iQuoteType = BX_ESCAPE_STR_AUTO ) |
Escapes string/array ready to pass to js script with filtered symbols like ', " etc
$mixedInput | - string/array which should be filtered |
$iQuoteType | - string escaping method: BX_ESCAPE_STR_AUTO(default), BX_ESCAPE_STR_APOS or BX_ESCAPE_STR_QUOTE |
bx_linkify | ( | $text, | |
$sAttrs = '', | |||
$bHtmlSpecialChars = false ) |
Wrap in A tag links in TEXT string
$text | - text string without tags |
$sAttrs | - attributes string to add to the added A tag |
$bHtmlSpecialChars | - apply htmlspecialchars before processing |
bx_linkify_html | ( | $sHtmlOrig, | |
$sAttrs = '' ) |
Wrap in A tag links in HTML string, which aren't wrapped in A tag yet
$sHtmlOrig | - HTML string |
$sAttrs | - attributes string to add to the added A tag |
bx_log | ( | $sObject, | |
$mixed ) |
Log to logs object
$sObject | - logs object |
$mixed | - string or array to log |
bx_login | ( | $iId, | |
$bRememberMe = false ) |
Login user by setting necessary cookies
$iId | account id |
$bRememberMe | remember session |
account
login
bx_login_form | ( | $bStudio = false, | |
$bAjaxMode = false, | |||
$sForceRelocate = '' ) |
Display login form and exit
$bStudio | display login form for studio |
$bAjaxMode | login form displayed via AJAX |
sForceRelocate | forece relocate |
bx_logout | ( | $bNotify = true | ) |
bx_parse_str | ( | $s | ) |
It works similar to parse_str
php function, but it doesn't decode URL params
bx_php_string_apos | ( | $mixedInput | ) |
Escapes string/array ready to pass to php script with filtered symbols like ', " etc
mixed | $mixedInput | - string/array which should be filtered |
bx_process_input | ( | $mixedData, | |
$iDataType = BX_DATA_TEXT, | |||
$mixedParams = false, | |||
$isCheckMagicQuotes = true ) |
Functions to process user input. DON'T use to process data before passing to SQL query - use db prepare instead
$mixedData | data to process |
$iDataType | how to handle data, possible valies: BX_DATA_INT - integer value
BX_DATA_FLOAT - float values
BX_DATA_TEXT - text data, single line (default)
BX_DATA_TEXT_MULTILINE - text data, multiple lines
BX_DATA_HTML - HTML data
BX_DATA_DATE - date data type stored as yyyy-mm-dd
BX_DATA_DATETIME - date/time data type stored as yyyy-mm-dd hh:mm:ss
BX_DATA_DATE_TS' - date data type stored as unixtimestamp
BX_DATA_DATETIME_TS - date/time data type stored as unixtimestamp
BX_DATA_DATE_TS_UTC - date data type stored as unixtimestamp from UTC time
BX_DATA_DATETIME_TS_UTC - date/time data type stored as unixtimestamp from UTC time
const BX_DATA_DATE_TS date data type stored as unixtimestamp Definition utils.inc.php:20 const BX_DATA_CHECKBOX checkbox data type, 'on' or empty value Definition utils.inc.php:16 const BX_DATA_DATETIME date/time data type stored as yyyy-mm-dd hh:mm:ss Definition utils.inc.php:19 const BX_DATA_TEXT_MULTILINE regular multiline text data type Definition utils.inc.php:13 |
$mixedParams | optional parameters to pass for validation |
$isCheckMagicQuotes | deprecated |
bx_process_macros | ( | $s | ) |
This function converts macros upon text output. Macros represents constructions like this:
For example, to display some content from module Posts:
Only users which have "use macros" ACL action enabled can use this functionlity.
$s | text to process |
bx_require_authentication | ( | $bStudio = false, | |
$bAjaxMode = false, | |||
$sForceRelocate = '' ) |
Declare that content is require user authoriztion and display login form if user isn't logged in
$bStudio | require webmaster authorization |
bx_show_service_unavailable_error_and_exit | ( | $sMsg = false, | |
$iRetryAfter = 86400 ) |
Show HTTP 503 service unavailable error and exit
bx_smart_readfile | ( | $sPath, | |
$sFilename = '', | |||
$sMimeType = 'application/octet-stream', | |||
$iCacheAge = 0, | |||
$sCachePrivacy = 'public', | |||
$sContentDisposition = 'inline' ) |
The function is sumilar to php readfile, but it send all required headers and can send file by chunks and suports file seek
$sPath | path to file to output to the browser |
$sFilename | filename without path, ig file is saved from browser, then this name is used, not used(empty) by default |
$sMimeType | file mime type, by default 'application/octet-stream' |
$iCacheAge | file cache age, by default 0 |
$sCachePrivacy | cache privacy 'public' (default value) or 'private' |
$sContentDisposition | content disposition header ('inline' or 'attachment' usually |
bx_srv | ( | $mixed, | |
$sMethod, | |||
$aParams = array(), | |||
$sClass = 'Module', | |||
$bIgnoreCache = false, | |||
$bIgnoreInactive = false ) |
Perform serice call
$mixed | module name or module id |
$sMethod | service method name in format 'method_name', corresponding class metod is serviceMethodName |
$aParams | params to pass to service method |
$sClass | class to search for service method, by default it is main module class |
bx_srv_ic | ( | $mixed, | |
$sMethod, | |||
$aParams = array(), | |||
$sClass = 'Module', | |||
$bIgnoreInactive = false ) |
Perform serice call in 'Ignore Cache' mode.
bx_srv_ii | ( | $mixed, | |
$sMethod, | |||
$aParams = array(), | |||
$sClass = 'Module', | |||
$bIgnoreCache = false ) |
Perform serice call in 'Ignore Inactive' mode.
bx_time_js | ( | $iUnixTimestamp, | |
$sFormatIdentifier = BX_FORMAT_DATE, | |||
$bForceFormat = false ) |
Output time wrapped in <time> tag in HTML. Then time is autoformatted using JS upon page load, this is aumatically converted to user's timezone and updated in realtime in case of short periods of 'from now' time format.
This is just short version for:
$iUnixTimestamp | time as unixtimestamp |
$sFormatIdentifier | output format identifier |
$bForceFormat | force provided format and don't use "from now" time autoformat. |
bx_time_utc | ( | $iUnixTimestamp | ) |
Get UTC/GMT time string in ISO8601 date format from provided unix timestamp
$iUnixTimestamp | - unix timestamp |
bx_trigger_error | ( | $sMsg, | |
$iNumLevelsBack = 0 ) |
Trigger user error
$sMsg | message to display |
$iNumLevelsBack | add additional debug backtracing N levels back |
bx_trim_nl_duplicates | ( | $s | ) |
Strip all lines with no information for example:
,
check_logged | ( | ) |
clear_xss | ( | $val | ) |
system
clear_xss
oHtmlPurifier
- [object] HtmlPurifier objectinput_data
- [string] string before check xssreturn_data
- [string] by ref, string before check xss, can be overridden in hook processing DesignBoxContent | ( | $sTitle, | |
$sContent, | |||
$iTemplateNum = BX_DB_DEF, | |||
$mixedMenu = false ) |
Display "design box" HTML code
encryptUserId | ( | $sId | ) |
Hash profile ID
encryptUserPwd | ( | $sPwd, | |
$sSalt ) |
Encrypt user password. When BX_PWD_ALGO is 'custom', then bx_custom_pwd_encrypt function with custom algorythm must be defined in inc/header.inc.php file.
$sPwd | clear password |
$sSalt | salt |
getLoggedId | ( | ) |
getLoggedPassword | ( | ) |
htmlspecialchars_adv | ( | $string | ) |
isLogged | ( | ) |
isMember | ( | $iId = 0 | ) |
It checks if account role is member.
if(!function_exists("isAdmin")) isRole | ( | $iRole, | |
$iId = 0 ) |
Check user role
$iRole | role to check user for |
$iId | optional account id, if it isn't specified then curently logged in account is used |
send_headers_page_changed | ( | ) |
Use this function in pages if you want to not cache it.
sendMail | ( | $mRecipientEmails, | |
$sMailSubject, | |||
$sMailBody, | |||
$iRecipientID = 0, | |||
$aPlus = array(), | |||
$iEmailType = BX_EMAIL_NOTIFY, | |||
$sEmailFlag = 'html', | |||
$isDisableAlert = false, | |||
$aCustomHeaders = array(), | |||
$bAddToQueue = false ) |
Send email function
$mRecipientEmails | - Email where email should be send, can be array, string with one email or comma separated |
$sMailSubject | - subject of the message |
$sMailBody | - Body of the message |
$iRecipientID | - ID of recipient profile |
$aPlus | - Array of additional information |
$iEmailType | - email message type: BX_EMAIL_SYSTEM, BX_EMAIL_NOTIFY or BX_EMAIL_MASS |
$sEmailFlag | - use 'html' for HTML email message |
$isDisableAlert | - disable alert |
$aCustomHeaders | - custom email headers |
$bAddToQueue | - add message to email queue |
sendMailTemplate | ( | $sTemplateName, | |
$iAccountId = 0, | |||
$iProfileId = 0, | |||
$aReplaceVars = array(), | |||
$iEmailType = BX_EMAIL_NOTIFY, | |||
$bAddToQueue = false ) |
Send mail to user by parsing email template
sendMailTemplateSystem | ( | $sTemplateName, | |
$aReplaceVars = array(), | |||
$iEmailType = BX_EMAIL_SYSTEM, | |||
$bAddToQueue = false ) |
Send system email
title2uri | ( | $sValue | ) |
The following two functions are needed to convert title to uri and back. It usefull when titles are used in URLs, like in Categories and Tags.
const BX_DB_CONTENT_ONLY 0 |
design box with content only - no borders, no background, no caption
const BX_DB_DEF 1 |
default design box with content, borders and caption
const BX_DB_EMPTY 2 |
just empty design box, without anything
const BX_DB_NO_CAPTION 3 |
design box with content, like BX_DB_DEF but without caption
const BX_DB_PADDING_CONTENT_ONLY 10 |
design box with content only wrapped with default padding - no borders, no background, no caption it can be used to just wrap content with default padding
const BX_DB_PADDING_DEF 11 |
default design box with content wrapped with default padding, borders and caption
const BX_DB_PADDING_NO_CAPTION 13 |
design box with content wrapped with default padding, like BX_DB_DEF but without caption
const BX_ESCAPE_STR_APOS 1 |
escape apostrophes only, for js strings enclosed in apostrophes, for use in
const BX_ESCAPE_STR_AUTO 0 |
turn apostropes and quote signs into html special chars, for use in
const BX_ESCAPE_STR_QUOTE 2 |
escape quotes only, for js strings enclosed in quotes, for use in
const BX_FORMAT_DATE 'sys_format_date' |
date format identifier for use in
const BX_FORMAT_DATE_TIME 'sys_format_datetime' |
datetime format identifier for use in
const BX_FORMAT_TIME 'sys_format_time' |
time format identifier for use in