µ±Ç°Î»ÖãºLinux½Ì³Ì - Php - Ä£Äâ OICQ µÄʵÏÖ˼·ºÍºËÐijÌÐò(Ò») ת --½¨Òé¼ÓÈ뾫»ªÇø

Ä£Äâ OICQ µÄʵÏÖ˼·ºÍºËÐijÌÐò(Ò») ת --½¨Òé¼ÓÈ뾫»ªÇø

ÎÄÕÂÀ´Ô´:PHP ÊÀ¼ÍÍø
¸ù¾ÝÐí¶àÍøÓÑÐèÇó£¬ÌصذÑÎÒÕ¾µÄÕâ¸öÄ£Äâ OICQ µÄÔÚÏßÁÄÌìµÄ¶«Î÷Ï׸ø´ó¼Ò£¡

1 Óû§±ØÐë×¢²áµÇ½£¬ÔÚÊý¾Ý¿â userinfo ÀïÃæ±£´æÈçϼ¸¸ö×Ö¶Î
Name ²»ÓÃÎÊÁË£¬ÕâÊǵǽÓõÄÓû§Ãû£¬±ØÐëΨһ
Password µÇ½ÃÜÂë
NickName Óû§êdzƣ¬Ò²¾ÍÊÇÏÔʾµÄÃû×Ö
Face ´æ·Å×ÅÓû§Í·ÏñµÄ±àºÅ£¬±ÈÈç 01£¬´ú±í /images/face/01.gif Í·ÏñÎļþ
OnlineStatus Óû§ÊÇ·ñÔÚÏߵıêÖ¾£¬ÔÚÓû§µÇ½µÄʱºòÉèÖÃΪ 1
CurrentDate Óû§×îºó·ÃÎÊ/¸üеÄʱ¼ä£¬ÓÃÓÚÅжÏÓû§ÊÇ·ñÔÚÏß

ÁÄÌì¼Í¼ forumtalk µÄ½á¹¹Îª
CREATE TABLE forumtalk (
id int(11) NOT NULL auto_increment,
sender varchar(20) NOT NULL,
receiver varchar(20) NOT NULL,
date int(11) DEFAULT '0' NOT NULL,
readsign tinyint(4) DEFAULT '0' NOT NULL,
body varchar(200) NOT NULL,
PRIMARY KEY (id),
UNIQUE id_2 (id),
KEY id (id)
);
ÆäÖÐ sender ÊÇ·¢ËÍÈ赀 Name
receiver ÊǽÓÊÜÈ赀 Name
date ÊÇ·¢ÑÔµÄʱ¼ä
readsign ·¢ÑÔÊÇ·ñÒѾ­ÔĶÁ¹ý
body ·¢ÑÔÄÚÈÝ

2 ÏÔʾÔÚÏßÓû§µÄÍ·Ïñ
<?
$onlineresult = mysql_query("select Name,NickName,Face,EnterTimes from userinfo where OnlineStatus=1 and CurrentDate >".(date("U")-120));
$onlinenumber = mysql_num_rows($onlineresult);
echo "»¶Ó­¹âÁÙ£¬¹²ÓÐ:".$onlinenumber."λÅóÓÑÔÚÏߣ¬°´Í·Ïñ·¢¶ÌÐÅÏ¢:";
for($i=0;$i<$onlinenumber;$i++)
{
if(!$onlineuser = mysql_fetch_array($onlineresult))break;
echo "<a onClick=MM_openBrWindow('shortalk.php?talkto=".$onlineuser['Name']."','".$onlineuser['Name']."','width=300,height=250')><img src='images/face/".$onlineuser['Face'].".gif' width=20 height=20 ";
if($name == $onlineuser['Name'])echo "border=1 ";
echo " title='´úºÅ:".$onlineuser['Name']."\nêdzÆ:".$onlineuser['NickName']."\nÀ´·Ã:".$onlineuser['EnterTimes']."'></a>";
}
?>

ÆäÖÐµÄ onClick ÓÃÓÚµ¯³ö