Seite 1 von 1
XML auf Custom Page ausgeben
Verfasst: 03.09.2007 20:54
von -=Fable=-
Hey,
also erstmal suche ich den Custom Page mod..konnte ich in der suche eben irgendwie nicht finden
Dann hab ich mich gefragt ob es irgendwie möglich ist eine XML datei auf einer Custom Page auszugeben, irgendwie formatiert und so..Nämlich die hier:
http://ws.audioscrobbler.com/1.0/group/ ... kchart.xml
Wäre dies nicht möglich würde last.fm sowas nicht anbieten oder? wäre genial wenn mir da jmd helfen könnte

Verfasst: 04.09.2007 14:02
von saerdnaer
Auf die XML-Datei greifst du am besten mit
Simple XML zu. Der Rest ist dann eigendlich nur noch Ausgabezeug.
MfG ah
Verfasst: 06.09.2007 20:07
von -=Fable=-
Jop das funzt

Aber wie krieg ich das auf ne phpbb seite? Find keinen Custom Page Mod, als den von Devinereaper und der wird seit rc 2 nicht weiterentwickelt..
Verfasst: 06.09.2007 20:26
von nickvergessen
Verfasst: 16.09.2007 15:48
von -=Fable=-
Danke, genau das hab ich gesucht

Allerdings will das nicht funktionieren...Ich würde gerne den Code integrieren:
Code: Alles auswählen
$user = 'track';
$user2 = 'artist';
$cache = 120; //in seconds, how long to cache data locally
$remotefile = "http://ws.audioscrobbler.com/1.0/group/RoQbar/weeklytrackchart.xml";
$remotefile2 = "http://ws.audioscrobbler.com/1.0/group/RoQbar/weeklyartistchart.xml";
$localfile = $user.'.xml';
$localfile2= $user2.'.xml';
if ((!file_exists($localfile)) || (time()-filemtime($localfile)>$cache)) {
$contents = @file_get_contents($remotefile);
$fp = fopen($localfile, "w");
fwrite($fp, $contents);
fclose($fp);
}
if ((!file_exists($localfile2)) || (time()-filemtime($localfile2)>$cache)) {
$contents2 = @file_get_contents($remotefile2);
$fp = fopen($localfile2, "w");
fwrite($fp, $contents2);
fclose($fp);
}
$xml = @simplexml_load_file($localfile);
for ($t = 0; $t <= 9; $t++) {
$platz = $t+1;
echo "<li>$platz. ".$xml->track[$t]->artist." - ".$xml->track[$t]->name." - ".$xml->track[$t]->reach." plays</li>";
}
echo "<br /><br />";
$xml = @simplexml_load_file($localfile2);
for ($t = 0; $t <= 9; $t++) {
$platz = $t+1;
echo "<li>$platz. ".$xml->artist[$t]->name." - ".$xml->artist[$t]->reach." plays</li>";
}
Kann mir jmd vllt an nem beispiel zeigen wie die 3 dateien aussehen müssten damit das geht?