From 6f82b1dccf19dfe6b1e68838616284966f2a99a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20H=C3=A4ggqvist?= Date: Tue, 17 Mar 2009 23:36:06 +0100 Subject: [PATCH] Change themedir_abs into two variables holding paths to the private and public version. --- private/themesite.class.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/private/themesite.class.php b/private/themesite.class.php index ec755fb..ca6bd34 100644 --- a/private/themesite.class.php +++ b/private/themesite.class.php @@ -24,18 +24,14 @@ require_once('db.class.php'); class themesite { private $db; - private $themedir_abs; + private $themedir_public; + private $themedir_private; public function __construct($dbfile) { $this->db = new db($dbfile); - $this->themedir_abs = sprintf("%s/%s", $_SERVER['DOCUMENT_ROOT'], config::datadir); - - /* Make sure the theme dir exists */ - if (!file_exists($this->themedir_abs)) { - if (!@mkdir($this->themedir_abs)) { - die("The theme dir doesn't exist, and I can't create it. Giving up."); - } - } + $this->themedir_public = sprintf("%s/%s/%s", $_SERVER['DOCUMENT_ROOT'], config::path, config::datadir); + $this->themedir_private = sprintf("%s/%s", preconfig::privpath, config::datadir); + printf("%s
\n%s
\n", $this->themedir_public, $this->themedir_private); } /* @@ -248,7 +244,7 @@ END; $remotelcd === false ? 'NULL' : sprintf("'%s'", db::quote($remotelcd)) ); $this->db->query($sql); - $themedir = sprintf("%s/%s", $this->themedir_abs, $mainlcd); + $themedir = sprintf("%s/%s", $this->themedir_public, $mainlcd); if (!file_exists($themedir)) { mkdir($themedir); } @@ -305,7 +301,7 @@ END; /* Create the destination dir */ $destdir = sprintf("%s/%s/%s", - $this->themedir_abs, + $this->themedir_public, $mainlcd, $shortname ); -- 2.11.4.GIT