Location: PHPKode > projects > Content*Builder > modules/heisebox/heiseBox.php
<?php
	$limit = 10;
	$data = join("", file("http://www.heise.de/newsticker/heise.rdf"));
	preg_match_all("°<item>(.+)</item>°sU", $data, $items);
	$counter = 1;
	foreach ($items[1] as $item) {
		if($counter == $limit) break;
		preg_match("°<title>(.+)</title>°U", $item, $title);
		preg_match("°<link>(.+)</link>°U", $item, $link);
		// $title[1]: Headline
		// $link[1]: zugehöriger Link
		$thisTitle = substr($title['1'], 0, 25);
		if(strlen($title['1']) > 25) {
			$thisTitle .= "...";
		}
		$heiseTitle[] = "<a href=\"$link[1]\">$thisTitle</a>";
		++$counter; 
	}

	$tpl->assign("heiseArticles", array ( "TITLE" => $heiseTitle ));
	$tpl->display("heiseBox.template");	
?>
Return current item: Content*Builder