I just installed mod x and was wondering...
1. In every directory you have a index page that says access forbidden. Why not use
<?php
header("Location: http://yoursite.com/index");
?>
or a redirect to a 404 page. I mean security by obscurity is kind of weak. Or at least set up sessions or something.
2. Here is my old template system
<?php
class Page
{
var $page;
function Page($template = "template.html") {
if (file_exists($template))
$this->page = join("", file($template));
else
die("Template file $template not found.");
}
function parse($file) {
ob_start();
include($file);
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
function replace_tags($tags = array()) {
if (sizeof($tags) > 0)
foreach ($tags as $tag => $data) {
$data = (file_exists($data)) ? $this->parse($data) : $data;
$this->page = eregi_replace("{" . $tag . "}", $data,
$this->page);
}
else
die("No tags designated for replacement.");
}
function output() {
echo $this->page;
}
}
?>
and my old template
<!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" xml:lang="en" lang="en">
<head>
<title>{title}</title>
<meta name="keywords" content="{keywords}" />
<meta name="description" content="{descript}" />
<meta name="robots" content="index,follow"/>
<meta name="rating" content="general"/>
<meta name="revisit-after" content="7 days"/>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="master.css" type="text/css" />
<style type="text/css">
.{activemenu} a{border-bottom:solid 1px #FFFFFF;
background-color:#ffffff;
color:#000000;
overflow:visible;
diplay:block;}
</style>
{extracss}
{javascript}
{javascript2}
</head>
<body>
<div id="page">
<div id = "header">
<a href="index.php"><img src="logo.png" width="381" height="60" alt="Ask A Smart Guy" /></a>
<div class="menutop">
{menutop}
</div>
<div class="menubottom">
{menubottom}
</div>
<div class="date">{date}
</div>
</div>
<div class="main">
{main}
</div>
<div class="ads">
{ads}
</div>
<div class="footer">
{footer}
</div>
</div>
{urchin}
</body>
</html>
And the maker
<?php
require_once("template.php");
$page = new Page("template1.php");
$page->replace_tags(array(
"title" => 'Welcome to my website',
"date" => 'dat/date.dat',
"keywords" => 'dat/keywords.dat',
"extracss" => '',
"javascript" => 'dat/java.dat',
"javascript2" => '',
"descript" => 'Welcome to my website!',
"menubottom" => 'dat/menubottom.dat',
"activemenu" => 'menuitem1',
"menutop" => 'dat/menutop.dat',
"main" => 'dat/main.dat',
"ads" => 'dat/ads.dat',
"footer" => 'dat/footer.dat',
"urchin" => 'dat/urchin.dat'
));
$page->output();
?>
I thought it was pretty easy to use if I wanted to put php above the HTML doc type I would put {php} or something this cms seems to run similar but is also a little more complicated by a gui.
3. I’m sure this project started out simple until 12 cooks got into the room. I mean I really cannot complain since it is a free cms. But what is the difference between a CMS and Blogging software?
4. while this was my menu system for a directory
<?php
$dir = "../this-weeks-top-ten";
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
$unwantedfiles= array('.','..','dat','index.php','logo.png','master.css','template.php','template1.php');
$result = array_diff($files, $unwantedfiles);
$results = array_values($result);
echo "<div class='menutopten'>";
foreach ($results as $value){
$values=str_replace('.php','',$value);
$values=str_replace('-',' ',$values);
$values=ucwords($values);
echo "<a href='$dir/$value' >$values</a>";
}
echo "</div>";
?>
Now I have to figure out which page is 300 or something like that to make a menu, well I don’t because you have it on the sidebar in the admin, but do you understand what I mean.
5. Anyways I have to look for something that suits my needs a little better.
Good luck to you and this project.