source: minimanager_/pomm/pomm.php@ 5

Last change on this file since 5 was 5, checked in by george, 18 years ago

import

File size: 4.5 KB
Line 
1<?php
2/* POMM
3 Player Online Map for MangOs
4 16.09.2006
5 Created by mirage666 (c) (mailto:mirage666@pisem.net icq# 152263154)
6
7 Optimized and Edited In order to fit MMM framework by Q.SA.
8 TBC support by Q.SA.
9*/
10
11require_once ("pomm_lib.php");
12valid_login(0);
13
14$realm_name = get_realm_name();
15?>
16
17<HTML><HEAD><title><?php echo $realm_name ?></title>
18<link rel="stylesheet" href="pomm.css" type="text/css">
19</HEAD>
20<script language="JavaScript" src="JsHttpRequest/Js.js"></script>
21<SCRIPT LANGUAGE="javascript" TYPE="text/javascript">
22
23var time = <?php echo $time ?>;
24var race_name = {
25 1: '<?php echo $lang_id_tab['human'] ?>',
26 2: '<?php echo $lang_id_tab['orc'] ?>',
27 3: '<?php echo $lang_id_tab['dwarf'] ?>',
28 4: '<?php echo $lang_id_tab['nightelf'] ?>',
29 5: '<?php echo $lang_id_tab['undead'] ?>',
30 6: '<?php echo $lang_id_tab['tauren'] ?>',
31 7: '<?php echo $lang_id_tab['gnome'] ?>',
32 8: '<?php echo $lang_id_tab['troll'] ?>',
33 9: '<?php echo $lang_id_tab['goblin'] ?>',
34 10: '<?php echo $lang_id_tab['bloodelf'] ?>',
35 11: '<?php echo $lang_id_tab['draenei'] ?>'
36}
37
38var class_name = {
39 1: '<?php echo $lang_id_tab['warrior'] ?>',
40 2: '<?php echo $lang_id_tab['paladin'] ?>',
41 3: '<?php echo $lang_id_tab['hunter'] ?>',
42 4: '<?php echo $lang_id_tab['rogue'] ?>',
43 5: '<?php echo $lang_id_tab['priest'] ?>',
44 7: '<?php echo $lang_id_tab['shaman'] ?>',
45 8: '<?php echo $lang_id_tab['mage'] ?>',
46 9: '<?php echo $lang_id_tab['warlock'] ?>',
47 11: '<?php echo $lang_id_tab['druid'] ?>'
48}
49
50function tip(header,text) {
51var t;
52t=document.getElementById("tip");
53
54if (window.opera) {
55x=window.event.clientX+15;
56y=window.event.clientY-10;
57} else if (navigator.appName=="Netscape") {
58document.onmousemove=function(e) { x = e.pageX+15; y = e.pageY-10; return true}
59} else {
60x=window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft + 15;
61y=window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop - 10;
62}
63
64t.innerHTML='<table width="80" border="0" cellspacing="0" cellpadding="0"\><tr class=\'tip_header\'\><td\>'+header+'</td\></tr\><tr class=\'tip_text\'\><td\>'+text+'</td\></tr\><\/table\>';
65if (screen.width-x<150) x-=150;
66t.style.left=x + "px";
67t.style.top=y + "px";
68}
69
70function h_tip() {
71var t;
72t=document.getElementById("tip");
73t.innerHTML="";
74t.style.left="-1000px";
75t.style.top="-1000px";
76}
77
78function show(data) {
79i=0;
80text='';
81if (data) {
82while (i<data.length) {
83 if (data[i].race==2 || data[i].race==5 || data[i].race==6 || data[i].race==8 || data[i].race==10)
84 {point="img/h_point.gif";} else
85 {point="img/a_point.gif";}
86 text=text+'<img src="'+point+'" style="position: absolute; border: 0px; left: '+data[i].x+'px; top: '+data[i].y+'px;" onMouseMove="tip(\''+data[i].name+'\',\''+data[i].zone+'<br\><img src=\\\'img/'+data[i].race+'-'+data[i].gender+'.gif\\\' style=\\\'float:center\\\' border=0 width=18 height=18\> <img src=\\\'img/'+data[i].cl+'.gif\\\' style=\\\'float:center\\\' border=0 width=18 height=18\><br\>'+race_name[data[i].race]+'<br/>'+class_name[data[i].cl]+'<br/>'+data[i].level+'\');" onMouseOut="h_tip();"\>';
87i++;
88}
89}
90document.getElementById("points").innerHTML=text;
91document.getElementById("server_info").innerHTML='<?php echo ereg_replace("'", "`", $lang_index['tot_users_online']);?> : '+i+' on <?php echo $realm_name ?><br>&nbsp;';
92}
93
94function load_data() {
95var req = new Subsys_JsHttpRequest_Js();
96req.onreadystatechange = function() {
97 if (req.readyState == 4) {show(req.responseJS);}
98 }
99 req.open('GET', 'pomm_run.php', true);
100 req.send({ });
101}
102
103function reset() {
104var ms = 0;
105then = new Date();
106then.setTime(then.getTime()-ms);
107load_data();
108}
109
110function display() {
111now = new Date();
112ms = now.getTime() - then.getTime();
113ms = time*1000-ms;
114if (time!=0) {document.getElementById("timer").innerHTML=(Math.round(ms/1000));}
115if (ms<=0) {
116 reset();
117 }
118if (time!=0) {setTimeout("display();", 500);}
119}
120
121function start() {
122reset();
123display();
124if (navigator.appName=="Netscape") {
125document.onmousemove=function(e) { x = e.pageX+15; y = e.pageY-10; return true}
126}
127}
128</SCRIPT>
129<BODY onload=start()>
130<div id="tip"></div><div ID="points"></div><div ID="world"></div><div ID="info"><center><table border="0" cellspacing="0" cellpadding="0" height="20"><tr><td valign="top" id="timer"></td></tr></table>
131<table border="0" cellspacing="0" cellpadding="0" height="470" width="1">
132<tr><td></td></tr></table>
133<table border="0" cellspacing="0" cellpadding="0" height="35" width="100%">
134<tr><td align="center" valign="top" id="server_info"></td></tr></table></center>
135</div></BODY></HTML>
Note: See TracBrowser for help on using the repository browser.