Seite 1 von 1

Newsticker

Verfasst: 16.01.2008 23:07
von Serpent
Hi, ich wollte dass auf der Hauptseite im Forum unten ein Newsticker angezeigt wird.
z.B. von Heise. Problem ist, dass ich das jetzt in den overall_footer reingesetzt hab, was zur Folge hat, dass das Teil bei jedem Post usw die Daten aktualisiert, wodurch das ewigst langsam wird. Hat jemand eine Lösung dafür? Kann man da irgendwas einbaun, dass das Teil während der Session z.B. nur ein Mal die Daten aktualisiert? Der Code für den Ticker ist hier:
<?PHP

header('Content-Type: text/html; charset=utf-8');

$fcontents = join ('', file ('http://www.heise.de/newsticker/heise.rdf'));

$fcontents = str_replace ("</item>", "", $fcontents);

$fcontents = str_replace ("</link>", "", $fcontents);

$splices = explode ("<item>", $fcontents);

for ($i = 1; $i < count($splices); $i++){

$link = explode("<link>",$splices[$i]);

$link[1] = strip_tags($link[1]);

$headline = str_replace ("<title>", "<a href=\"" . trim($link[1]) . "\" target=\"_blank\" class=\"heiseheadline\">", $splices[$i]);

$headline = str_replace ("</title>", "</a>", $headline);

$headline = explode ("<link>", $headline);

$headline = $headline[0];

print $headline . "<img src=\"1.gif\" height=20 width=1 align=top><br>";

}



?>