XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Functions | Variables
func.inc.php File Reference

Go to the source code of this file.

Functions

 getModule ($module_name, $type= 'view', $kind= '')
 
 getController ($module_name)
 
 getAdminController ($module_name)
 
 getView ($module_name)
 
getMobile ($module_name)
 
 getAdminView ($module_name)
 
 getModel ($module_name)
 
 getAdminModel ($module_name)
 
 getAPI ($module_name)
 
 getWAP ($module_name)
 
 getClass ($module_name)
 
 executeQuery ($query_id, $args=NULL, $arg_columns=NULL)
 
 executeQueryArray ($query_id, $args=NULL, $arg_columns=NULL)
 
 getNextSequence ()
 
 setUserSequence ($seq)
 
 checkUserSequence ($seq)
 
 getUrl ()
 
 getNotEncodedUrl ()
 
 getAutoEncodedUrl ()
 
 getFullUrl ()
 
 getNotEncodedFullUrl ()
 
 getSiteUrl ()
 
 getNotEncodedSiteUrl ()
 
 getFullSiteUrl ()
 
 getCurrentPageUrl ()
 
 isSiteID ($domain)
 
 cut_str ($string, $cut_size=0, $tail= '...')
 
 zgap ()
 
 ztime ($str)
 
 getTimeGap ($date, $format= 'Y.m.d')
 
 getMonthName ($month, $short=TRUE)
 
 zdate ($str, $format= 'Y-m-d H:i:s', $conversion=TRUE)
 
 getEncodeEmailAddress ($email)
 
 debugPrint ($debug_output=NULL, $display_option=TRUE, $file= '_debug_message.php')
 
 writeSlowlog ($type, $elapsed_time, $obj)
 
 flushSlowlog ()
 
 getMicroTime ()
 
 delObjectVars ($target_obj, $del_obj)
 
 getDestroyXeVars (&$vars)
 
 handleError ($errno, $errstr, $file, $line)
 
 getNumberingPath ($no, $size=3)
 
 url_decode ($str)
 
 purifierHtml (&$content)
 
 removeHackTag ($content)
 
 blockWidgetCode ($content)
 
 checkUploadedFile ($file)
 
 checkXmpTag ($content)
 
 removeSrcHack ($match)
 
if(!function_exists('hexrgb')) mysql_pre4_hash_password ($password)
 
 getScriptPath ()
 
 getRequestUriByServerEnviroment ()
 
 utf8RawUrlDecode ($source)
 
 _code2utf ($num)
 
 detectUTF8 ($string, $return_convert=FALSE, $urldecode=TRUE)
 
 json_encode2 ($data)
 
 isCrawler ($agent=NULL)
 
 stripEmbedTagForAdmin (&$content, $writer_member_srl)
 
 requirePear ()
 
 checkCSRF ()
 
 recurciveExposureCheck (&$menu)
 
 changeValueInUrl ($key, $requestKey, $dbKey, $urlName= 'success_return_url')
 
 htmlHeader ()
 
 htmlFooter ()
 
 alertScript ($msg)
 
 closePopupScript ()
 
 reload ($isOpener=FALSE)
 
 isDefinedLangCode ($str)
 
 escape ($str, $double_escape=true, $escape_defined_lang_code=false)
 
 escape_css ($str)
 
 escape_js ($str)
 
 escape_sqstr ($str)
 
 escape_dqstr ($str)
 
 explode_with_escape ($delimiter, $str, $limit=0, $escape_char= '\\')
 

Variables

 $time_zone
 

Function Documentation

_code2utf (   $num)

Returns utf-8 string of given code

Parameters
int$num
Returns
string

Definition at line 1437 of file func.inc.php.

alertScript (   $msg)

Print raw alert message script

Parameters
string$msg
Returns
void

Definition at line 1738 of file func.inc.php.

blockWidgetCode (   $content)

blocking widget code

Parameters
string$contentTaget content
Returns
string

Definition at line 1152 of file func.inc.php.

changeValueInUrl (   $key,
  $requestKey,
  $dbKey,
  $urlName = 'success_return_url' 
)

Definition at line 1688 of file func.inc.php.

checkCSRF ( )

Definition at line 1623 of file func.inc.php.

checkUploadedFile (   $file)

check uploaded file which may be hacking attempts

Parameters
string$fileTaget file path
Returns
bool

Definition at line 1165 of file func.inc.php.

checkUserSequence (   $seq)

Check Sequence number grant

Parameters
int$seqsequence number
Returns
boolean

