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
|
$xml = simplexml_load_file('http://fr.aiondatabase.com/xml/legions/1272-42.xml');
$nom = $xml->name;
$creadate = $xml['create_date'];
$majdate = $xml['last_update'];
$race = $xml->race;
$server = $xml->server;
$chars = $xml->chars;
$testchar = $xml->chars->char;
$count1 = count($testchar);
$result = $xml->xpath("//char[@classname='Templar']");
$result1 = $xml->xpath("//char[@classname='Gladiator']");
$result2 = $xml->xpath("//char[@classname='Chanter']");
$result3 = $xml->xpath("//char[@classname='Spiritmaster']");
$result4 = $xml->xpath("//char[@classname='Sorcerer']");
$result5 = $xml->xpath("//char[@classname='Cleric']");
$result6 = $xml->xpath("//char[@classname='Ranger']");
$result7 = $xml->xpath("//char[@classname='Assassin']");
$nodeCount = count($result);
$nodeCount1 = count($result1);
$nodeCount2 = count($result2);
$nodeCount3 = count($result3);
$nodeCount4 = count($result4);
$nodeCount5 = count($result5);
$nodeCount6 = count($result6);
$nodeCount7 = count($result7);
echo"<br>$nom (crée le $creadate)<br><br>";
echo"<div><li>Serveur : $server</li><li>Race : $race</li>
";
echo"<div style=\"width:500px;margin-left:30px;margin-right:auto;\">
";
print "
<div style=\"width:95%;height:30px;background:#a2983d;\">
<div style=\"float:left;width:134px;height:30px;\" >
Membres de la Legion</div>
<div style=\"float:left;width:134px;height:30px;\" >Classe</div>
<div style=\"float:left;width:134px;height:30px;\" >Niveau</div>
";
echo"
</div>
";
foreach ($chars->char as $char) {
$classname = $char['classname'];
$classname = str_replace("Gladiator","Gladiateur",$classname);
$classname = str_replace("Templar","Templier",$classname);
$classname = str_replace("Chanter","Aede",$classname);
$classname = str_replace("Spiritmaster","Spiritualiste",$classname);
$classname = str_replace("Sorcerer","Sorcier",$classname);
$classname = str_replace("Cleric","Clerc",$classname);
$classname = str_replace("Ranger","Rodeur",$classname);
$level = $char['level'];
print "
<div style=\"float:left;width:134px;height:10px;color:#debd4b;margin-top:7px;\" >
<img src=\"/modules/Rosteraion/images/$imglink\" style=\"vertical-align:middle;\"> $char</div>
<div style=\"float:left;width:134px;height:10px;margin-top:7px;\" >$classname</div>
<div style=\"float:left;width:134px;height:10px;color:#debd4b;margin-top:7px;\" >$level</div>
<div><img src=\"/modules/Rosteraion/images/barre.png\" style=\"width:95%;height:1px;\"></div>
"; //<div style=\"width:150px;\">niveau : $level</div> <hr style=\"clear: both;width: 95%;border: 0;border-bottom: 1px white solid;height: 1px;margin-left:auto;margin-right:auto;\">
}
echo"</div>";
echo"<div style=\"margin-left:186px;\">($majdate)</a>";
} |
Partager