<?php
$sitetitle = "Scribe";
session_start();
$_SESSION['authenticated'];
$_SESSION['username'];
$_SESSION['theme'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Scribe - Free, click-efficient forum that runs without databases.</title>
<?
switch($_SESSION['theme'])
{
case "Storm": echo("<link rel=\"stylesheet\" type=\"text/css\" href=\"Styles/Storm.css\" />"); break;
case "Baloon": echo("<link rel=\"stylesheet\" type=\"text/css\" href=\"Styles/Baloon.css\" />"); break;
default: echo("<link rel=\"stylesheet\" type=\"text/css\" href=\"Styles/Storm.css\" />"); break;
}
?>
</head>
<body>
<div id="alignment">
<div id="main">
<?php include("navi.php"); ?>
<div id="content">
<?
if(!isset($_GET['page']))
{
//Set your index location
$indexpath = "docs/index.php";
if(file_exists($indexpath))
{
$file = fopen($indexpath, "r") or exit("Error: Index loading failed");
$title = fgets($file);
$pagetitle = fgets($file);
fclose($file);
$indexcontents=file_get_contents($indexpath);
$indexcontents = str_replace("<ptitle>", "<!--", $indexcontents);
$indexcontents = str_replace("</ptitle>", "-->", $indexcontents);
$indexcontents = str_replace("<pptitle>", "<div class=\"pagetitle\">", $indexcontents);
$indexcontents = str_replace("</pptitle>", "</div>", $indexcontents);
$indexcontents = str_replace("<pstitle>", "<div class=\"pagesubtitle\">", $indexcontents);
$indexcontents = str_replace("</pstitle>", "</div>", $indexcontents);
echo($indexcontents);
}
else
{
echo("<div class=\"pagesubtitle\">Error</div>Index not found");
}
}
else
{
//Set your document format and path
$path = "docs/" . $_GET['page'] . ".php";
if(file_exists($path))
{
$file = fopen($path, "r") or exit("<div class=\"pagesubtitle\">Error</div>Page open failed");
$title = fgets($file);
$pagetitle = fgets($file);
fclose($file);
$doc=file_get_contents($path);
$doc = str_replace("<ptitle>", "<!--", $doc);
$doc = str_replace("</ptitle>", "-->", $doc);
$doc = str_replace("<pptitle>", "<div class=\"pagetitle\">", $doc);
$doc = str_replace("</pptitle>", "</div>", $doc);
$doc = str_replace("<pstitle>", "<div class=\"pagesubtitle\">", $doc);
$doc = str_replace("</pstitle>", "</div>", $doc);
echo($doc);
}
else
{
echo("<div class=\"pagesubtitle\">Error</div>Page not found");
}
}
?>
<div id="footer">
Powered by: Scribe 0.2
</div>
</div>
</div>
</div>
</body>
</html>