Definition at line 270 of file func.inc.php.

checkXmpTag (   $content)

Check xmp tag, close it.

Parameters
string$contentTarget content
Returns
string

Definition at line 1177 of file func.inc.php.

closePopupScript ( )

Print raw close window script

Returns
void

Definition at line 1757 of file func.inc.php.

cut_str (   $string,
  $cut_size = 0,
  $tail = '...' 
)

Put a given tail after trimming string to the specified size

Parameters
string$stringThe original string to trim
int$cut_sizeThe size to be
string$tailTail to put in the end of the string after trimming
Returns
string

Definition at line 508 of file func.inc.php.

debugPrint (   $debug_output = NULL,
  $display_option = TRUE,
  $file = '_debug_message.php' 
)

Prints debug messages

Display $buff contents into the file ./files/_debug_message.php. You can see the file on your prompt by command: tail-f./files/_debug_message.php

Parameters
mixed$debug_outputTarget object to be printed
bool$display_optionboolean Flag whether to print seperator (default:true)
string$fileTarget file name
Returns
void

Definition at line 805 of file func.inc.php.

delObjectVars (   $target_obj,
  $del_obj 
)

Delete the second object vars from the first argument

Parameters
object$target_objAn original object
object$del_objBaseObject vars to delete from the original object
Returns
object

Definition at line 999 of file func.inc.php.

detectUTF8 (   $string,
  $return_convert = FALSE,
  $urldecode = TRUE 
)

Get whether utf8 or not given string

Parameters
string$string
bool$return_convertIf set, returns converted string
bool$urldecode
Returns
bool|string

Definition at line 1466 of file func.inc.php.

escape (   $str,
  $double_escape = true,
  $escape_defined_lang_code = false 
)

This function is a shortcut to htmlspecialchars().

Definition at line 1799 of file func.inc.php.

escape_css (   $str)

This function escapes a string to be used in a CSS property.

Definition at line 1816 of file func.inc.php.

escape_dqstr (   $str)

This function escapes a string to be used in a "double-quoted" PHP string literal. Null bytes are removed.

Definition at line 1862 of file func.inc.php.

escape_js (   $str)

This function escapes a string to be used in a JavaScript string literal.

Definition at line 1830 of file func.inc.php.

escape_sqstr (   $str)

This function escapes a string to be used in a 'single-quoted' PHP string literal. Null bytes are removed.

Definition at line 1847 of file func.inc.php.

executeQuery (   $query_id,
  $args = NULL,
  $arg_columns = NULL 
)

The alias of DB::executeQuery()

See Also
DB::executeQuery()
Parameters
string$query_id(module name.query XML file)
object$argsvalues of args object
string[]$arg_columns Column list
Returns
object Query result data

Definition at line 203 of file func.inc.php.

executeQueryArray (   $query_id,
  $args = NULL,
  $arg_columns = NULL 
)

Function to handle the result of DB::executeQuery() as an array

See Also
DB::executeQuery()
executeQuery()
Parameters
string$query_id(module name.query XML file)
object$argsvalues of args object
string[]$arg_columns Column list
Returns
object Query result data

Definition at line 219 of file func.inc.php.

explode_with_escape (   $delimiter,
  $str,
  $limit = 0,
  $escape_char = '\\' 
)

This function splits a string into an array, but allows the delimter to be escaped. For example, 'A|B|C|D' will be split into 'A', 'B|C', and 'D' because the bar between B and C is escaped.

Definition at line 1881 of file func.inc.php.

flushSlowlog ( )
Parameters
void

Definition at line 973 of file func.inc.php.

getAdminController (   $module_name)

Create a admin controller instance of the module

Parameters
string$module_nameThe module name to get a admin controller instance
Returns
mixed Module admin controller instance

Definition at line 101 of file func.inc.php.

getAdminModel (   $module_name)

Create an admin model instance of the module

Parameters
string$module_nameThe module name to get a admin model instance
Returns
mixed Module admin model instance

Definition at line 156 of file func.inc.php.

getAdminView (   $module_name)

Create a admin view instance of the module

Parameters
string$module_nameThe module name to get a admin view instance
Returns
mixed Module admin view instance

Definition at line 134 of file func.inc.php.

getAPI (   $module_name)

Create an api instance of the module

Parameters
string$module_nameThe module name to get a api instance
Returns
mixed Module api class instance

Definition at line 167 of file func.inc.php.

getAutoEncodedUrl ( )

Get a encoded url. If url is encoded, not encode. Otherwise html encode the url.

