anchor.diff:     
   
   
  -***Advanced Plugins***
  +[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; }
  
positive.code: [/code]
  we will create an argc/argv list for use by your module functions
  [code]
  	$x = argc(); $x will be 4, the number of path arguments after the sitename
  
  	for($x = 0; $x &lt; argc(); $x ++)
  		echo $x . ' ' . argv($x);
  
negative.code:  pluginname_uninstall()
  [/code]
  
  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() {
  	    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]
  