+If you wish to make changes to the calling data, you must declare them as reference variables (with '&') during function declaration.
+
+#### $a
+$a is the Friendica 'App' class.
+It contains a wealth of information about the current state of Friendica:
+
+* which module has been called,
+* configuration information,
+* the page contents at the point the hook was invoked,
+* profile and user information, etc.
+
+It is recommeded you call this '$a' to match its usage elsewhere.
+
+#### $b
+$b can be called anything you like.
+This is information specific to the hook currently being processed, and generally contains information that is being immediately processed or acted on that you can use, display, or alter.
+Remember to declare it with '&' if you wish to alter it.
+
+Modules
+---
+
+Plugins/addons may also act as "modules" and intercept all page requests for a given URL path.
+In order for a plugin to act as a module it needs to define a function "plugin_name_module()" which takes no arguments and needs not do anything.
+
+If this function exists, you will now receive all page requests for "http://my.web.site/plugin_name" - with any number of URL components as additional arguments.
+These are parsed into an array $a->argv, with a corresponding $a->argc indicating the number of URL components.
+So http://my.web.site/plugin/arg1/arg2 would look for a module named "plugin" and pass its module functions the $a App structure (which is available to many components).
+This will include:
+
+ $a->argc = 3
+ $a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
+
+Your module functions will often contain the function plugin_name_content(&$a), which defines and returns the page body content.
+They may also contain plugin_name_post(&$a) which is called before the _content function and typically handles the results of POST forms.
+You may also have plugin_name_init(&$a) which is called very early on and often does module initialisation.
+
+Templates
+---
+
+If your plugin needs some template, you can use the Friendica template system.
+Friendica uses [smarty3](http://www.smarty.net/) as a template engine.
+
+Put your tpl files in the *templates/* subfolder of your plugin.
+
+In your code, like in the function plugin_name_content(), load the template file and execute it passing needed values:
+
+ # load template file. first argument is the template name,
+ # second is the plugin path relative to friendica top folder
+ $tpl = get_markup_template('mytemplate.tpl', 'addon/plugin_name/');
+
+ # apply template. first argument is the loaded template,
+ # second an array of 'name'=>'values' to pass to template
+ $output = replace_macros($tpl,array(
+ 'title' => 'My beautiful plugin',
+ ));
+
+See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
+
+Current hooks
+-------------
+
+### 'authenticate'
+'authenticate' is called when a user attempts to login.
+$b is an array containing:
+
+ 'username' => the supplied username
+ 'password' => the supplied password
+ 'authenticated' => set this to non-zero to authenticate the user.
+ 'user_record' => successful authentication must also return a valid user record from the database
+
+### 'logged_in'
+'logged_in' is called after a user has successfully logged in.
+$b contains the $a->user array.
+
+### 'display_item'
+'display_item' is called when formatting a post for display.
+$b is an array:
+
+ 'item' => The item (array) details pulled from the database
+ 'output' => the (string) HTML representation of this item prior to adding it to the page
+
+### 'post_local'
+* called when a status post or comment is entered on the local system
+* $b is the item array of the information to be stored in the database
+* Please note: body contents are bbcode - not HTML
+
+### 'post_local_end'
+* called when a local status post or comment has been stored on the local system
+* $b is the item array of the information which has just been stored in the database
+* Please note: body contents are bbcode - not HTML
+
+### 'post_remote'
+* called when receiving a post from another source. This may also be used to post local activity or system generated messages.
+* $b is the item array of information to be stored in the database and the item body is bbcode.