Als je wilt? De code is wel slecht. Heb ik in een paar avondjes gedaan. Hier komt ie:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
| <? $online = array(); $offline = array(); $name = 'Unknown'; $email = 'No new e-mail messages'; function send($fp, $command) { fputs($fp, $command . "\n"); $return = fgets($fp, 2048); return $return; } function connect($server = 'msgr-ns1.msgr.hotmail.com', $port = '1863') { global $username, $password, $online, $offline, $name, $email; $fp = fsockopen($server, $port, $errstr, $errno); if(!$fp) die("Error $errno: $errstr"); send($fp, "VER 1 MSNP2"); send($fp, "INF 2"); $line = explode(" ", send($fp, "USR 3 MD5 I ". $username)); if($line[0] == 'XFR' && $line[2] == 'NS') { fclose($fp); list($addr,$port) = explode(":", $line[3]); connect($addr, $port); } else { $hash = md5(trim($line[4]) . $password); $return = explode(" ", send($fp, "USR 4 MD5 S $hash")); if($return[0] == '911') die("Jij hebt de verkeerd username en of password ingevuld!"); $name = $return[4]; fgets($fp, 2048); fgets($fp, 2048); fgets($fp, 2048); fgets($fp, 2048); fgets($fp, 2048); $line = send($fp, "LST 5 FL"); $line = explode(" ", $line); while($line[4] != $line[5]) { $fl[$line[6]] = array(rawurldecode($line[7]), "FLN"); $line = explode(" ", fgets($fp, 2048)); } $fl[$line[6]] = array(rawurldecode($line[7]), "FLN"); send($fp, "CHG 6 HDN"); $line = send($fp, "CHG 7 FLN"); $line = explode(" ", $line); while($line[1] != '7') { if($line[0] == 'ILN') $fl[$line[3]] = array(rawurldecode($line[4]), $line[2]); else if($line[0] == 'Inbox-Unread:') $email = trim($line[1]) . ' new e-mail messages'; $line = explode(" ", fgets($fp, 2048)); } $fl_val = array_values($fl); $fl_key = array_keys($fl); for($i=0;$i<count($fl);$i++) { if($fl_val[$i][1] == 'FLN') $offline[] = array($fl_val[$i][0], $fl_val[$i][1], $fl_key[$i]); else $online[] = array($fl_val[$i][0], $fl_val[$i][1], $fl_key[$i]); } usort($online, "cmp"); usort($offline, "cmp"); } } function cmp($a, $b) { $a = strtolower($a[0]); $b = strtolower($b[0]); if($a == $b) return 0; return ($a < $b) ? -1 : 1; } connect(); ?> <HTML> <HEAD> <TITLE>Messenger lijst van <?= $username ?></TITLE> </HEAD> <BODY> [img]"top.gif"[/img]<br> <TABLE border="0" width="253" height="250" cellpadding="0" cellspacing="0"> <TR> <TD>[img]"border.gif"[/img]</TD> <TD> <DIV id="contactlist" style="width: 241; height: 250; overflow: scroll"> <TABLE border="0"><TR><TD><FONT size="2" face="sans-serif"> [img]"invisible.gif"[/img] <a href="mailto:<?= $username ?>"><?= rawurldecode($name) ?> (Web)</a><br> [img]"mail.gif"[/img] <a href="http://www.hotmail.com"><?= $email ?></a><br> <b>Online</b><br> <?php foreach($online as $user) { if(strlen($user[0]) > 30) { $disuser = substr($user[0], 0, 27); $add = '...'; } else { $disuser = $user[0]; $add = ''; } if($user[1] == 'BSY' || $user[1] == 'PHN') echo "[img]\"busy.gif\"[/img] <a href=\"mailto:$user[2]\" acronym title=\"".trim($user[0])."\n$user[2]\">".trim($disuser)."</a>$add<br>\n"; else if($user[1] == 'AWY' || $user[1] == 'IDL' || $user[1] == 'BRB' || $user[1] == 'LUN') echo "[img]\"away.gif\"[/img] <a href=\"mailto:$user[2]\" acronym title=\"".trim($user[0])."\n$user[2]\">".trim($disuser)."</a>$add<br>\n"; else echo "[img]\"online.gif\"[/img] <a href=\"mailto:$user[2]\" acronym title=\"".trim($user[0])."\n$user[2]\">".trim($disuser)."</a>$add<br>\n"; } ?> <b>Not Online</b><br> <?php foreach($offline as $user) { if(strlen($user[0]) > 30) { $disuser = substr($user[0], 0, 27); $add = '...'; } else { $disuser = $user[0]; $add = ''; } echo "[img]\"offline.gif\"[/img] <a href=\"mailto:$user[2]\" acronym title=\"".trim($user[0])."\n$user[2]\">".trim($disuser)."</a>$add<br>\n"; } ?> </FONT></TD></TR></TABLE> </DIV> </TD> <TD>[img]"border.gif"[/img]</TD> </TR> </TABLE> <a href="http://iglo.dediepvries.com" target="_blank">[img]"bottom.gif"[/img]</a> </BODY> </HTML> ?> |
U gaat door voor de retorische vraag...