[ph] js -> php: msn contact list

Pagina: 1
Acties:
  • 44 views sinds 30-01-2008

  • aqua_man
  • Registratie: Januari 2002
  • Laatst online: 26-07-2023

aqua_man

one life, live it!

Topicstarter
ik heb in javascript een scriptje die al je contatpersonen van msn kan laten zien en hun status.
maar omdat het in javascript is, kan iedereeen het zo jatten, is er een manier om het in php te schrijven?
code:
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
<div id="divMsgrObject" style="display:none">
 <object classid='clsid:F3A614DC-ABE0-11d2-A441-00C04F795683' codetype='application/x-oleobject' height='1' id='MsgrObj' width='1'>
 </object>
 <object classid='clsid:FB7199AB-79BF-11d2-8D94-0000F875C541' codetype='application/x-oleobject' height='1' id='MsgrApp' width='1'>
 </object>
</div>
<center>
<div align="left">
<font face="Verdana" size="2" color="#000000">
<span id="msn">
<script event="onload" for="window" language="javascript">
<!-- Begin
var online = "";
var offline = "";
var you = "";
var installed = true;

// Check if MSN Messenger is installed
try {
    var xObj = new ActiveXObject("Messenger.MsgrObject");
    if (xObj == null)
    installed = false;
}
catch (e) {
    installed = false;
}

if (installed) {
    var userState = isStateOnline(MsgrObj.LocalState);
    if ((userState) && (userState!="offline")) {
        // Get contact list
        var list = MsgrObj.List(0);

        // Get you!
        you = "[img]'"[/img]<b>" + MsgrObj.LocalFriendlyName + " [<i>" + userState + "</i>]</b><p>\n";

        // Get your friends
        for (i=0; i<list.Count; i++) {
        var state = isStateOnline(list.Item(i).State);
        if ((state=="invisible") || (state=="offline"))
        offline = offline + "[img]'"[/img]" + list.Item(i).FriendlyName + " [<i>" + state + "</i>]<br>\n";
        else
        online = online + "[img]'"[/img]" + list.Item(i).FriendlyName + " [<i>" + state + "</i>]<br>\n";
        }
    } 
    else {
        // You must be offline
        you = " - MSN Messenger is not connected. - ";
    }
} 
else {
    // MSN not installed
    you = " - MSN Messenger is not installed. - ";
}

function isStateOnline(state) {
    // Is user online?
    if (!state) return false;
    var stateList = [];
    stateList[2] = "online";
    stateList[6] = "invisible";
    stateList[10] = "bezet";
    stateList[14] = "ben zo terug";
    stateList[18] = "idle";
    stateList[34] = "afwezig";
    stateList[50] = "aan de telefoon";
    stateList[66] = "lunchpauze";

    var status = stateList[state];
    if (status==undefined) status="offline";
    return status;
}

// Fill in the form
var html = you+online+offline;
if (document.all)
document.all.msn.innerHTML=html
else if (document.getElementById)
document.getElementById("msn").innerHTML=html
else
document.write(html)
// End -->
</script>
</span>
</font>
</div>
</center>

mn probleem nu is vooral de 2 objects bovenaan, hoe kan je dat in php doen?

2 swim or not 2 swim, that's the question


  • aqua_man
  • Registratie: Januari 2002
  • Laatst online: 26-07-2023

aqua_man

one life, live it!

Topicstarter
dubbelpost, sorry
klik hier

2 swim or not 2 swim, that's the question


  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

k :)

Doet iets met Cloud (MS/IBM)


Dit topic is gesloten.