hi, i didont know anywhere else to put this and seeing as i already have a post here and my topic now is relavent i will post here… sorry if its wrong place…
so i have tried to take in all that you’s have told me etc and iv come up with this…
index.php
[php]<?php
define ('FILE_SECURE', TRUE);
require_once './includes/mainfile.php';
siteindex();
?>[/php]
pages.php
[php]<?php
define ('FILE_SECURE', TRUE);
require_once './includes/mainfile.php';
getpagehtmlentities();
pagesredirecthome();
sitepages();
?>[/php]
pages/Media/index.php
[php]<?php
if(!defined(‘FILE_SECURE’))
{
die(‘No Direct File Access’);
}
$MEDIA_ID = array(
// ACTIVE MEDIA
‘News’,
‘Announcements’,
‘Blueprints’,
‘Off_Topic’,
);
if (!isset($subpage))
{
// DEFAULT MEDIA
require MEDIA_BASEDIR . ‘Announcements.php’;
require MEDIA_BASEDIR . ‘News.php’;
require MEDIA_BASEDIR . ‘Blueprints.php’;
require MEDIA_BASEDIR . ‘Off_Topic.php’;
}
else if (in_array($subpage, $MEDIA_ID, true) && is_readable(MEDIA_BASEDIR . $subpage . ‘.php’))
{
require MEDIA_BASEDIR . $subpage . ‘.php’;
}
else
{
http_response_code(404);
require PAGES_BASEDIR . $error . ‘/index.php’;
}
?>[/php]
i.e pages/Media/Off_Topic.php
[php]<?php
if(!defined(‘FILE_SECURE’))
{
die(‘No Direct File Access’);
}
?>
<?php
$news_title = 'Off Topic Content';
$news_cat = 'Off Topic';
$news_date_time = '';
THEMENEWSTOP();
?>
No Off Topic Content Here Yet!
<?php THEMENEWSBOTTOM(); ?>
<?php
// END OF SOME NEWS
if (isset($subpage))
{
if ($subpage == 'Off_Topic')
{
// START OF ALL NEWS
?>
Go Back...   
<?php
}
}
else
{
echo '
All Off Topic...   
';
}
?>[/php]
includes/header.php
[php]<?php
if(!defined(‘FILE_SECURE’))
{
die(‘No Direct File Access’);
}
echo <<<HTML
HTML;
pagetitles();
echo <<<HTML
HTML;
THEMEHEADER();
?>[/php]
includes/footer.php
[php]<?php
if(!defined(‘FILE_SECURE’))
{
die(‘No Direct File Access’);
}
THEMEFOOTER();
echo <<<HTML
HTML;
?>[/php]
includes/mainfile.php
[php]<?php
if(!defined(‘FILE_SECURE’))
{
die(‘No Direct File Access’);
}
//directories
const PAGES_BASEDIR = ‘./pages/’;
const INCLUDES_BASEDIR = ‘./includes/’;
const BLOCKS_BASEDIR = ‘./blocks/’;
const MEDIA_BASEDIR = ‘./pages/Media/’;
//site name
$sitename = ‘[zonepimps]’;
//site meta
$site_meta_keywords = ‘[zonepimps], Free4all, Fun4all, Creativerse, Creativerse Pro, creativerse pro, pro, Pro, PRO, creativerse, creative, Creative, Free, free, Free Services, free services, Games, games, Support, support, Forums, forums, Forum, forum, gaming, Gaming, teamspeak, Teamspeak’;
$site_meta_description = ‘[zonepimps] - Creativerse - PlayFair’;
$site_meta_author = ‘[zonepimps]’;
//default homepage
$defaultpage = ‘Home’;
//theme name
$themename = ‘creativersev2’;
//custom error404 page
$error = ‘Error404’;
//show blocks
//left
$showblocksleft = 1;
//right
$showblocksright = 1;
//mobile
$showblocksmobile = 1;
//FUNCTIONS ONLY BELOW HERE
//FUNCTIONS ONLY BELOW HERE
//include mobile detect function
require_once INCLUDES_BASEDIR . ‘/mobile_detect.php’;
$detect = new Mobile_Detect();
//set isset $_GET to be used in the code
function getpagehtmlentities()
{
global $page, $subpage;
if (isset($_GET[‘page’]))
{
$page = htmlentities($_GET[‘page’]);
}
if (isset($_GET[‘id’]))
{
$subpage = htmlentities($_GET[‘id’]);
}
}
//page titles (change the site name above)
function pagetitles()
{
global $sitename, $page, $subpage, $defaultpage;
if (!isset($page))
{
echo $sitename . ’ - ’ . $defaultpage;
}
else if (isset($subpage))
{
echo $sitename . ’ - ’ . $page . ’ - ’ . $subpage;
}
else if (isset($page))
{
echo $sitename . ’ - ’ . $page;
}
}
//redirect to index if the default homepage is called in pages.php
function pagesredirecthome()
{
global $page, $defaultpage;
if ($page == $defaultpage)
{
header(‘Location: ./’);
exit;
}
}
//include theme functions
require_once ‘./themes/’.$themename.’/theme.php’;
//START OF BLOCKS CONFIGURATION
//mobile blocks
function PAGE_BLOCKS_MOBILE()
{
global $block_title, $showblocksmobile;
if ($showblocksmobile == 1)
{
require BLOCKS_BASEDIR.‘block_links.php’;
require BLOCKS_BASEDIR.‘block_random-image.php’;
require BLOCKS_BASEDIR.‘block_getgame.php’;
require BLOCKS_BASEDIR.‘block_securesite.php’;
}
}
//left side blocks
function PAGE_BLOCKS_LEFT()
{
global $block_title, $showblocksleft;
if ($showblocksleft == 1)
{
require BLOCKS_BASEDIR.‘block_random-image.php’;
}
}
//right side blocks
function PAGE_BLOCKS_RIGHT()
{
global $block_title, $showblocksright;
if ($showblocksright == 1)
{
require BLOCKS_BASEDIR.‘block_links.php’;
require BLOCKS_BASEDIR.‘block_getgame.php’;
require BLOCKS_BASEDIR.‘block_securesite.php’;
}
}
//END OF BLOCKS CONFIGURATION
//index.php
function siteindex()
{
global $defaultpage, $site_meta_keywords, $site_meta_description, $site_meta_author, $detect, $news_cat, $news_title, $news_date_time;
require_once INCLUDES_BASEDIR . ‘header.php’;
require_once PAGES_BASEDIR . $defaultpage . ‘/index.php’;
require_once INCLUDES_BASEDIR . ‘footer.php’;
}
//pages.php
function sitepages()
{
global $page, $subpage, $error, $site_meta_keywords, $site_meta_description, $site_meta_author, $detect, $news_cat, $news_title, $news_date_time;
if (file_exists(PAGES_BASEDIR . $page . “/index.php”))
{
require_once INCLUDES_BASEDIR . ‘header.php’;
require_once PAGES_BASEDIR . $page.’/index.php’;
require_once INCLUDES_BASEDIR . ‘footer.php’;
}
else
{
http_response_code(404);
require_once INCLUDES_BASEDIR . ‘header.php’;
require_once PAGES_BASEDIR . $error.’/index.php’;
require_once INCLUDES_BASEDIR . ‘footer.php’;
}
}
?>[/php]
mobile detect is code google made, apart from that i have wrote all of this pretty much… go easy on me im still a noobie but iv had alot of fun doing it 
here is my crappy theme haha i’m going to learn how to use
and styles… years ago we used but i see no one uses them anymore.
themes/$themename/theme.php
[code]<?php
if(!defined(‘FILE_SECURE’))
{
die(‘No Direct File Access’);
}
function THEMEHEADER()
{
global $detect;
echo <<<HTML
HTML;
//DETECT MOBILE USER
if (!$detect->isMobile())
{
//PAGE BLOCKS
PAGE_BLOCKS_LEFT();
echo <<<HTML
|
HTML;
}
}
function THEMENEWSTOP()
{
global $news_cat, $news_title;
echo <<<HTML
|
    $news_cat:
|
$news_title
|
|
HTML;
}
function THEMENEWSBOTTOM()
{
global $news_date_time;
echo <<<HTML
Posted - $news_date_time   
HTML;
}
function THEMEBLOCKTOP()
{
global $block_title;
echo <<<HTML
$block_title
HTML;
}
function THEMEBLOCKBOTTOM()
{
echo ' |
';
}
function THEMEFOOTER()
{
global $detect;
//DETECT MOBILE USER
if ($detect->isMobile())
{
PAGE_BLOCKS_MOBILE();
}
else
{
echo <<<HTML
|
HTML;
//PAGE BLOCKS RIGHT
PAGE_BLOCKS_RIGHT();
}
echo <<<HTML
|
[zonepimps] 2016
|
HTML;
}
?>[/code]
thankyou again.