See Also
getUrl()
Returns
string

Definition at line 339 of file func.inc.php.

getClass (   $module_name)

Create a class instance of the module

Parameters
string$module_nameThe module name to get a class instance
Returns
mixed Module class instance

Definition at line 189 of file func.inc.php.

getController (   $module_name)

Create a controller instance of the module

Parameters
string$module_nameThe module name to get a controller instance
Returns
mixed Module controller instance

Definition at line 90 of file func.inc.php.

getCurrentPageUrl ( )

Return the exact url of the current page

Returns
string

Definition at line 482 of file func.inc.php.

getDestroyXeVars ( $vars)

Definition at line 1035 of file func.inc.php.

getEncodeEmailAddress (   $email)

Returns encoded value of given email address for email scraping

Parameters
string$emailThe email
Returns
string

Definition at line 784 of file func.inc.php.

getFullSiteUrl ( )

Return the value adding request uri to the getSiteUrl() To get the full url

Returns
string

Definition at line 454 of file func.inc.php.

getFullUrl ( )

Return the value adding request uri to getUrl() to get the full url

Returns
string

Definition at line 361 of file func.inc.php.

getMicroTime ( )

microtime() return

Returns
float

Definition at line 986 of file func.inc.php.

& getMobile (   $module_name)

Create a mobile instance of the module

Parameters
string$module_nameThe module name to get a mobile instance
Returns
mixed Module mobile instance

Definition at line 123 of file func.inc.php.

getModel (   $module_name)

Create a model instance of the module

Parameters
string$module_nameThe module name to get a model instance
Returns
mixed Module model instance

Definition at line 145 of file func.inc.php.

getModule (   $module_name,
  $type = 'view',
  $kind = '' 
)

Define a function to use {

See Also
ModuleHandler::getModuleObject()} ($module_name, $type)
Parameters
string$module_nameThe module name to get a instance
string$typedisp, proc, controller, class
string$kindadmin, null
Returns
mixed Module instance

Definition at line 79 of file func.inc.php.

getMonthName (   $month,
  $short = TRUE 
)

Name of the month return

Parameters
int$monthMonth
boot$shortIf set, returns short string
Returns
string

Definition at line 677 of file func.inc.php.

getNextSequence ( )

Alias of DB::getNextSequence()

See Also
DB::getNextSequence()
Returns
int

Definition at line 236 of file func.inc.php.

getNotEncodedFullUrl ( )

Return the value adding request uri to getUrl() to get the not encoded full url

Returns
string

Definition at line 385 of file func.inc.php.

getNotEncodedSiteUrl ( )

getSiteUrl() returns the not encoded URL by transforming the given argument value of domain The first argument should consist of domain("http://" not included) and path

Returns
string

Definition at line 433 of file func.inc.php.

getNotEncodedUrl ( )

Get a not encoded(html entity) url

See Also
getUrl()
Returns
string

Definition at line 316 of file func.inc.php.

getNumberingPath (   $no,
  $size = 3 
)

Trim a given number to a fiven size recursively

Parameters
int$noA given number
int$sizeA given digits

Definition at line 1081 of file func.inc.php.

getRequestUriByServerEnviroment ( )

Return the requested script path

Returns
string

Definition at line 1380 of file func.inc.php.

getScriptPath ( )

Return the requested script path

Returns
string

Definition at line 1364 of file func.inc.php.

getSiteUrl ( )

getSiteUrl() returns the URL by transforming the given argument value of domain The first argument should consist of domain("http://" not included) and path

Returns
string

Definition at line 411 of file func.inc.php.

getTimeGap (   $date,
  $format = 'Y.m.d' 
)

If the recent post within a day, output format of YmdHis is "min/hours ago from now". If not within a day, it return format string.

Parameters
string$dateTime value in format of YYYYMMDDHHIISS
string$formatIf gap is within a day, returns this format.
Returns
string

Definition at line 641 of file func.inc.php.

getUrl ( )

Get a encoded url. Define a function to use Context::getUrl()

getUrl() returns the URL transformed from given arguments of RequestURI

  1. argument format follows as (key, value). ex) getUrl('key1', 'val1', 'key2',''): transform key1 and key2 to val1 and '' respectively
  2. returns URL without the argument if no argument is given.
  3. URL made of args_list added to RequestUri if the first argument value is ''.
Returns
string

Definition at line 297 of file func.inc.php.

getView (   $module_name)

Create a view instance of the module

Parameters
string$module_nameThe module name to get a view instance
Returns
mixed Module view instance

