| Helpers |
Various functions used throughout Chyrp’s code. |
| Variables |
|
| $time_start |
Times Chyrp. |
| $l10n |
Stores loaded gettext domains. |
| Functions |
|
| session |
Begins Chyrp’s custom session storage whatnots. |
| error |
Shows an error message. |
| show_403 |
Shows an error message with a 403 status. |
| logged_in |
Returns whether or not they are logged in by returning the Visitor.$id (which defaults to 0). |
| load_translator |
Loads a .mo file for gettext translation. |
| __ |
Returns a translated string. |
| _p |
Returns a plural (or not) form of a translated string. |
| _f |
Returns a formatted translated string. |
| redirect |
Redirects to the given URL and exits immediately. |
| url |
Mask for Route->url(). |
| pluralize |
Returns a pluralized string. This is a port of Rails’s pluralizer. |
| depluralize |
Returns a depluralized string. This is the inverse of pluralize. |
| truncate |
Truncates a string to the passed length, appending an ellipsis to the end. |
| when |
Returns date formatting for a string that isn’t a regular time() value |
| datetime |
Returns a standard datetime string based on either the passed timestamp or their time offset, usually for MySQL inserts. |
| fix |
Returns a HTML-sanitized version of a string. |
| unfix |
Returns the reverse of fix(). |
| lang_code |
Returns the passed language code (e.g. en_US) to the human-readable text (e.g. English (US)) |
| sanitize |
Returns a sanitized string, typically for URLs. |
| trackback_respond |
Responds to a trackback request. |
| trackback_send |
Sends a trackback request. |
| send_pingbacks |
Sends pingback requests to the URLs in a string. |
| grab_urls |
Crawls a string for links. |
| pingback_url |
Checks if a URL is pingback-capable. |
| camelize |
Converts a given string to camel-case. |
| decamelize |
Decamelizes a string. |
| selected |
If $val1 == $val2, outputs ‘ selected=”selected”’ |
| checked |
If $val == 1 (true), outputs ‘ checked=”checked”’ |
| module_enabled |
Returns whether the given module is enabled or not. |
| feather_enabled |
Returns whether the given feather is enabled or not. |
| fallback |
Gracefully falls back a given variable if it’s empty or not set. |
| random |
Returns a random string. |
| unique_filename |
Makes a given filename unique for the uploads directory. |
| upload |
Moves an uploaded file to the uploads directory. |
| upload_from_url |
Copy a file from a specified URL to their upload directory. |
| timer_start |
Starts the timer. |
| timer_stop |
Stops the timer and returns the total time. |
| normalize |
Attempts to normalize all newlines and whitespace into single spaces. |
| get_remote |
Grabs the contents of a website/location. |
| self_url |
Returns the current URL. |
| show_404 |
Shows a 404 error message, extracting the passed array into the scope. |
| set_locale |
Set locale in a platform-independent way |
| sanitize_input |
Makes sure no inherently broken ideas such as magic_quotes break our application |
| match |
Try and match a string against an array of regular expressions. |
| cancel_module |
Temporarily removes a module from $config->enabled_modules. |
| timezones |
Returns an array of timezones that have unique offsets. Doesn’t count deprecated timezones. |
| set_timezone |
Sets the timezone. |
| get_timezone() |
Returns the current timezone. |
| error_panicker |
Exits and states where the error occurred. |
| keywords |
Handle keyword-searching. |
| init_extensions |
Initialize all Modules and Feathers and return them as two arrays. |