Not as easy as it sounds 😉
Added the period, but still haven't made any progress. I'm going to give you all the code that is being ran for one particular page, and perhaps you'll be able to tell me what's wrong. Sorry this is taking so long dude.
Here's the index page with the function that you made (with 2 modifications by me), and the code that's actually doing the includes/echo:
<?PHP
function loadInclude($file, $default, $dir='content/')
{
if(substr($dir, -1) != '/') $dir .= '/';
if(empty($file) || !$file) $file = $default;
if(!file_exists($dir . $file . '.php')) $file = $default;
echo 'Including: ' . $dir . $file . '.php<br />';
include($dir . $file . '.php');
}
loadInclude($_GET['pa'], 'news/news', 'content/'); //I added this bit
loadInclude($_GET['b'], 'index', 'content/products/books/');
loadInclude($_GET['cl'], 'index', 'content/products/clothing/');
loadInclude($_GET['co'], 'index', 'content/products/collectibles/');
loadInclude($_GET['g'], 'index', 'content/products/games/');
loadInclude($_GET['mi'], 'index', 'content/products/misc/');
loadInclude($_GET['m'], 'index', 'content/products/movies/');
loadInclude($_GET['p'], 'index', 'content/products/posters/');
loadInclude($_GET['t'], 'index', 'content/products/toys/');
$default = include ('content/news/news.php'); //I added this bit
//This is where all the includes/echos are happening
include('layout/before.php');
echo $page_Header;
include('layout/space.php');
echo $page_Text;
include('layout/after.php');
?>
Here's a short example page: (index.php?pa=chat)
<?PHP
$page_Header .= 'Online Chat';
$page_Text .= '
<div class="main-content-font">
Sort out IRC after site is uploaded.
</div>
';
?>
When I view that page, I've checked my error log and I get no errors, and I get this at the top:
Including: content/chat.php
Including: content/products/books/index.php
Including: content/products/clothing/index.php
Including: content/products/collectibles/index.php
Including: content/products/games/index.php
Including: content/products/misc/index.php
Including: content/products/movies/index.php
Including: content/products/posters/index.php
Including: content/products/toys/index.php
So it looks like it is calling in the right file, but for some reason none of the echos work. Every single page just echos the $default news/news text.