plugin:imstatus
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:imstatus [2008-02-27 22:44] – 201.6.156.201 | plugin:imstatus [2012-07-25 20:06] (current) – Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== imstatus plugin ====== | ||
+ | ---- plugin ---- | ||
+ | description: | ||
+ | author | ||
+ | email : walter@torres.ws | ||
+ | type : syntax | ||
+ | lastupdate : 2008-01-12 | ||
+ | compatible : 2005-07-13+ | ||
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags : chat status embed | ||
+ | ---- | ||
+ | |||
+ | |||
+ | The plugin displays your (or any IDs) current online status. | ||
+ | |||
+ | This plugin uses the free services of http:// | ||
+ | \\ FIXME **The onlinestatus website seems out of service** | ||
+ | |||
+ | Thanks Gina for your help! | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | This syntax takes 2 parameters: | ||
+ | * Service name [AIM|IRC|MSN|Yahoo] | ||
+ | * IM login ID | ||
+ | |||
+ | < | ||
+ | {{imstatus> | ||
+ | </ | ||
+ | |||
+ | ===== Example ===== | ||
+ | Look at the bottom of my [[http:// | ||
+ | |||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | I don't know how to make an install package yet, so just copy the code below into **plugins/ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Plugin Source ===== | ||
+ | |||
+ | |||
+ | Here is the [[http:// | ||
+ | |||
+ | <code php |h The plugin' | ||
+ | <?php | ||
+ | |||
+ | /* | ||
+ | Gina told me | ||
+ | for markup, i usually go with: | ||
+ | * < | ||
+ | * {{command> | ||
+ | * tildes for configuration like (compare ~~NOTOC~~ and ~~NOCACHE~~) | ||
+ | */ | ||
+ | |||
+ | /** | ||
+ | * Plugin IM Status: Displays your current IM Service status" | ||
+ | | ||
+ | * @license | ||
+ | * @author | ||
+ | */ | ||
+ | |||
+ | if(!defined(' | ||
+ | if(!defined(' | ||
+ | require_once(DOKU_PLUGIN.' | ||
+ | |||
+ | /** | ||
+ | * All DokuWiki plugins to extend the parser/ | ||
+ | * need to inherit from this class | ||
+ | */ | ||
+ | class syntax_plugin_imstatus extends DokuWiki_Syntax_Plugin { | ||
+ | |||
+ | /** | ||
+ | * Get an associative array with plugin info. | ||
+ | * | ||
+ | * <p> | ||
+ | * The returned array holds the following fields: | ||
+ | * <dl> | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * (eg. syntax description)</ | ||
+ | * </dl> | ||
+ | * @param none | ||
+ | * @return Array Information about this plugin class. | ||
+ | * @public | ||
+ | * @static | ||
+ | */ | ||
+ | function getInfo(){ | ||
+ | return array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Get the type of syntax this plugin defines. | ||
+ | * | ||
+ | * @param none | ||
+ | * @return String < | ||
+ | * @public | ||
+ | * @static | ||
+ | */ | ||
+ | function getType(){ | ||
+ | return ' | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * What kind of syntax do we allow (optional) | ||
+ | */ | ||
+ | // function getAllowedTypes() { | ||
+ | // return array(); | ||
+ | // } | ||
+ | |||
+ | /** | ||
+ | * Define how this plugin is handled regarding paragraphs. | ||
+ | * | ||
+ | * <p> | ||
+ | * This method is important for correct XHTML nesting. It returns | ||
+ | * one of the following values: | ||
+ | * </p> | ||
+ | * <dl> | ||
+ | * < | ||
+ | * < | ||
+ | * plugin output.</ | ||
+ | * < | ||
+ | * </dl> | ||
+ | * @param none | ||
+ | * @return String < | ||
+ | * @public | ||
+ | * @static | ||
+ | */ | ||
+ | // function getPType(){ | ||
+ | // return ' | ||
+ | // } | ||
+ | |||
+ | /** | ||
+ | * Where to sort in? | ||
+ | * | ||
+ | * @param none | ||
+ | * @return Integer < | ||
+ | * @public | ||
+ | * @static | ||
+ | */ | ||
+ | function getSort(){ | ||
+ | return 280; | ||
+ | } | ||
+ | |||
+ | |||
+ | /** | ||
+ | * Connect lookup pattern to lexer. | ||
+ | * | ||
+ | * @param $aMode String The desired rendermode. | ||
+ | * @return none | ||
+ | * @public | ||
+ | * @see render() | ||
+ | */ | ||
+ | function connectTo($mode) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | // function postConnect() { | ||
+ | // $this-> | ||
+ | // } | ||
+ | |||
+ | |||
+ | /** | ||
+ | * Handler to prepare matched data for the rendering process. | ||
+ | * | ||
+ | * <p> | ||
+ | * The < | ||
+ | * which triggered the call to this method: | ||
+ | * </p> | ||
+ | * <dl> | ||
+ | * < | ||
+ | * <dd>a pattern set by < | ||
+ | * < | ||
+ | * <dd>a pattern set by < | ||
+ | * < | ||
+ | * <dd> a pattern set by < | ||
+ | * < | ||
+ | * <dd>a pattern set by < | ||
+ | * < | ||
+ | * < | ||
+ | * which doesn' | ||
+ | * </dl> | ||
+ | * @param $aMatch String The text matched by the patterns. | ||
+ | * @param $aState Integer The lexer state for the match. | ||
+ | * @param $aPos Integer The character position of the matched text. | ||
+ | * @param $aHandler Object Reference to the Doku_Handler object. | ||
+ | * @return Integer The current lexer state for the match. | ||
+ | * @public | ||
+ | * @see render() | ||
+ | * @static | ||
+ | */ | ||
+ | function handle($match, | ||
+ | $match = substr($match, | ||
+ | list($command, | ||
+ | return split(' | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Handle the actual output creation. | ||
+ | * | ||
+ | * <p> | ||
+ | * The method checks for the given < | ||
+ | * < | ||
+ | * contains a reference to the renderer object which is currently | ||
+ | * handling the rendering. The contents of < | ||
+ | * return value of the < | ||
+ | * </p> | ||
+ | * @param $aFormat String The output format to generate. | ||
+ | * @param $aRenderer Object A reference to the renderer object. | ||
+ | * @param $aData Array The data created by the < | ||
+ | * method. | ||
+ | * @return Boolean < | ||
+ | * < | ||
+ | * @public | ||
+ | * @see handle() | ||
+ | */ | ||
+ | function render($mode, | ||
+ | if($mode == ' | ||
+ | $l_srv = strtolower($data[0]); | ||
+ | $u_srv = strtoupper($data[0]); | ||
+ | $renderer-> | ||
+ | | ||
+ | | ||
+ | return true; | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | //Setup VIM: ex: et ts=4 enc=utf-8 : | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | ==== Changes ==== | ||
+ | |||
+ | |||
+ | ===== See also ===== | ||
+ | |||
+ | * [[plugin: | ||
+ | |||
+ | |||
+ | ===== Discussion ===== | ||
+ | Hints, comments, suggestions ... | ||
+ | |||
+ | |||
+ | == To work == | ||
+ | Hi, I change: | ||
+ | < | ||
+ | $renderer-> | ||
+ | </ | ||
+ | |||
+ | To: | ||
+ | |||
+ | < | ||
+ | $renderer-> | ||
+ | </ |