08-19-2009, 01:21 PM
|
#123 (permalink)
|
|
The Visitor
Join Date: Aug 2009
Posts: 1
Thanks: 0
|
Very helpful thread, thanks a bunch!
I just have one small problem, I choose to load the entire XML into a DB text-field, and only update it every 12 hours.
Only problem is; I'm having trouble sorting the outcome of the list by rank, since its still one piece of text, I don't want to split up the XML before loading it into the DB.
I just want to know if there's a easy way to sort my list by rank.
Here's what I got so far:
Code:
//Show the XML from the db on the site
$doc2 = DOMDocument::loadXML($writeData['xml_document']);
$memberList = $doc2->getElementsByTagName('character'); //Find members
foreach($memberList as $toon){
$data = array(
'NAME' => $toon->getAttribute("name"),
'RACE' => $toon->getAttribute("raceId"),
'LEVEL' => $toon->getAttribute("level"),
'CLASS' => $toon->getAttribute("class"),
'GENDER' => $toon->getAttribute("genderId"),
'RANK' => $toon->getAttribute("rank"),
'ACHPOINTS' => $toon->getAttribute("achPoints"),
'URI' => $toon->getAttribute("url"),
);
if ($data['LEVEL'] > 79){
array($data);
echo "Name: <a href=http://eu.wowarmory.com/character-sheet.xml?".$data['URI']." target='new'>".$data['NAME']."</a>";
echo " // Race: ".$data['RACE'];
echo " // Rank: ".$data['RANK'];
echo " // Sex: ".$data['GENDER'];
echo " // Achievement Points: ".$data['ACHPOINTS'];
echo " // Level: ".$data['LEVEL']."<br/>";
}}
I hope some can help me, thanks in advance.
|
|
|
|