Location: PHPKode > projects > Content*Builder > modules/golembox/golemBox.php
<?php
	$golemLimit = 10;
	$data = join("", file("http://www.golem.de/golem_backend.rdf"));
	preg_match_all("°<item>(.+)</item>°sU", $data, $items);
	$counter = 1;
	foreach ($items[1] as $item) {
		if($counter == $golemLimit) 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 .= "...";
		}
		$golemTitle[] = "<a href=\"$link[1]\">$thisTitle</a>";
		++$counter; 
	}

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