";
$comment = str_replace($search, $replace, $comment);
$post = $_POST['post'];
$post = "entries/".$post."comments.txt";
$posted = $_POST['posted'];
$pagefrom = $_POST['pagefrom']."?p=".$post;
$pagefromerror = $_POST['pagefrom']."?p=".$post."&error=1";
if ($_POST['author']!= "") {
$your_data = "
\n".$author." says:
".$comment."
".$posted;
$fp = fopen($post, "a");
fwrite($fp, $your_data);
fclose($fp);
$error = "no";
}
}
?>
';
include ("nav.php");
echo "
";
include ("footer.php");
exit;
} else {
echo "
Error:
This is not allowed.
< Back";
echo '
';
include ("nav.php");
echo "
";
include ("footer.php");
exit;
}
}
// if cat page params are set (and set correctly)
$i ++;
if (isset($_GET["cat"])) {
$page = 'entries/'.strip_tags(htmlspecialchars($_GET["cat"])).'.txt';
if (file_exists($page)) {
echo "
< Back";
$post = file_get_contents("$page");
$post = str_replace('{main}', '', $post);
$post = str_replace('{headline}', '', $post);
$post = str_replace('{link}', '', $post);
$post = str_replace('{endlink}', '', $post);
$post = str_replace('{endheadline}', '', $post);
echo $post;
otherwise();
} else {
echo "
< Back
Error:
There is no such category.
Available Categories:
";
include ("pages/categories.txt");
echo "
< Back";
otherwise();
}
}
$i ++;
// if link params are set (and set correctly)
if (isset($_GET["p"])) {
echo '
';
$page = 'entries/'.strip_tags(htmlspecialchars($_GET["p"])).'.txt';
$pagecomments = 'entries/'.strip_tags(htmlspecialchars($_GET["p"])).'comments.txt';
if (file_exists($page)) {
echo "
< Back";
$post = file_get_contents("$page");
$post = str_replace('{main}', '', $post);
$post = str_replace('{endmain}', '', $post);
$post = str_replace('{headline}', '', $post);
echo $post;
$email = $post;
$small = file($page);
$minus = count($small);
$posted = $minus -2;
$posted = $small[$posted];
$posted = str_replace('
', '', $posted);
$posted = str_replace('
', '', $posted);
echo '
';
$comments = intval(count(file($pagecomments)));
$comments = $comments -1;
if($comments <= -1){
$comments = 0;
}
if($comments == 0){
$comments = "No";
}
function comment_style() {
static $comment_count;
$comment_count++;
if ($comment_count % 2) {
$GLOBALS['colour'] = "#FFFFFF"; //Gotta stick to your homeland :)
$GLOBALS['onoff'] = "off";
}
else {
$GLOBALS['colour'] = "#EEEEEE";
$GLOBALS['onoff'] = "on";
}
}
$headline = $small[2];
$headline= str_replace('
', '', $headline);
$headline = str_replace('
', '', $headline);
echo "
$comments Responses to “".$headline."”
";
$lines = file($pagecomments);
foreach ($lines as $line)
{
comment_style();
echo '';
}
include ("pages/comment.php");
echo "
";
include ("footer.php");
exit;
} else {
echo "