imPrintJsError($docType) ⇒ Void
Prints an error that warns the user that JavaScript is not enabled, then redirects to the previous page after 5 seconds.
Kind: global function
| Param | Type | Description |
|---|---|---|
| $docType | Boolean |
True to use the meta redirect with a complete document. False to use a javascript code. |
imPrintError($message, $docType) ⇒ Void
Prints a custom error message then redirects to the previous page after 5 seconds.
Kind: global function
| Param | Type | Description |
|---|---|---|
| $message | String |
The message to show |
| $docType | Boolean |
True to use the meta redirect with a complete document. False to use a javascript code. |
imCheckAccess($page, $pathToRoot) ⇒ Void
Check if the current user can access to the provided page id.
If not, the user is redirected to the login page.
Kind: global function
| Param | Type | Description |
|---|---|---|
| $page | String |
The id of the page to check |
| $pathToRoot | String |
The path to reach the root from the current folder |
showGuestBook($id, $filepath, $email, $captcha, $direct_approval) ⇒ Void
Show the guestbook
This function is provided as compatibility for v9 guestbook widget
Kind: global function
| Param | Type | Description |
|---|---|---|
| $id | String |
The guestbook id |
| $filepath | String |
The folder where the comments must be stored |
String |
The email to notify the new comments | |
| $captcha | Boolean |
true to show the captcha |
| $direct_approval | Boolean |
true to directly approve comments |
getDbData($dbid) ⇒ Array
Provide the database connection data of given id
Kind: global function
Returns: Array - an array like array('description' => '', 'host' => '', 'database' => '', 'user' => '', 'password' => '')
| Param | Type | Description |
|---|---|---|
| $dbid | String |
The database id |
shuffleAssoc($list) ⇒ Array
Shuffle an associative array
Kind: global function
Returns: Array - The shuffled array
| Param | Type | Description |
|---|---|---|
| $list | Array |
The array to shuffle |
imstripos($haystack, $needle, $offset) ⇒ Number
If you want to support PHP 4 code, use this function instead of stripos.
Kind: global function
Returns: Number - The position of the searched string
| Param | Type | Description |
|---|---|---|
| $haystack | String |
Where to search |
| $needle | String |
What to replace |
| $offset | Number |
Start searching from here |
l10n($id, $default) ⇒ String
Get a localization string.
The string is taken from the ones specified at step 1 of WSX5
Kind: global function
Returns: String - The localization
| Param | Type | Description |
|---|---|---|
| $id | String |
The localization key |
| $default | String |
The default string |
pathCombine($paths) ⇒ String
Combine a series of paths
Kind: global function
Returns: String - The path created combining the elements of the array
| Param | Type | Description |
|---|---|---|
| $paths | Array |
The array with the elements of the path |
imstrtolower($str) ⇒ String
Try to convert a string to lowercase using multibyte encoding
Kind: global function
| Param | Type |
|---|---|
| $str | String |
checkJsAndSpam($prt, $js) ⇒ Bool
Check for the valid data about spam and js
Kind: global function
| Param | Type | Description |
|---|---|---|
| $prt | String |
The spam post field name |
| $js | String |
The js post file name |
in_array_field($needle, $haystack, $all) ⇒ Boolean
Search if at least one element of $needle is in $haystack.
Kind: global function
| Param | Type | Description |
|---|---|---|
| $needle | Array |
Non-associative array |
| $haystack | Array |
Non-associative array |
| $all | Boolean |
Set to true to ensure that all the elements in $needle are in $haystack |
imFilterInput($var) ⇒ Mixed
Filter the var from unwanted input chars.
Basically remove the quotes added by magic_quotes
Kind: global function
Returns: Mixed - The filtered var
| Param | Type | Description |
|---|---|---|
| $var | Mixed |
The var to filter |
getLastAvailableDate($timeArr) ⇒ String
Get the most recent date in the provided array of PHP times that do not define a future time.
The date is provided in the RSS format Sun, 15 Jun 2008 21:15:07 GMT
Kind: global function
| Param | Type |
|---|---|
| $timeArr | Array |
updateQueryStringVar($name, $value) ⇒ String
Update the query string adding or updating a variable with a specified value
Kind: global function
Returns: String - The updated query string
| Param | Type | Description |
|---|---|---|
| $name | String |
The variable to be replaced |
| $value | String |
The value to set |
addressFromEmail($email) ⇒ String
Get the email address from a string formatted like "John Doe johndoe@email.com"
Kind: global function
Returns: String - The email address
| Param | Type | Description |
|---|---|---|
String |
The email string |
nameFromEmail($email) ⇒ String
Get the user name from a string formatted like "John Doe johndoe@email.com"
Kind: global function
Returns: String - The user name
| Param | Type | Description |
|---|---|---|
String |
The email string |
imRequestHeaders() ⇒ Array
If you want to get the request headers and still support PHP 4, use this function.
Kind: global function
Returns: Array - The request headers array or FALSE on failure