Location: PHPKode > projects > chillyCMS > chillyCMS/modules/linklist/linklist.php
<?php
defined('DOIT') or die('Restricted access');

//Sample modsettings: displayname,name1|link1,name2|link2,name3|link3,name4|link4,name5|link5,...
$maxlinks=10;

$modsettings=explode(",",$modsettings);

$displayname=$modsettings[0];
$links=array();
for ($i=1;$i<=$maxlinks;$i++) {
	$tmp=explode("|",$modsettings[$i]);
	$links[$tmp[0]]=$tmp[1];
}

echo "<div class='linklist'>";
if ($displayname==1) {
	echo "<h3>$modinstancename</h3>";
}
echo "<ul>";
foreach ($links as $linkname=>$linkdest) {
	if ($linkdest!="") {
		if ($linkname=="") {
			$linkname=$linkdest;
		}
		if (substr($linkdest,0,7)=="http://") {
			echo "<li><a target='_blank' href='$linkdest'>$linkname</a></li>";
		} else {
			echo "<li><a href='$linkdest'>$linkname</a></li>";
		}
	}
}
echo "</ul></div>";
?>
Return current item: chillyCMS