Mysmilies.net die Smilies Datenbank

Script oder Datei finden :

 
-Startseite
-Newsarchiv
-Newsletter
-Mein Dreamcodes
-Scripte
-eBooks
-Online Speicher
-Datenbanken
-Webseiten
-Trickfilm
-Web Grafiken
-Bildbearbeiter
-Browser
-EMail Software
-Ftp Clienten
-Betriebssysteme
-Texteditoren
-Wampserver
-Office Pakete
-Antivirus
-System Cleaner
-Recovery Tools
-Php Schnipsel
-Ajax Schnipsel
-VB Schnipsel
-Tutorials
-Workshops
-Webkatalog
-Leserforum
-Erweiterte Suche
-Sitemap
-Impressum
-neuste Downloads

1. Selfphp (1851)
2. Xampp OS X (1737)
3. Xampp Linux (1726)
4. Xampp Windows (1750)

-neuste Tutorials

1. Samsung S20 rooten (2172)
2. Gratis USA Nummer (15921)
3. RAID (14735)
4. Text auf Grafik (15588)


Tutorials ICQ-Status&WebPager

 

ICQ-Status&WebPager

Eine Klasse um den ICQ-Status zu ermitteln und/oder eine Message zu schicken

Code:

/*********************
* class.icq.php *
* - version: 1.0 *
* - last update: 2001-04-27 *
* *
* THIS SCRIPT IS FREE *
* Feel free to edit, modify and redistribute, *
* as long as this message is kept intact. *
* author: Yves Berkholz (Loopstar GbR) [Germany]
* *
*****************
* ClassDescription *
*****************
* cICQ *
* -> setUIN($UIN) *
* #UIN - set a new UIN *
* return TRUE by default *
* *
* -> getUIN() *
* return: *
* ICQ_NO_UIN - if no UIN was set *
* current UIN *
* *
* -> getErrorCode() *
* return current errornummer (check if ICQ_SOCKED_ERROR was returned) *
* *
* -> getErrorMessage() *
* return current errormessage (check if ICQ_SOCKED_ERROR was returned) *
* *
* -> sendWebMessage($from, $email, $subject, $message) *
* #from - who send the message *
* #email - email-address of person who send message *
* #subject - subject of message *
* #message - messagebody *
* returns: *
* ICQ_SOCKED_ERROR - if an socket error occured *
* ICQ_NO_UIN - if no UIN was set *
* ICQ_PAGER_OK - if message was send successfully *
* ICQ_SOCKED_ERROR - if an socket error occured *
* *
* -> getOnlineStatus() *
* returns: *
* ICQ_SOCKED_ERROR - if an socket error occured *
* ICQ_NO_UIN - if no UIN was set *
* ICQ_STATUS_ONLINE - if user is online *
* ICQ_STATUS_OFFLINE - if user is offline *
* ICQ_STATUS_DISABLED - if icq-account is disabled *
* *
*****************
* Usage *
*****************
include("class.icq.php");
$myICQ = new cICQ("1234567");
echo $myICQ -> getOnlineStatus();
echo $myICQ -> sendWebMessage("Pseudo", "test@test.net", "Subject-Bla", "Message-BlaBlaBlaBlaBla");
***************** /


if(!defined("ICQ_STATUS_ONLINE"))
define("ICQ_STATUS_ONLINE","online");

if(!defined("ICQ_STATUS_OFFLINE"))
define("ICQ_STATUS_OFFLINE","offline");

if(!defined("ICQ_STATUS_DISABLED"))
define("ICQ_STATUS_DISABLED","disabled");

if(!defined("ICQ_STATUS_UNKNOWN"))
define("ICQ_STATUS_UNKNOWN","unknown");

if(!defined("ICQ_PAGER_OK"))
define("ICQ_PAGER_OK","message was send");

if(!defined("ICQ_SOCKED_ERROR"))
define("ICQ_SOCKED_ERROR","error connecting host");

if(!defined("ICQ_NO_UIN"))
define("ICQ_NO_UIN","no UIN was set");

/* edit only if you realy know what you do :-) */
if(!defined("ICQ_PAGER_PATH"))
define("ICQ_PAGER_PATH","/scripts/WWPMsg.dll");
if(!defined("ICQ_STATUS_PATH"))
define("ICQ_STATUS_PATH","/scripts/online.dll");
if(!defined("ICQ_HOST"))
define("ICQ_HOST","wwp.icq.com");
if(!defined("ICQ_PORT"))
define("ICQ_PORT","80");


