<?php
TODO
class presencePEP
{
private $defaultImage = 'defaultAvatar.png';
private $mssgInd = 'n/a';
function __construct($jid,$omniURL,$lang)
{
$jid_hash = md5($jid);
$this->url_jid_hash = $omniURL . $jid_hash;
$this->lang=$lang;
$this->avatar="avatar";
$this->avatarExt=".png";
$omniPEP = $this->url_jid_hash . "/pep";
$omniPEPMuse = $omniPEP . '/tune';
$this->omniPEPMuseAll = $omniPEPMuse . ".txt";
$this->omniPEPMuseArtist = $omniPEPMuse . "/artist.txt";
$this->omniPEPMuseSong = $omniPEPMuse . "/song.txt";
$this->omniPEPMoodImage = $omniPEP . "/mood/image.png";
$this->omniPEPMoodAll = $omniPEP . "/mood-" . $lang . ".txt";
$this->omniPEPActiAll = $omniPEP . "/activity-" . $this->lang . ".txt";
$this->omniPEPActiImage = $omniPEP . "/activity/image.png";
}
public function Muse($w)
{
switch ($w) {
case "all":
$museAll = @file_get_contents( $this->omniPEPMuseAll );
echo empty($museAll) ? $this->mssgInd : $museAll;
break;
case "artist":
$museArtist = @file_get_contents( $this->omniPEPMuseArtist );
echo empty($museArtist) ? $this->mssgInd : $museArtist;
break;
case "song":
$museSong = @file_get_contents( $this->omniPEPMuseSong );
echo empty($museSong) ? $this->mssgInd : $museSong;
break;
default:
$museArtist = @file_get_contents( $this->omniPEPMuseArtist );
echo empty($museArtist) ? $this->mssgInd : $museArtist;
}
}
public function MoodImage()
{
echo $this->omniPEPMoodImage;
}
public function MoodAll()
{
$moodAll = @file_get_contents( $this->omniPEPMoodAll );
echo empty($moodAll) ? $this->mssgInd : $moodAll;
}
public function ActImage()
{
echo $this->omniPEPActiImage;
}
public function ActAll()
{
$actiAll = @file_get_contents( $this->omniPEPActiAll );
echo empty($actiAll) ? $this->mssgInd : $actiAll;
}
public function Avatar($size)
{
if ( $size == "96" xor $size == "80" xor $size == "64" xor $size == "32")
{
$urlAvatar = $this->url_jid_hash . "/" . $this->avatar . "-" . $size . $this->avatarExt;
echo $urlAvatar;
}else
{
$urlAvatar = $this->url_jid_hash . "/" . $this->avatar . $this->avatarExt;
echo $urlAvatar;
};
}
public function StatusIm($theme)
{
if ( $theme == "" or $theme == "default" or $theme == "crystal" )
{
$urlStatusIm = $this->url_jid_hash . "/" . "image-default.png";
echo $urlStatusIm;
}
elseif ( $theme == "stellar" xor theme == "adiumy" xor $theme == "dcraven" xor $theme == "jabberlogo" )
{
$urlStatusIm = $this->url_jid_hash . "/" . "image-" . $theme . ".png";
echo $urlStatusIm;
};
}
public function Status($w )
{
switch ($w) {
case "status":
$urlStatusTxt = $this->url_jid_hash . "/text-" . $this->lang . ".txt";
$statusTxt = @file_get_contents( $urlStatusTxt );
echo empty($statusTxt) ? $this->mssgInd : $statusTxt;
break;
case "message":
$urlStatusMess = $this->url_jid_hash . "/message.txt";
$statusMess = @file_get_contents( $urlStatusMess );
echo empty($statusMess) ? $this->mssgInd : $statusMess;
break;
default:
$urlStatusTxt = $this->url_jid_hash . "/text-" . $this->lang . ".txt";
$statusTxt = @file_get_contents( $urlStatusTxt );
echo empty($statusTxt) ? $this->mssgInd : $statusTxt;
break;
}
}
}
?>