# pre-parsing variable setup
 if (stristr($article[content], "<!--more-->")) {
     $article[content] = explode("<!--more-->", $article[content]);
     $article[content][0] = Markdown($article[content][0]);
     $article[content][1] = Markdown($article[content][1]);
     # start parsing template variables
     $output = str_replace("{content}", $article[content][0], $output);
     $output = str_replace("{extended}", $article[content][1], $output);
 }
 $output = str_replace("{title}", $article[title], $output);
 $article[content] = Markdown($article[content]);
 $output = str_replace("[link]", "<a title=\"" . htmlspecialchars($article[title]) . "\" href=\"{$PHP_SELF}?k={$date}\">", $output);
 $output = str_replace("[/link]", "</a>", $output);
 #		$output = str_replace("[friendlylink]","<a title=\"".htmlspecialchars($article[title])."\" href=\"$_SERVER[PHP_SELF]/".urlTitle($article[title])."\">", $output);
 #        $output = str_replace("[/friendlylink]","</a>", $output);
 $output = str_replace("[friendlylink]", "<a title=\"" . htmlspecialchars($article[title]) . "\" href=\"{$_SERVER['SCRIPT_NAME']}/" . $KAclass->urlconstructor($article, $catarray) . "\">", $output);
 $output = str_replace("[/friendlylink]", "</a>", $output);
 $output = str_replace("{content}", $article[content], $output);
 $output = str_replace("{extended}", "", $output);
 $output = str_replace("{author}", $article[author], $output);
 $output = str_replace("{category}", $thiscatnamelisting, $output);
 $output = str_replace("{date}", date("dmy H:i", $date), $output);
 #
 #	NEEDS ABSTRACTION
 #
 #		$articlescomments = $commentsclass->settings[$date];
 $articlescomments = $commentsclass->articlecomments($date);
 if (is_array($articlescomments)) {
     krsort($articlescomments);
     reset($articlescomments);
     # get the latest