<?php
## Einstellungen ##
$anzahl = 10; // Anzahl der anzuzeigenden News
$news = "http://www.heise.de/newsticker/heise.rdf"; // Datenquele
$intervall = "5000"; // in Millisekunden
$effect = TRUE; // Übergangseffect? Ja = TRUE; Nein = FALSE
## Ab hier nichts mehr ändern! ##
$count = 1;
$content = implode("", file($news));
preg_match_all("/\<item\>(.*?)\<\/item\>/si", $content, $results);
?>
<script language="JavaScript">
<!--
var News = 1;
function nextNews() {
switch (News) {
<?php
for($i=0;$i<$anzahl && $i<count($results[1]);$i++) {
preg_match("/\<link\>(.*?)\<\/link\>/si", $results[1][$i], $link);
preg_match("/\<title\>(.*?)\<\/title\>/si", $results[1][$i], $title);
$link = $link[1];
$title = $title[1];
if($count == $anzahl) {
echo "\n default: \n";
$text = 1;
} else {
echo "\n case " . $count . ":\n";
$text = $count + 1;
}
echo "News = " . $text . ";";
if($effect)
echo "\n document.all.News.filters.blendTrans.Apply(); \n";
echo "document.all.News.innerHTML = '<a href=\"" .
$link . "\" target=\"_blank\">" . $title . "</a>';";
if($effect)
echo "\n document.all.News.filters.blendTrans.Play(); \n";
echo "break";
$count++;
}
?>
}
setTimeout("nextNews()",<?php echo $intervall; ?>);
}
setTimeout("nextNews()");
//-->
</script>
<div id="News" style="width:95%; filter:blendTrans(Duration=0.5)"></div>
|