The forum part is a brilliant add-on.
Printable View
The forum part is a brilliant add-on.
I have some points.
You sure the escape function is needed and the htmlspecialchars?PHP Code: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']));
}
Can't you think of a better solution? Just a personal taste but I dont like long if statements when you can add a definition in each page whenever the user must be logged in or not (UBER?!)PHP Code:if ($page == 'logout' || $page == 'client' || $page == 'me' || $page == 'home' || $page == 'profile' || $page == 'community' || $page == 'forums' || $page == 'staff' || $page == 'tags' || $page == 'credits' || $page == 'pixels') { header('Location: '.$config['path'].'?p=login'); exit; }
A if statement can doe the same as a switch.PHP Code: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;
}
Also my taste :), do what you want with itPHP Code:if ($page == 'logout')
{
unset($_SESSION['username']);
unset($_SESSION['password']);
header('Location: '.$config['path'].'?p=login');
exit;
}
else if (file_exists('resources/php/templates/'.$page.'.php'))
{
require_once ('resources/php/templates/'.$page.'.php');
}
else
{
require_once ('resources/php/templates/error.php');
}
Last thing:
What's the point of the bolded text?Code:.container.clear #contents-container .contents.S
You actually gave me an idea on how I could have improved the page, thanks. If by any chance if you can fix the note I put on there that would be good too!PHP Code:if (DH_LOGGED)
{
if ($page == 'login' || $page == 'register')
{
header('Location: '.$config['path'].'?p=me');
exit;
}
}
else
{
if ($page == 'login' || $page == 'register')
{
// How to just show opposite of this != does not work ;llll
}
else
{
header('Location: '.$config['path'].'?p=login');
exit;
}
}
Edit:
PHP Code:if ($page == 'login' || $page == 'register')
{
if (DH_LOGGED)
{
header('Location: '.$config['path'].'?p=me');
exit;
}
}
else
{
if (!DH_LOGGED)
{
header('Location: '.$config['path'].'?p=login');
exit;
}
}
($page != 'login' && $page != 'register')
Or
(!($page == 'login' || $page == 'register'))
Lol :)
RESTful style
((DH_LOGGED && ($page == 'login' || $page == 'register')) ? exit(header("location: {$config['path']}?p=me")) : '');
Screenshot dump:
I haven't done much today, it's been a busy day for me, but I didn't want to stop the updates coming through to you guys so here's a minimal update, but I promise the next update on development will be bigger!
Looks good =]
Screenshot dump:
More updates to come?
Wow - Nice, I ♥ everything you have done so far - Although you could of done the rule - New CMS, New Theme? - Not hard to pay someone to design a nice CMS ? - Then code your tidy CSS - I do like what you've done though - More snippets?