Showing your status on Jabber
Last edited by
PivWan:
Modified links pointing to docs server
Version: 0.5
Idea taken from
CraoWiki∞, so "toute coincidence ne serait pas fortuite". It is based on
Edgar∞ script so will try to implement all its functionnalities.
The action will be written in this form:
{{jabberpresence jid="wikka@jsnx.com" iconset="phpbb" type="html" iconset="phpbb"}}
and result of this will be:
wikka@jsnx.com/Psi
Available iconsets
- gabber:

- stellar:

- dudes:

- icq:

- licq:

- phpbb:

- invision:

- frickenhuge:

The code
<?php
/**
* Jabber Presence Action
* Displays selected user jabber status.
*
* @version 0.5
* @filename: jabberpresence.php
* @author: PivWan (based on a CraoWiki plugin)
* @email: pivwan@gmail.com
* @date:
* @license: GPL
*
* @description: A small action (first one) to display your jabber status (any server) on wikka.
* @usage: insert {{jabberpresence jid="jid@server.net"}}
* @param jid (required): user's jid
* @param type (optionnal): displays status as image, text or both (default: both). Allowed values are "image", "text" and "html"
* @param iconset (optionnal): if type=image or html, displays icon from selected iconset (see edgar's homepage or wikka for examples) (default gabber)
*/
// If you're using your own edgar install, change URI below
$base_edgar_uri =
"http://edgar.netflint.net/status.php";
// Default values.
(!
empty($vars['type'])) ?
$type=
$vars['type']:
$type=
"html";
(!
empty($vars['iconset'])) ?
$iconset=
$vars['iconset']:
$iconset=
"gabber";
// jid is required!
if($vars['jid']!=
'' && !
empty($vars['jid']))
{
$edgar_uri =
$base_edgar_uri.
"?jid=".
$vars['jid'].
"&type=".
$type.
"&iconset=".
$iconset;
if($type!=
'image')
echo file_get_contents($edgar_uri);
else
{
echo $this->
Action('{{image alt="Jabber status for '.
$vars['jid'].
'" title="Jabber status for '.
$vars['jid'].
'" url="'.
$edgar_uri.
'"}}');
}
}
else
{
echo "No JID defined.";
}
?>
It's very simple, as this is my first action.
CategoryUserContributions