Definition at line 112 of file func.inc.php.

getWAP (   $module_name)

Create a wap instance of the module

Parameters
string$module_nameThe module name to get a wap instance
Returns
mixed Module wap class instance

Definition at line 178 of file func.inc.php.

handleError (   $errno,
  $errstr,
  $file,
  $line 
)

Change error_handing to debugPrint on php5 higher

Parameters
int$errno
string$errstr
string$file
int$line
Returns
void

Definition at line 1057 of file func.inc.php.

htmlFooter ( )

Print raw html footer

Returns
void

Definition at line 1727 of file func.inc.php.

htmlHeader ( )

Print raw html header

Returns
void

Definition at line 1712 of file func.inc.php.

isCrawler (   $agent = NULL)

Get is current user crawler

Parameters
string$agentif set, use this value instead HTTP_USER_AGENT
Returns
bool

Definition at line 1538 of file func.inc.php.

isDefinedLangCode (   $str)

Definition at line 1784 of file func.inc.php.

isSiteID (   $domain)

Return if domain of the virtual site is url type or id type

Parameters
string$domain
Returns
bool

Definition at line 495 of file func.inc.php.

json_encode2 (   $data)

get json encoded string of data

Parameters
mixed$data
Returns
string

Definition at line 1495 of file func.inc.php.

if (!function_exists('hexrgb')) mysql_pre4_hash_password (   $password)

Php function for mysql old_password() provides backward compatibility for zero board4 which uses old_password() of mysql 4.1 earlier versions. the function implemented by referring to the source codes of password.c file in mysql

Parameters
string$password
Returns
string

Definition at line 1325 of file func.inc.php.

purifierHtml ( $content)

Definition at line 1103 of file func.inc.php.

recurciveExposureCheck ( $menu)

menu exposure check by isShow column

Parameters
array$menu
Returns
void

Definition at line 1670 of file func.inc.php.

reload (   $isOpener = FALSE)

Print raw reload script

Parameters
bool$isOpener
Returns
void

Definition at line 1772 of file func.inc.php.

removeHackTag (   $content)

Pre-block the codes which may be hacking attempts

Parameters
string$contentTaget content
Returns
string

Remove codes to abuse the admin session in src by tags of imaages and video postings

  • Issue reported by Sangwon Kim

Definition at line 1123 of file func.inc.php.

removeSrcHack (   $match)

Remove src hack(preg_replace_callback)

Parameters
array$match
Returns
string

Convert hexa value to RGB

Parameters
string$hexstr
Returns
array

Definition at line 1202 of file func.inc.php.

requirePear ( )

Require pear

Returns
void

Definition at line 1603 of file func.inc.php.

setUserSequence (   $seq)

Set Sequence number to session

Parameters
int$seqsequence number
Returns
void

Definition at line 250 of file func.inc.php.

stripEmbedTagForAdmin ( $content,
  $writer_member_srl 
)

Remove embed media for admin

Parameters
string$content
int$writer_member_srl
Returns
void

Definition at line 1568 of file func.inc.php.

url_decode (   $str)

Decode the URL in Korean

Parameters
string$strThe url
Returns
string

Definition at line 1098 of file func.inc.php.

utf8RawUrlDecode (   $source)

PHP unescape function of javascript's escape Function converts an Javascript escaped string back into a string with specified charset (default is UTF-8). Modified function from http://pure-essence.net/stuff/code/utf8RawUrlDecode.phps

Parameters
string$source
Returns
string

Definition at line 1393 of file func.inc.php.

writeSlowlog (   $type,
  $elapsed_time,
  $obj 
)
Parameters
string$typequery, trigger
float$elapsed_time
object$obj

Definition at line 909 of file func.inc.php.

zdate (   $str,
  $format = 'Y-m-d H:i:s',
  $conversion = TRUE 
)

Change the time format YYYYMMDDHHIISS to the user defined format

Parameters
string | int$strYYYYMMDDHHIISS format time values
string$formatTime format of php date() function
bool$conversionMeans whether to convert automatically according to the language
Returns
string

Definition at line 692 of file func.inc.php.

zgap ( )

Get a time gap between server's timezone and XE's timezone

Returns
int

Definition at line 564 of file func.inc.php.

ztime (   $str)

YYYYMMDDHHIISS format changed to unix time value

Parameters
string$strTime value in format of YYYYMMDDHHIISS
Returns
int

Definition at line 605 of file func.inc.php.

Variable Documentation

$time_zone

Definition at line 29 of file func.inc.php.