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.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
| 1. / 2. / ...
<?php <?php
error_reporting(E_ALL);
class Parser{
var $xml_parser;
var $stack=array();
function Parser() {
$xml_parser=&$this->xml_parser;
$xml_parser = xml_parser_create();
xml_set_object($xml_parser,$this);
xml_set_element_handler($xml_parser, "startTag", "endTag");
xml_set_character_data_handler($xml_parser, "cdata");
}
function startTag($parser, $name, $attrs) {
$tag=array("name"=>$name,"attrs"=>$attrs);
array_push($this->stack,$tag);
}
function cdata($parser, $cdata) {
$stack=&$this->stack;
$stack[count($stack)-1]['cdata'] .= $cdata;
}
function endTag($parser, $name) {
$stack=&$this->stack;
$stack[count($stack)-2]['children'][] = $stack[count($stack)-1];
array_pop($stack);
}
function parse($s) {
$data=xml_parse($this->xml_parser,$s);
if(!$data)
if (error_reporting()==E_ALL)
printf(
"XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)
);
else printf("Datenfehler");
return $data;
}
function free() {
xml_parser_free($this->xml_parser);
}
}
$claninfo = array();
$clanstats = array();
$playerstats = array();
$xmllink="http://aaotracker.com/livefeed/xml_clanprofile.php?clanid=0000";
$parser=new Parser();
$parser->parse(file_get_contents($xmllink));
$parser->free();
$stack=&$parser->stack;
// Get Player Data
for($i = 0; $i < sizeof($stack[0]['children'][2]['children']); $i++) {
for($x = 0; $x < sizeof($stack[0]['children'][2]['children'][$i]['children']); $x++) {
$valname=$stack[0]['children'][2]['children'][$i]['children'][$x]['name'];
$value=$stack[0]['children'][2]['children'][$i]['children'][$x]['cdata'];
if($valname=="PLAYERID") $pid=$value;
$playerstats[$pid][$valname]=$value;
}
}
// Get Clan Profile Data
for($i = 0; $i < sizeof($stack[0]['children'][0]['children']); $i++) {
$valname=$stack[0]['children'][0]['children'][$i]['name'];
$claninfo[$valname]=$stack[0]['children'][0]['children'][$i]['cdata'];
}
foreach($claninfo as $key => $value) {
$clanid=$claninfo['CLANID'];
$clanname=$claninfo['CLANNAME'];
$clantag=$claninfo['CLANTAG'];
$clancountry=$claninfo['CLANCOUNTRY'];
$clan_url=$claninfo['CLANSTATSURL'];
}
// Get Clan Stats Data
for($i = 0; $i < sizeof($stack[0]['children'][1]['children']); $i++) {
$valname=$stack[0]['children'][1]['children'][$i]['name'];
$clanstats[$valname]=$stack[0]['children'][1]['children'][$i]['cdata'];
}
foreach($clanstats as $key => $value) {
$clanhonor=$clanstats['HONOR'];
$clanscore=$clanstats['SCORE'];
$clankills=$clanstats['KILLS'];
$clandeaths=$clanstats['DEATHS'];
$clankd=$clanstats['KDRATIO'];
$roe=$clanstats['ROE'];
}
echo cs_html_table(1,'forum',1);
echo cs_html_form(1);
echo cs_html_roco(1,'headb');
echo $cs_lang='AAO-Tracker';
echo cs_html_roco(0);
echo cs_html_form(0);
echo cs_html_table(0);
echo cs_html_table(1,'forum',1);
echo cs_html_form(1);
echo cs_html_roco(1,'centerc');
echo $cs_lang='Clan-Info';
echo cs_html_roco(0);
echo cs_html_form(0);
echo cs_html_table(0);
echo cs_html_table(1,'forum',1);
echo cs_html_form(1);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-ID:';
echo cs_html_roco(2,'leftb');
echo "$clanid";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-Name:';
echo cs_html_roco(2,'leftb');
echo "<a href=$clan_url>$clanname</a>";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-Tag:';
echo cs_html_roco(2,'leftb');
echo "$clantag";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Country:';
echo cs_html_roco(2,'leftb');
echo "$clancountry";
echo cs_html_roco(0);
echo cs_html_form(0);
echo cs_html_table(0);
echo "<br>";
echo "<br>";
echo cs_html_table(1,'forum',1);
echo cs_html_form(1);
echo cs_html_roco(1,'centerc');
echo $cs_lang='Clan-Stats (Average)';
echo cs_html_roco(0);
echo cs_html_form(0);
echo cs_html_table(0);
echo cs_html_table(1,'forum',1);
echo cs_html_form(1);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-Honor:';
echo cs_html_roco(2,'leftb');
echo "$clanhonor ";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-Score:';
echo cs_html_roco(2,'leftb');
echo "$clanscore";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-Kills:';
echo cs_html_roco(2,'leftb');
echo "$clankills";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-Deaths:';
echo cs_html_roco(2,'leftb');
echo "$clandeaths";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-Fragrate:';
echo cs_html_roco(2,'leftb');
echo "$clankd";
echo cs_html_roco(0);
echo cs_html_roco(1,'leftb');
echo $cs_lang='Clan-ROE:';
echo cs_html_roco(2,'leftb');
echo "$roe";
echo cs_html_roco(0);
echo cs_html_form(0);
echo cs_html_table(0);
echo "<br>";
echo "<br>";
echo cs_html_table(1,'forum',1);
echo cs_html_form(1);
echo cs_html_roco(1,'centerc');
echo $cs_lang='Status';
echo cs_html_roco(2,'centerc');
echo $cs_lang='Playername';
echo cs_html_roco(3,'centerc');
echo $cs_lang='Honor';
echo cs_html_roco(3,'centerc');
echo $cs_lang='Time/h';
echo cs_html_roco(4,'centerc');
echo $cs_lang='Score';
echo cs_html_roco(5,'centerc');
echo $cs_lang='Kills';
echo cs_html_roco(6,'centerc');
echo $cs_lang='Deaths';
echo cs_html_roco(7,'centerc');
echo $cs_lang='Fragrate';
echo cs_html_roco(0);
foreach($playerstats as $key => $value) {
$playername=$playerstats[$key]['PLAYERNAME'];
$playerhonor=$playerstats[$key]['PLAYERHONOR'];
$playerurl=$playerstats[$key]['PLAYERSTATSURL'];
$playertime=floor($playerstats[$key]['PLAYERTIME']/3600);
$playerscore=$playerstats[$key]['PLAYERSCORE'];
$playerkills=$playerstats[$key]['PLAYERKILLS'];
$playerdeaths=$playerstats[$key]['PLAYERDEATHS'];
$playerfragrate= @round($playerstats[$key]['PLAYERKILLS']/$playerstats[$key]['PLAYERDEATHS'], 2);
if($playerstats[$key]['PLAYERSTATUS']=="1") $statuspic="http://www.xy.com/mods/status/images/ponline.gif";
else $statuspic="http://www.xy.com/mods/status/images/poffline.gif";
//echo $statuspic;
//print("$statuspic");
echo cs_html_roco(2,'leftb');
echo "<img src=$statuspic>";
echo cs_html_roco(2,'leftb');
echo "<a href=$playerurl>$playername</a>";
echo cs_html_roco(2,'leftb');
echo "$playerhonor";
echo cs_html_roco(2,'leftb');
echo "$playertime h";
echo cs_html_roco(2,'leftb');
echo "$playerscore";
echo cs_html_roco(2,'leftb');
echo "$playerkills";
echo cs_html_roco(2,'leftb');
echo "$playerdeaths";
echo cs_html_roco(2,'leftb');
echo "$playerfragrate";
echo "<br>";
echo cs_html_form(0);
echo cs_html_roco(0);
}
echo cs_html_form(0);
echo cs_html_roco(0);
echo cs_html_table(0);
?> ?> |