Ich habe ein kleines script geschrieben das ich in die template.php von gpEasy einbinden will aber irgendwie will es nicht funktionieren (keine Fehlermeldung etc. es wird nur nichts angezeigt hier mal das script
komischerweise hab ich zuvor ein anderes script eingefügt das tadellos funktioniert
Woran könnte es liegen ?
mfg Spikaner
PHP:
<?php
// Pfadangabe und Source
$path = "rss_feeds.txt";
$file="http://www.eve.is/motd.asp?s=xml";
// Prüfen ob datei älter als 12 Std. dann erneut auslesen
if (time() >= (filectime($path)+12*60*60))
{
$inhalt=file_get_contents($file);
$inhalt = str_replace ( 'shellexec:', '', $inhalt ); // in links shellexec: entfernen
$inhalt = substr($inhalt, 4); // Die ersten 4 Zeichen entfernen
file_put_contents($path, $inhalt); // und ab damit in die Datei
}
$handle = file ("rss_feeds.txt"); // datei auslesen
// ab hier ausgabe
?>
<table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
<caption>
Message of the Day
</caption>
<tbody>
<tr>
<td>
<?php echo $handle[0];?>
</td>
</tr>
</tbody>
</table>
PHP:
<?php
function xml_attribute($object, $attribute)
{
if(isset($object[$attribute]))
return (string) $object[$attribute];
}
$file="https://api.eveonline.com/Server/ServerStatus.xml.aspx";
$inhalt=file_get_contents($file);
if (!empty($inhalt))
{
$xml = new SimpleXMLElement($inhalt);
$status = $xml->result->serverOpen;
$player = $xml->result->onlinePlayers;
// ab hier Ausgabe
?>
<table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 150px;">
<caption>Tranquility Server</caption>
<tbody>
<tr>
<td style="width: 75px;">
Status</td>
<td>
<?php If($status = "True"){echo'<span style="color:#00ff00;">Online</span>';}else{echo'<span style="color:#ff0000;">Offline</span>';}?></td>
</tr>
<tr>
<td>
Player</td>
<td>
<?php If($status = "True"){echo $player;}else{echo "0";}?></td>
</tr>
</tbody>
</table>
</br>
<?php
}
else
{
?>
<table align="left" border="1" cellpadding="1" cellspacing="1" style="width: 150px;">
<caption>Tranquility Server</caption>
<tbody>
<tr>
<td style="width: 75px;">
Status</td>
<td>
<?php If($status = "True"){echo'<span style="color:#00ff00;">Online</span>';}else{echo'<span style="color:#ff0000;">Unknown</span>';}?></td>
</tr>
<tr>
<td>
Player</td>
<td>
<?php If($status = "True"){echo $player;}else{echo "Unknown";}?></td>
</tr>
</tbody>
</table>
</br>
Woran könnte es liegen ?
mfg Spikaner