Custom function names should be all lower-case and should use underscores to separate words.
$var2 = issomething($var1); $var2 = isSomething($var2); $var2 = is_something($var1);
Group Prefix | Group Explanation | Example Functions |
print_ | Functions that directly print out code to the browser or output buffer via echo or print statements. |
|
construct_ | Functions that return variables containing HTML for later printing. |
|
is_ contains_ | Functions that return true/false based on conditions. |
|
can_ | Functions that return true/false based on permissions. |
|
verify_ | Functions that check conditions and directly drop out to an error message if certain conditions are met. |
|
convert_ | Functions that convert the input variable from one data format to another. |
|
cache_ | Functions that read data from the database (usually) and create PHP cache variables to lighten the SQL load. |
|
fetch_ | Functions that return arrays / strings / integers etc. If the data type to be returned is not explicit in the function name (such as fetch_template, fetch_userinfo etc.) then specify the type of data in the function name, such as fetch_template_update_sql, fetch_replaced_session_url, fetch_reminders_array etc. |
|
process_ | Functions that perform actions upon an array in order to prepare it for later reference. |
|
build_ | Functions that save data back to the database for later retrieval, such as caching birthdays into the datastore, rebuilding the style table etc. |
|
delete_ | Functions that delete something from the database. |
|
undelete_ | Functions that reverse a soft deletion. |
|
import_ | Functions from the bbimport system that take an array of data and insert it as a post/thread/user (etc.) record into the database. |
|
sanitize_ | Functions that make perform actions on the input parameters in order to make them safe for the next step, such as removing illegal characters, checking that a date is valid, that a $perpage value makes sense etc. |
|
parse_ | Functions that initialize the bbcode parsing process in some way. |
|
handle_ | Functions that are called by the bbcode parser to deal with a particular bbcode type. |
|
file_ | Functions that deal directly with the filesystem. |
|
log_ | Functions that append to one of vBulletin's logs. |
|
exec_ | Functions that actually perform an action rather than returning something. |
|
sort_ | Functions that sort data. |
|
strip_ | Functions that strip elements from strings |
|
xml_ | Functions that work to read or output XML. |
|
vb_ vb | Functions that replace built-in PHP functions with vBulletin replacements designed to extend functionality or otherwise alter the behavior of the built-in function. If the original function name contains underscores, prefix with 'vb_' otherwise prefix with 'vb'. |
|
js_ | Javascript functions defined within the PHP code (rather than being in one of the .js files). |
|