Location: PHPKode > projects > XmlWeblication > weblication/content/articles/doc_modules_sample.xml
<?xml version="1.0" encoding="utf-8"?>


  <article aid="doc_modules_sample">
    <htmltemplate include="article.html"></htmltemplate>
	<contentmenu aid="documentation" />
	
	<title>Modules - A Sample</title>
	<intro>[LINK:doc_modules] are used to extend the functionality of [@:weblication].
	</intro>
	<author email="hide@address.com">Andi</author>
	<date>Dec 12th 2003</date>
		
		
	 [@:0] Target
	 [@:p] The following sample shows a small Module to demonstrate
	       how to deal with system-calls. To activate this module
				 {ul}
				   {li}Write (or copy) {strong}downloadcounter.php{/strong} to
					     {strong}[@:weblication]/modules/downloadcounter.php{/strong}
					 {li}Next any function you need provide one function called 
					     {strong}module_downloadcounter(){/strong}.
					 {li}This function has to return the output of your module as a string.
					 {li}Append the Module at end of {strong}config.php{/strong} by
					     inserting a line like:{BR}{strong}require_once("module/downloadcounter.php");{/strong}
					 {li}Use {strong}[_MODULE_:downloadcounter]{/strong} (without "_") somewhere in
					     your Articles, Menus, News or templates. Even using a Module
							 inside another Module is possible. In this case be carefull
							 to prevent from recursive callings!
		     {/ul}
				 
	 [@:0]Module's Sourcecode
	 [@:p][IMAGE:module_downloadcount.jpg]
				 
	 [@:0]Module Usage in a "menu".xml
	 [@:p][IMAGE:module_downloadcount_pic2.jpg]
	 
	 [@:0]Module's Output
	 [@:p][MODULE:downloadcounter]
				 
		
 </article>
Return current item: XmlWeblication