PHP Classes
elePHPant
Icontem

File: chat

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of johno dread  >  Yahoo MSN chat  >  chat  >  Download  
File: chat
Role: Example script
Content type: text/plain
Description: shows all users on line
Class: Yahoo MSN chat
Determine if Yahoo or MSN users are online
Author: By
Last change:
Date: 5 years ago
Size: 2,662 bytes
 

Contents

Class file image Download
<?php

/**
 * @copyright 2010
 */
 

   
include("TYahooStatus.php");
   
$userstatus = new TYahooStatus ();
   
   
$status = false;
   
    echo
"<table width='50%'><tr bgcolor='#F2F3F1'><td>ID</td><td>Email </td><td width='30%'>&nbsp;&nbsp;Online Status</td></tr>";
    if(isset(
$_GET['users']) && $_GET['users'] == 1)
    {
       
$users = $userstatus->get_users_online();
            
        foreach(
$users as $k => $val)
        {
           
// yahoo accepts ids without the '@yahoo.com'
           
if(strpos($val,'yahoo.com'))
            {
               
$val = substr($val,0,strpos($val,"@"));
           
// get yahoo status
           
$is_online = $userstatus->execute ($val, $errno, $errstr);
           
            if(
$is_online == 1)
                echo
"<tr><td>".$k."</td><td>&nbsp;$val</td><td>&nbsp;&nbsp;<a style='text-decoration:none;color:red;' target ='_blank' href='http://edit.yahoo.com/config/send_webmesg?target=$val&.src=pg'><img border=0 src='http://opi.yahoo.com/online?u=$val&m=g&t=2'></a></td></tr> ";
            elseif(
$is_online == 2)
                echo
"<tr><td>".$k."</td><td>&nbsp;$val</td><td>&nbsp;&nbsp;<img border=0 src='http://opi.yahoo.com/online?u=$val&m=g&t=2'></td></tr> ";
            }
            elseif(
strpos($val,'hotmail.com'))
            {
               
$msn_status = $userstatus->msn_status($val);
                if(
$msn_status == "www.braintechnosys.com/images/msnoffline.png")
                   
$status = 'Not Online';
                elseif(
$msn_status == "www.braintechnosys.com/images/msnonline.png")
                   
$status = 'I\'m Online';
                else
                   
$status = 'unknown';
               
                     echo
"<tr><td>".$k."</td><td>&nbsp;$val</td><td>&nbsp;&nbsp;<img src='http://www.funnyweb.dk:8080/msn/$val/onurl=www.braintechnosys.com/images/msnonline.png/offurl=www.braintechnosys.com/images/msnoffline.png/unknownurl=www.braintechnosys.com/images/msnoffline.png' alt='My MSN status'/>&nbsp;&nbsp;$status</td></tr> ";
           
            }
           
        }
    }
   
/* //<img src="http://www.funnyweb.dk:8080/msn/<?php echo $msn_id; ?>/onurl=www.braintechnosys.com/images/msnonline.png/offurl=www.braintechnosys.com/images/msnoffline.png/unknownurl=www.braintechnosys.com/images/msnoffline.png" style="border: none;" alt="My MSN status"/>*/
   
echo "</table>";
       
?>


<style>
body
{
    margin:20px;
}
hr
{
  width: 1px;
  color:#CCC;
}
.fieldsCollection
{
    padding:5px;
}

table { border: outset 1pt;
             border-collapse: collapse;
             border-spacing: 1pt }
td { border: 1px solid #CCC; }
td.special { border: inset 1pt } /* The top-left cell */

</style>
 <hr />
<form method="GET" action="<?php echo $_SERVER['PHP_SELF'];?>"> <input type="hidden" name="users" value="1"/><input type="submit" value="Show Online Users"/></form>