diff --git a/classes/Controller.php b/classes/Controller.php
index 924ba40..dafbd5f 100644
--- a/classes/Controller.php
+++ b/classes/Controller.php
@@ -5,21 +5,24 @@ class Controller {
public function __construct() {
global $smarty;
- $sections = Config::get('sections');
-
- if (
- isset($_REQUEST['section']) && in_array($_REQUEST['section'], array_keys($sections))
- || file_exists('../logic/' . $_REQUEST['section'] . ($_REQUEST['action'] ? '.' . $_REQUEST['action'] : null) . '.php')
- ) {
- $section = $_REQUEST['section'];
+ define('PATH', '../logic/');
- if (isset($_REQUEST['action'])) {
- $action = $_REQUEST['action'];
+ $section = $action = null;
+
+ if (isset($_REQUEST['section'])) {
+ // Check for section.action.php
+ if (isset($_REQUEST['action']) && file_exists(PATH . $_REQUEST['section'] . '.' . $_REQUEST['action'] . '.php')) {
+ $section = $_REQUEST['section'];
+ $action = $_REQUEST['action'];
+ }
+ // else check for section.php
+ else if (file_exists(PATH . $_REQUEST['section'] . '.php')) {
+ $section = $_REQUEST['section'];
+ }
+ // else use the default section
+ else {
+ $section = Config::get('default');
}
- }
- else {
- $section = Config::get('default');
- $action = '';
}
$file = '../logic/' . $section . ($action ? '.' . $action : null) . '.php';
@@ -30,6 +33,8 @@ class Controller {
}
/*
+ @todo not sure I need this at all anymore...
+
if (!file_exists('../templates/' . $template)) {
$section = Config::get('default');
$action = '';
@@ -47,10 +52,10 @@ class Controller {
}
*/
- $smarty->assign('sections', $sections);
- $smarty->assign('section', $section);
- $smarty->assign('action', $action);
- $smarty->assign('template', $template);
+ $smarty->assign('navigation', Config::get('navigation'));
+ $smarty->assign('section', $section);
+ $smarty->assign('action', $action);
+ $smarty->assign('template', $template);
header('Content-type: text/html; charset=UTF-8');
$smarty->display('index.tpl');
diff --git a/config/joshtronic.com.xml b/config/joshtronic.com.xml
new file mode 100755
index 0000000..bb5b425
--- /dev/null
+++ b/config/joshtronic.com.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+ true
+
+
+ localhost
+ joshtronic
+ j05h7r0n1c
+ joshtronic
+
+ about
+
+ About
+ Family
+ Music
+ Code
+
+
+
+
diff --git a/config/verynicenoise.com.xml b/config/verynicenoise.com.xml
index e5aa65a..98f7a55 100755
--- a/config/verynicenoise.com.xml
+++ b/config/verynicenoise.com.xml
@@ -12,14 +12,14 @@
verynicenoise
home
-
+
Home
About
Releases
Artists
Shop
Contact
-
+
News
Releases
diff --git a/jLib.php b/jLib.php
index cc87d1e..33eead7 100755
--- a/jLib.php
+++ b/jLib.php
@@ -9,17 +9,18 @@ function __autoload($class) {
// Obliterates any passed in PHPSESSID (thanks Google)
if (stripos($_SERVER['REQUEST_URI'], '?PHPSESSID=') !== false) {
list($request_uri, $phpsessid) = split('\?PHPSESSID=', $_SERVER['REQUEST_URI'], 2);
- header("HTTP/1.1 301 Moved Permanently");
- header("Location: {$request_uri}");
+ header('HTTP/1.1 301 Moved Permanently');
+ header('Location: ' . $request_uri);
exit();
}
// XHTML compliancy stuff
ini_set('arg_separator.output', '&');
-ini_set('url_rewriter.tags', 'a=href,area=href,frame=src,input=src,fieldset=');
+ini_set('url_rewriter.tags', 'a=href,area=href,frame=src,input=src,fieldset=');
// Strips the subdomain before loading the configuration file
-$config_array = split('\.', $_SERVER['SERVER_NAME']);
+$config_array = split('\.', $_SERVER['SERVER_NAME']);
+$subless_server = null;
if (count($config_array) == 3) {
$subless_server = $config_array[1] . '.' . $config_array[2];
}
@@ -27,7 +28,7 @@ if (count($config_array) == 3) {
// Do some prep work if we're working locally
if (strpos($_SERVER['SERVER_NAME'], '.localhost')) {
foreach (array('com', 'net', 'org') as $tld) {
- $config = str_replace('.localhost', '.' . $tld, $config);
+ $config = str_replace('.localhost', '.' . $tld, $_SERVER['SERVER_NAME']);
if (Config::check($config)) {
$_SERVER['SERVER_NAME'] = $config;