From: Jonas Häggqvist Date: Tue, 17 Mar 2009 22:36:06 +0000 (+0100) Subject: Change themedir_abs into two variables holding paths to the private and public version. X-Git-Url: https://repo.or.cz/w/rockboxthemes.git/commitdiff_plain/6f82b1dccf19dfe6b1e68838616284966f2a99a6 Change themedir_abs into two variables holding paths to the private and public version. --- 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 );