anchor.diff:   pluginname_uninstall()
   [/code]
   
  -Next we'll talk about **hooks**. Hooks are places in the $Projectname code where we allow plugins to do stuff. There are a [lot of these](help/Hooks), and they each have a name. What we normally do is use the pluginname_load() function to register a &quot;handler function&quot; for any hooks you are interested in. Then when any of these hooks are triggered, your code will be called.
  -
  -We register hook handlers with the 'register_hook()' function. It takes 3 arguments. The first is the hook we wish to catch, the second is the filename of the file to find our handler function (relative to the base of your $Projectname installation), and the third is the function name of your handler function. So let's create our randplace_load() function right now. 
  +Next we'll talk about [b]hooks[/b]. Hooks are places in the $Projectname code where we allow plugins to do stuff. There are a [url=[baseurl]/help/hooklist]lot of these[/url], and they each have a name. What we normally do is use the pluginname_load() function to register a &quot;handler function&quot; for any hooks you are interested in. Then when any of these hooks are triggered, your code will be called.
  +
  +We register hook handlers with the 'Zotlabs\Extend\Hook::register()' function. It typically takes 3 arguments. The first is the hook we wish to catch, the second is the filename of the file to find our handler function (relative to the base of your $Projectname installation), and the third is the function name of your handler function. So let's create our randplace_load() function right now. 
   
   [code]
   	function randplace_load() {
  -	    register_hook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
  -
  -    	register_hook('feature_settings', 'addon/randplace/randplace.php', 'randplace_settings');
  -    	register_hook('feature_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
  +	    Zotlabs\Extend\Hook::register('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
  +
  +        Zotlabs\Extend\Hook::register('feature_settings', 'addon/randplace/randplace.php', 'randplace_settings');
  +	    Zotlabs\Extend\Hook::register('feature_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
   
   	}
   [/code]
  
positive.code: Next we'll create an unload function. This is easy, as it just unregisters our hooks. It takes exactly the same arguments. 
  [code]
  	function randplace_unload() {
  	    unregister_hook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
  
      	unregister_hook('feature_settings', 'addon/randplace/randplace.php', 'randplace_settings');
      	unregister_hook('feature_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
  
  	}
  [/code]
  
  Hooks are called with two arguments. The first is always $a, which is our global App structure and contains a huge amount of information about the state of the web request we are processing; as well as who the viewer is, and what our login state is, and the current contents of the web page we're probably constructing.
  
  The second argument is specific to the hook you're calling. It contains information relevant to that particular place in the program, and often allows you to look at, and even change it. In order to change it, you need to add '&amp;' to the variable name so it is passed to your function by reference. Otherwise it will create a copy and any changes you make will be lost when the hook process returns. Usually (but not always) the second argument is a named array of data structures. Please see the &quot;hook reference&quot; (not yet written as of this date) for details on any specific hook. Occasionally you may need to view the program source to see precisely how a given hook is called and how the results are processed. 
  
  Let's go ahead and add some code to implement our post_local hook handler. 
  [code]
  	function randplace_post_hook($a, &amp;$item) {
  
  	    /**
      	 *
  
negative.code:    
  
  
  [h2]Advanced Plugins[/h2]
  
  Sometimes your plugins want to provide a range of new functionality which isn't provided at all or is clumsy to provide using hooks. In this case your plugin can also act as a 'module'. A module in our case refers to a structured webpage handler which responds to a given URL. Then anything which accesses that URL will be handled completely by your plugin.
  
  There are two ways to accomplish this. To create a module object use the following model:
  [code]
  
  	// Your module will consist of the name of your addon with an uppercase first character, within the Zotlabs\Module namespace
  
  	class Zotlabs\Module\Randplace extends Zotlabs\Web\Controller {
  		function init() { 
  			// init method is always called first if it exists 
  		}
  		function post() { 
  			// the post method is only called if there are $_POST variables present (e.g. the page request method is "post")
  		}
  		function get() {
  			// The get method is used to display normal content on the page
  			// whatever this function returns will be displayed in the page body
  		}
  	}
  [/code]
  
  The other option is to use a procedural interface. The $a argument to these function is obsolete, but must be present. 
  The key to this is to create a simple function named pluginname_module() which does nothing. 
  [code]
  	function randplace_module() { return; }
  