I have modified my reptags for the Skype and ICQ status, written in 2006:
ICQ-Status (Copy the code into a new file, for example: reptag_ICQ.php and place this file in the frontend_render directory):
Code: Select all
<?php
/************************************************************************************************************************************
REPTAG CODE: {ICQ:starttext:spacer1:number:spacer2:alt:title:image:align}
Developer: Joachim Scholtysik
Homepage: http://www.scholtysik.net
phpwcms Version: 1.3.9
last modified: 23.05.2008
23.05.2008: Added phpwcms constants check written by O.G.
22.05.2008: Added two new parameters for spacers before and after the ICQ Account number
07.02.2006: Added closing tag </a>
02.02.2006: Initial release
Description:
Shows a status line for ICQ.
Installation:
Copy this file into the frontend_render directory
Place this line into your template or article:
{ICQ:starttext:spacer1:number:spacer2:alt:title:image:align}
where
- starttext is the introducing text for the status line ($1)
- spacer1 is the number of the spaces between the introducing text and your account number ($2)
- number is your ICQ account ($3)
- spacer2 is the number of the spaces between your account number and the ICQ image ($4)
- alt is the alt text for the ICQ image ($5)
- title is the title text for the ICQ image ($6)
- image is the number of the ICQ image (1-10) ($7)
- align is the alignment of the ICQ image (top, middle, bottom) ($8)
************************************************************************************************************************************/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
if( ! (strpos($content["all"],'{ICQ:')===false)) {
$content["all"] = preg_replace('/\{ICQ:(.*?):(\d+):(\d+):(\d+):(.*?):(.*?):(\d+):(.*?)\}/','$1: <img src="img/leer.gif" width="$2" height="10px" border="0" alt="" /> $3 <img src="img/leer.gif" width="$4" height="10px" border="0" alt="" /> <img alt="$5" title="$6" src="http://status.icq.com/online.gif?icq=$3&img=$7" align="$8" /></a>',$content["all"]);
}
?>
Skype-Status (Copy the code into a new file, for example: reptag_SKYPE.php and place this file in the frontend_render directory):
Code: Select all
<?php
/************************************************************************************************************************************
REPTAG CODE: {SKYPE:starttext:spacer1:name:spacer2:alt:title:folder:align}
Developer: Joachim Scholtysik
Homepage: http://www.scholtysik.net
phpwcms Version: 1.3.9
last modified: 23.05.2008
23.05.2008: Added phpwcms constants check written by O.G.
22.05.2008: Added two new parameters for spacers before and after the Skype name
07.02.2006: Added closing tag </a>
02.02.2006: Initial release
Description:
Shows a status line for Skype.
Installation:
Copy this file into the frontend_render directory
Place this line into your template or article:
{SKYPE:starttext:spacer1:name:spacer2:alt:title:folder:align}
where
- starttext is the introducing text for the status line ($1)
- spacer1 is the number of the spaces between the introducing text and your Skype name ($2)
- name is your Skype name ($3)
- spacer2 is the number of the spaces between your Skype name and the Skype image ($4)
- alt is the alt text for the Skype image ($5)
- title is the title text for the Skype image ($6)
- folder is the folder for the Skype image, with slash (bigclassic/, smallclassic/, smallicon/) ($7)
- align is the alignment of the Skype image (top, middle, bottom) ($8)
************************************************************************************************************************************/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
if( ! (strpos($content["all"],'{SKYPE:')===false)) {
$content["all"] = preg_replace('/\{SKYPE:(.*?):(\d+):(.*?):(\d+):(.*?):(.*?):(.*?):(.*?)\}/','$1: <img src="img/leer.gif" width="$2" height="10px" border="0" alt="" /> $3 <img src="img/leer.gif" width="$4" height="10px" border="0" alt="" /> <img alt="$5" title="$6" src="http://mystatus.skype.com/$7$3" align="$8" /></a>',$content["all"]);
}
?>
And I wanted to see, how many users are online at my site, so I created this new reptag (runs without a real database, only with a flat file):
Users Online (Copy the code into a new file, for example: reptag_useronline.php and place this file and also a blank "count.txt" in the frontend_render directory):
Code: Select all
<?php
/************************************************************************************************************************************
REPTAG CODE: {ONLINE}
Developer: Joachim Scholtysik
Homepage: http://www.scholtysik.net
phpwcms Version: 1.3.9
last modified: 18.06.2008
18.06.2008: Fix: Changed order of the variables $zeiten and $ips in the array
23.05.2008: Added phpwcms constants check written by O.G.
22.05.2008: Initial release
Description:
Shows a status line with users who are online.
Installation:
Copy this file into the frontend_render directory
Create a blank file named "count.txt" and place it also in the frontend_render directory (CHMOD: 777)
Place this line into your template or article:
{ONLINE}
************************************************************************************************************************************/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
if( ! (strpos($content["all"],'{ONLINE}')===false)) {
$content["all"] = preg_replace('/\{ONLINE\}/',online(),$content["all"]);
}
function online() {
$daten = $_SERVER['DOCUMENT_ROOT']."template/inc_script/frontend_render/count.txt";
$time = time();
$ip = getenv("REMOTE_ADDR");
$ablaufzeit = $time - "300";
$pruefung = @file($daten);
while (list ($line_num, $line) = @each ($pruefung)) {
$zeiten = explode("&&",$line);
if($zeiten[1] <= $ablaufzeit) {
$fp = fopen( "$daten", "r" );
$contents = fread($fp, filesize($daten));
fclose($fp);
$line=quotemeta($line);
$string2 = "";
$replace = ereg_replace($line, $string2, $contents);
$fh=fopen($daten, "w");
@flock($fp,2);
fputs($fh, $replace);
@flock($fp,3);
fclose($fh);
}
}
$ippruefung = @file($daten);
while (list ($line_num, $line) = @each ($ippruefung)) {
$ips = explode("&&",$line);
if($ips[0] == $ip) {
$fp = fopen( "$daten", "r" );
$contents = fread($fp, filesize($daten));
fclose($fp);
$line=quotemeta($line);
$string2 = "";
$replace = ereg_replace($line, $string2, $contents);
$fh=fopen($daten, "w");
@flock($fp,2);
fputs($fh, $replace);
@flock($fp,3);
fclose($fh);
}
}
$fp = fopen("$daten", "a+");
flock($fp,2);
fputs ($fp, "$ip&&$time&&\n");
flock($fp,3);
fclose ($fp);
$anzahldaten = file($daten);
$anzahl = count($anzahldaten);
$online=$anzahl." User(s) online";
return $online;
}
?>
Perhaps you will find it useful...
Joachim