include_once("include.php");
$_KEYWORD = parseUrl();
if ($_KEYWORD != "index")
{
$filename = "/".buildLink($_KEYWORD);
if ($_SERVER['HTTP_HOST'] != "localhost" && $_SERVER['REQUEST_URI'] != $filename)
{
header("Status: 301 Moved Permanently");
header("Location: $filename");
exit;
}
}
$_HTML = '
'.(buildTitle($_KEYWORD)).'
'.(buildTitle($_KEYWORD)).'
|
'.addContentBreaks($_CONTENT[$_KEYWORD]['content'], 4).'
|
';
$counter = 0;
$counter2 = 0;
$rand = getRandomNumber(0, 2, $_KEYWORD);
foreach ($_CONTENT as $key => $value)
{
if ($counter2 % 3 == $rand)
{
$counter2++;
continue;
}
$counter2++;
$link = buildLink($key);
$linktext = $_MAIN_KEYWORD." ".$_CONTENT[$key]['name'];
$_HTML .= '| '.$linktext.' | '."\n";
if ($counter % 7 == 6)
$_HTML .= '
';
$counter++;
}
$_HTML .= '
';
print $_HTML;
function getRandomNumber($start, $end, $seed)
{
srand((double)hexdec(substr(md5($seed), 0, 4)));
return rand($start, $end);
}
?>