This is a new development I decided to do a few hours ago, like my post if you think I've made a good amount of progress in the time I've had to get to this status. May I add that this development is originally founded by Wabbo.me, however their source code is private and I kindly decided to give you guys something new from my own time and effort to code you this new CMS. Literally I have gone through every line of code and updated it to my standards, so it's safe to say we can thank Wabbo for their template (design).
I plan on having a lot of features inside this bad boy (or girl), whichever takes your fancy.
http://oi47.tinypic.com/sg60aw.jpg
http://oi45.tinypic.com/2gub9rb.jpg
PHP Code:
<?php
define('DH_PAGES', true);
require_once ('resources/php/config/config.php');
require_once ('resources/php/classes/class.mysqli.php');
require_once ('resources/php/classes/class.template.php');
require_once ('resources/php/classes/class.user.php');
$db = new db_mysqli('localhost', $config['user'], $config['pass'], $config['tble']);
$tmp = new template1();
$usr = new user();
session_start();
if (isset($_SESSION['username']) && isset($_SESSION['password']))
{
if ($usr->ValidateUser($_SESSION['username'], $_SESSION['password']))
{
if ($usr->ValidateUser($_SESSION['username']) || $usr->ValidateUser($_SERVER['REMOTE_ADDR']))
{
unset($_SESSION['username']);
unset($_SESSION['password']);
header('Location: '.$config['path'].'?p=login');
exit;
}
else
{
define('DH_LOGGED', true);
}
}
else
{
define('DH_LOGGED', false);
}
}
else
{
define('DH_LOGGED', false);
}
$page = NULL;
if (isset($_POST['p']))
{
$page = strtolower($db->real_escape_string(htmlspecialchars($_POST['p'])));
}
if (isset($_GET['p']))
{
$page = strtolower($db->real_escape_string($_GET['p']));
}
if ($page == NULL)
{
$initial = NULL;
if (DH_LOGGED)
{
$initial = 'me';
}
else
{
$initial = 'login';
}
header('Location: '.$config['path'].'?p='.$initial);
exit;
}
if (DH_LOGGED)
{
if ($page == 'login' || $page == 'register')
{
header('Location: '.$config['path'].'?p=me');
exit;
}
}
else
{
if ($page == 'me' || $page == 'logout')
{
header('Location: '.$config['path'].'?p=login');
exit;
}
}
switch($page)
{
case 'logout':
unset($_SESSION['username']);
unset($_SESSION['password']);
header('Location: '.$config['path'].'?p=login');
exit;
break;
default:
if (file_exists('resources/php/templates/'.$page.'.php'))
{
require_once ('resources/php/templates/'.$page.'.php');
}
else
{
require_once ('resources/php/templates/error.php');
}
break;
}
?>