class cICQ
{
var $cmd;
var $UIN;
var $intErrNr;
var $strErrMsg;

/***************** /
function cICQ($UIN)
{
$this -> setUIN($UIN);
$this -> clearCMD();
}
/***************** /
function setUIN($UIN)
{
$this -> UIN = $UIN;
$this -> clearErr();
return TRUE;
}
function getUIN()
{
if(!empty($this -> UIN))
return $this -> UIN;
else
return ICQ_NO_UIN;
}
/***************** /
function clearCMD()
{
$this -> cmd = "";
}
/***************** /
function clearErr()
{
$this -> intErrNr = "";
$this -> strErrMsg = "";
}

function setErr($intErrNR, $strErrMsg)
{
$this -> intErrNr = $intErrNR;
$this -> strErrMsg = $strErrMsg;
}

function getErrorCode()
{
return $this -> intErrNr;
}

function getErrorMessage()
{
return $this -> strErrMsg;
}
/***************** /
function sendWebMessage($from, $email, $subject, $message)
{
if(!empty($this -> UIN))
{
$this -> clearCMD();
$this -> clearErr();

$this -> cmd = "POST " . ICQ_PAGER_PATH . " HTTP/1.1\r\n";
$this -> cmd .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*\r\n";
$this -> cmd .= "Accept-Language: en-us\r\n";
$this -> cmd .= "Content-Type: application/x-www-form-urlencoded\r\n";
$this -> cmd .= "Accept-Encoding: gzip, deflate\r\n";
$this -> cmd .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95)\r\n";
$this -> cmd .= "Host: " . ICQ_HOST . "\r\n";

$command = "from=" . $from . "&fromemail=" . $email . "&subject=" . $subject . "&body=" . $message . "&to=" . $this -> UIN . "&Send=Send+Message";

$this -> cmd .= "Content-Length: " . strlen($command) . "\r\n";
$this -> cmd .= "Connection: Keep-Alive\r\n\r\n";
$this -> cmd .= $command . "\r\n\r\n";

$fp = fsockopen (ICQ_HOST, ICQ_PORT, &$errno, &$errstr, 30);
if (!$fp)
{
$this -> setErr($errno, $errstr);
return ICQ_SOCKED_ERROR;
}
else
{
fputs($fp, $this -> cmd);
return ICQ_PAGER_OK;
fclose($fp);
}
}
else
return ICQ_NO_UIN;
}

/***************** /

function getOnlineStatus()
{
if(!empty($this -> UIN))
{
$this -> clearCMD();
$this -> clearErr();

$this -> cmd = "GET " . ICQ_STATUS_PATH . "?icq=" . $this -> UIN . "&img=5 HTTP/1.0\n\n";
$fp = fsockopen (ICQ_HOST, ICQ_PORT, &$errno, &$errstr, 30);
if(!$fp)
{
$this -> setErr($errno, $errstr);
return ICQ_SOCKED_ERROR;
}
else
{
fputs($fp, $this -> cmd);
$do = FALSE;
while(!feof($fp))
{
$line = fgets($fp, 128);
$do = ($do) ? TRUE : (eregi("^GIF89", $line)) ? TRUE : FALSE;
if($do)
{
if(ereg("á7@ ±40", $line))
{
return ICQ_STATUS_ONLINE;
}
elseif(ereg("áw` ±40", $line))
{
return ICQ_STATUS_OFFLINE;
}
elseif(ereg("S³IѱèJ", $line))
{
return ICQ_STATUS_DISABLED;
}
}
}
fclose($fp);
}
}
else
return ICQ_NO_UIN;
}
}
?>

 
Seiten : 1
hinzugefügt am : 19.03.2003
Autor : Q
Listings ID : 119
Status zum lesen : Gast
gelesen : 7631 mal
[Text bewerten] [Druckansicht] [Lesercharts] [RSS] [zur Übersicht]
 
 

Die Möglichkeit diesen Artikel zu verlinken :

HTML-Code:

Code zum Einbinden in ein Forum:


Hinweis : Das lesen des Artikels ICQ-Status&WebPager - listings ID: 119 auf Dreamcodes, sowie Link Verweise auf Internetseiten fremder Anbieter erfolgen auf eigene Gefahr. Dreamcodes haftet nicht für Schäden, die aus der Verwendung des Inhaltes der Artikel erfolgen könnten. Schadenersatzansprüche, aus welchem Rechtsgrund auch immer, sind ausgeschlossen !
-Live Statistik
Datum: 22.11.2024
Uhrzeit: 00:26 Uhr
Online: 23 User
User heute: 466
User allgem.: 35311123

Eingeloggt als Gast
-Download des Monats
-
-unsere Monats Umfrage
Welche Serie ist besser?

The Blacklist
House of the Dragon
Die Ringe der Macht
The Sandman
Manifest

-unsere Bestseller