Hallo!
Ich habe das Problem, dass ich per php-script auf eine externe xml-Datei zugreifen möchte.
Immer wird mit der Meldung "could not open xml input".
Andere die ich kenne, die diese Scripts nuten, haben dies Problem nicht.
Die kompletten scripts findet man unter
http://www.valhallas-sturm.org/dl/Guild_Stats_v0.5.zip.
Dank an jeden der Helfen kann!
p.s.: ich bin noch php-Neuling!
Auszug aus dem Scripten :
--------------------guild.php------------------------------
<?
include('include/header.php');
include('include/config.php');
set_time_limit(120);
//require_once('XMLServerInfo.php'); liefert veraltete Infos (3.12.04)
//require_once('XMLServerStatus.php'); liefert veraltete Infos (3.12.04)
require_once('XMLherald/XMLKeeps.php');
require_once('XMLherald/XMLRelics.php');
require_once('XMLherald/XMLGuildInfo.php');
require_once('XMLherald/XMLGuildList.php');
// holt informationen zu einer Gilde
$gi=new GuildInfo(sprintf('
http://camelot-europe.goa.com/herald/servers/%s/guilds/%s.xml',
$server,$guild_id));
if($gi->Error) die($gi->ErrorMsg);
// liefert allgemeine Informationen zur Gilde
$info=$gi->getGuildInfo() ;
?>
<h1><?=$info['name']?></h1>
<table cellpadding='0' cellspacing='0' width='80px' background="images/sshield/<?=$info['sshield']?>.png">
<tr height='100px'>
<td align='center' valign='top'>
<img src="images/semblem/<?=$info['semblem']?>.gif">
</td>
</tr>
</table>
<br><br>
<table cellpadding='0' cellspacing='0' width="400px">
<tr>
<td>Reichspunkte: <?=$info['guildrp']?> ( Letzte Woche: <?=$info['lastrp']?> )</td>
</tr>
<tr>
<td><?=$info['activechars']?> aktive Charaktere, gespielt von <?=$info['activemembers']?> Mitgliedern</td>
</tr>
<tr>
<td>Hausnummer: <?=$info['housing']?></td>
</tr>
<tr>
<td>Homepage: <a href="<?=$info['websiteurl']?>" target="_blank"><?=$info['websiteurl']?></td>
</tr>
</table>
<br><br>
<?
// liefert eine Liste aller Charaktere der Gilde
$chars=$gi->getCharacterList();
$strorder='DESC';
if (isset($_GET['order'])) {
if ($_GET['order']=='DESC'){
$strorder='ASC';
}
}else{
$_GET['order']='ASC';
}
if (!isset($_GET['sort']))
$_GET['sort']='name';
sort_by_field($chars, array($_GET['sort'] => $_GET['order']));
?>
<table cellpadding='0' cellspacing='0' width='780px'>
<tr height='15px'>
<td width='150px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=name&order=<?=$strorder?>'><b>Name</b></a></td>
<td width='100px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=guildrank&order=<?=$strorder?>'><b>Rang</b></td>
<td width='80px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=level&order=<?=$strorder?>'><b>Level</b></td>
<td width='130px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=race&order=<?=$strorder?>'><b>Rasse</b></td>
<td width='130px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=class&order=<?=$strorder?>'><b>Klasse</b></td>
<td width='120px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=totalrp&order=<?=$strorder?>'><b>RP</b></td>
<td width='120px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=lastweekrp&order=<?=$strorder?>'><b>LWRP</b></td>
<td width='100px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=totalrp&order=<?=$strorder?>'><b>RR</b></td>
<td width='100px' class="top" align='center'><a href='<?$_PHP_SELF?>?sort=laston&order=<?=$strorder?>'><b>Online</b></td>
</tr>
<? foreach($chars as $ch) {?>
<tr height='15px'>
<td width='150px' class="content"><a href='char.php?name=<?=$ch['name']?>'><?=$ch['name']?></a></td>
<td width='100px' class="content"><?=$ch['guildrank']?></td>
<td width='80px' class="content"><?=$ch['level']?></td>
<td width='130px' class="content"><?=$ch['race']?></td>
<td width='130px' class="content"><?=$ch['class']?></td>
<td width='120px' class="content"><?=$ch['totalrp']?></td>
<td width='120px' class="content"><?=$ch['lastweekrp']?></td>
<td width='100px' class="content"><?=realmrank($ch['totalrp'])?></td>
<td width='100px' class="content" align='center'><img src="images/<?=$ch['laston']?>.png" title="<?=$ch['laston']?>"></td>
</tr>
<? }
include('include/footer.php');
?>
-----------------------Ende-----------------------------------------
------------------XMLGuildList.php------------------------------------------
<?php
/////////////////////////////////////////////////
// //
// Euro-DAoC XML-Parser v0.91 beta //
// by Crowley //
// adapted by Oz //
// //
/////////////////////////////////////////////////
require_once('XMLdocument.php');
class GuildList extends XMLdocument {
var $XMLdata;
var $Error;
var $ErrorMsg;
var $sortfield;
var $guildinfo;
function GuildList($filename) {
$this->XMLdata=array();
$this->Error=false;
$this->ErrorMsg='';
if($filename) {
$this->parseXML($filename);
}
}
function getGuildList() {
$result=array();
if(is_array($this->XMLdata['GUILD_LIST'][0]['GUILD'])) {
foreach($this->XMLdata['GUILD_LIST'][0]['GUILD'] as $guild) {
$result[]=array('name'=>$guild['ATTRS']['NAME'],
'guild_id'=>$guild['ATTRS']['GUILD_ID'],
'rp'=>$guild['ATTRS']['RP']);
}
}
return $result;
}
}
?>
------------------------------------------------------------------------