see http://phpdocu.sourceforge.net/ // +----------------------------------------------------------------------+ // | Author (TikiWiki): Damian Parker // | Reworked for Bitweaver (& Undoubtedly Screwed-Up) // | by: StarRider // +----------------------------------------------------------------------+ // $Id$ /** * definitions */ define( 'PLUGIN_GUID_DATAAGENTINFO', 'dataagentinfo' ); global $gLibertySystem; $pluginParams = [ 'tag' => 'AGENTINFO', 'auto_activate' => false, 'requires_pair' => false, 'load_function' => '\data_agentinfo', 'title' => 'AgentInfo', 'help_page' => 'DataPluginAgentInfo', 'description' => KernelTools::tra("This plugin will display the viewer's IP address, the Browser they are using, or the info about the site's Server software."), 'help_function' => '\data_agentinfo_help', 'syntax' => "{AGENTINFO info= }", 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAAGENTINFO, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAAGENTINFO ); /** * Help Function */ function data_agentinfo_help() { $help = '' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'' .'
' . KernelTools::tra( "Key" ) . '' . KernelTools::tra( "Type" ) . '' . KernelTools::tra( "Comments" ) . '
info' . KernelTools::tra( "string") . '
' . KernelTools::tra("(optional)") . '
' . KernelTools::tra( "Show information about the Browser being used.") . '
' .'ip: ' . KernelTools::tra( "To get the client\'s IP address (default)" ) . '
' .'browser: ' . KernelTools::tra( "To get the clients Browser infromation." ) . '
' .'server: ' . KernelTools::tra( "To get the site\'s server software" ) . '
' . KernelTools::tra("Example: ") . "{AGENTINFO info='browser'}"; return $help; } // Load Function function data_agentinfo($data, $params) { $info = 'IP'; extract ($params, EXTR_SKIP); switch (strtoupper ($info)) { case 'SVRSW': // To maintain Pre-Clyde Parameters case 'SERVER': $ret = $_SERVER["SERVER_SOFTWARE"]; return $ret; case 'BROWSER': $ret = $_SERVER["HTTP_USER_AGENT"]; return $ret; default: $ret = $_SERVER["REMOTE_ADDR"]; return $ret; } }