]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/JabberPresence.php
initial simple version
[SourceForge/phpwiki.git] / lib / plugin / JabberPresence.php
1 <?php // -*-php-*-
2 rcs_id('$Id: JabberPresence.php,v 1.1 2004-11-20 17:37:23 rurban Exp $');
3 /**
4  * A simple Jabber presence WikiPlugin.
5  * http://wiki.crao.net/index.php/JabberPr%E9sence/Source
6  * http://edgar.netflint.net/howto.php
7  *
8  * Usage:
9  *  <?plugin JabberPresence scripturl=http://edgar.netflint.net/status.php 
10  *                          jid=yourid@jabberserver type=html iconset=phpbb ?>
11  *
12  * @author: Arnaud Fontaine
13  */
14
15 class WikiPlugin_JabberPresence
16 extends WikiPlugin
17 {
18     // Five required functions in a WikiPlugin.
19     function getName () {
20         return _("JabberPresence");
21     }
22
23     function getDescription () {
24         return _("Simple jabber presence plugin");
25
26     }
27
28     function getVersion() {
29         return preg_replace("/[Revision: $]/", '',
30                             "\$Revision: 1.1 $");
31     }
32
33     // Establish default values for each of this plugin's arguments.
34     function getDefaultArguments() {
35         return array('scripturl' => "<mettez l'url de votre bot ici>",
36                      'jid'       => "",
37                      'type'      => 'image',
38                      'iconset'   => "gabber");
39     }
40
41     function run($dbi, $argstr, $request) {
42         extract($this->getArgs($argstr, $request));
43         // Any text that is returned will not be further transformed,
44         // so use html where necessary.
45         if (empty($jid))
46             $html = HTML();
47         else
48           $html = HTML::img(array('src' => urlencode($scripturl).
49                                   '&jid='.urlencode($jid).
50                                   '&type='.urlencode($type).
51                                   '&iconset='.($iconset)));
52         return $html;
53     }
54 };
55
56 // For emacs users
57 // Local Variables:
58 // mode: php
59 // tab-width: 8
60 // c-basic-offset: 4
61 // c-hanging-comment-ender-p: nil
62 // indent-tabs-mode: nil
63 // End:
64 ?>