From 236995de5e47957ce52bf41d737727659b63df68 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20H=C3=A4ggqvist?= Date: Thu, 19 Mar 2009 17:12:24 +0100 Subject: [PATCH] Remove some oooold debug code and make sure the public/private separation works properly. --- private/config.inc.php | 3 --- private/preamble.inc.php | 18 ++---------------- private/templater.class.php | 2 +- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/private/config.inc.php b/private/config.inc.php index 5d6bb48..6b534a7 100644 --- a/private/config.inc.php +++ b/private/config.inc.php @@ -43,9 +43,6 @@ class config { // Location to store theme data. Relative to the path given above - must be web-accessible const datadir = "themes"; - // Location of the private (not web-accessible) dir - const privdir = "../private"; - // Location of the db within the above dir. Don't make it web-accessible. const dbfile = "themes.db"; diff --git a/private/preamble.inc.php b/private/preamble.inc.php index c3ed2cd..68ff854 100644 --- a/private/preamble.inc.php +++ b/private/preamble.inc.php @@ -20,30 +20,16 @@ * ****************************************************************************/ -require_once('../private/config.inc.php'); +require_once(sprintf("%s/config.inc.php", preconfig::privpath)); require_once('themesite.class.php'); require_once('templater.class.php'); -/* temporary shit */ -/* -unlink(config::dbfile); -unlink(sprintf("%s/176x220/widecabbie/%s", config::datadir, 'widecabbie.zip')); -unlink(sprintf("%s/176x220/widecabbie/%s", config::datadir, 'widecabbie-menu.png')); -unlink(sprintf("%s/176x220/widecabbie/%s", config::datadir, 'widecabbie-wide.png')); -rmdir(sprintf("%s/176x220/widecabbie", config::datadir)); -/* Delete the above */ - -$site = new themesite(config::privdir .'/' . config::dbfile); +$site = new themesite(preconfig::privpath .'/' . config::dbfile); $t = new templater(config::smartydir); $t->assign('datadir', config::datadir); $t->assign('root', config::path); $t->assign('hostname', config::hostname); $t->assign('maxuploadsize', config::maxzippedsize); -/* More temporary shit */ -//$site->addtarget('e200', 'Sandisk Sansa E200', '176x220', 'e200-small.png', '16'); -//$site->addtarget('ipodnano', 'Apple Ipod Nano 1G', '176x132', 'ipodnano-small.png', '16'); -/* Delete this as well */ - $values = array(); ?> diff --git a/private/templater.class.php b/private/templater.class.php index a17ce47..5755ecb 100644 --- a/private/templater.class.php +++ b/private/templater.class.php @@ -28,7 +28,7 @@ class templater { /* Load and set up Smarty */ require_once(sprintf("%s/Smarty.class.php", $smartydir)); $s = new smarty(); - $s->template_dir = sprintf("%s/templates", config::privdir); + $s->template_dir = sprintf("%s/templates", preconfig::privpath); $s->compile_dir = sprintf("%s/compiled", $s->template_dir); $s->cache_dir = sprintf("%s/cache", $s->template_dir); $s->caching = false; -- 2.11.4.GIT