Revision [9449]

This is an old revision of AncestorPage made by PivWan on 2005-06-22 19:35:20.

 

Showing your status on Jabber


Last edited by PivWan:
Cloned from JabberPresence
Wed, 22 Jun 2005 19:35 UTC [diff]


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 Jabber status for wikka@jsnx.com


Available iconsets



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
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki