From cb7e7394b9ffee266f44767c937e51ca9b7e1d82 Mon Sep 17 00:00:00 2001 From: dairiki Date: Thu, 17 Jan 2002 22:52:04 +0000 Subject: [PATCH] Eliminate DataURL() in favor of Theme::getImageURL(). git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@1304 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- index.php | 22 +++++++++++++++++----- lib/Theme.php | 15 ++++++++++----- lib/plugin/RecentChanges.php | 10 ++++++++-- lib/stdlib.php | 9 +-------- themes/default/templates/top.tmpl | 6 +++--- 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/index.php b/index.php index c96741097..8d6d67a05 100644 --- a/index.php +++ b/index.php @@ -68,7 +68,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA define ('PHPWIKI_VERSION', '1.3.2-jeffs-hacks'); require "lib/prepend.php"; -rcs_id('$Id: index.php,v 1.65 2002-01-17 20:58:40 carstenklapp Exp $'); +rcs_id('$Id: index.php,v 1.66 2002-01-17 22:52:03 dairiki Exp $'); ///////////////////////////////////////////////////////////////////// // @@ -417,11 +417,23 @@ define('INTERWIKI_MAP_FILE', "lib/interwiki.map"); //define('SCRIPT_NAME', '/some/where/index.php'); /* - * Relative URL (from the server root) of the directory from which - * other relative URL's for images and other support files are - * interpreted. + * URL of the PhpWiki install directory. (You only need to set this + * if you've moved index.php out of the install directory.) This can + * be either a relative URL (from the directory where the top-level + * PhpWiki script is) or an absolute one. */ -//define('DATA_PATH', '/some/where'); +//define('DATA_PATH', '/some/where/phpwiki'); + +/* + * Path to the PhpWiki install directory. This is the local + * filesystem counterpart to DATA_PATH. (If you have to set + * DATA_PATH, your probably have to set this as well.) This can be + * either an absolute path, or a relative path interpreted from the + * directory where the top-level PhpWiki script (normally index.php) + * resides. + */ +//define('PHPWIKI_DIR', '/htdocs/some/where/phpwiki'); + /* * Define to 'true' to use PATH_INFO to pass the pagename's. diff --git a/lib/Theme.php b/lib/Theme.php index e935c2b59..31fe2becd 100644 --- a/lib/Theme.php +++ b/lib/Theme.php @@ -1,9 +1,11 @@ -_name = $theme_name; - $this->_path = array("themes/$theme_name", "themes/default"); + $themes_dir = defined('PHPWIKI_DIR') ? PHPWIKI_DIR . "/themes" : "themes"; + $this->_path = array("$themes_dir/$theme_name", + "$themes_dir/default"); } function _findFile ($file, $missing_okay = false) { @@ -24,9 +26,12 @@ class Theme { function _findData ($file, $missing_okay = false) { $path = $this->_findFile($file, $missing_okay); - if ($path) - return DataURL($path); // FIXME: can eliminate DataURL()? - return false; + if (!$path) + return false; + + if (defined('DATA_PATH')) + return DATA_PATH . "/$path"; + return $path; } //////////////////////////////////////////////////////////////// diff --git a/lib/plugin/RecentChanges.php b/lib/plugin/RecentChanges.php index 94b8fce3f..a275c10bd 100644 --- a/lib/plugin/RecentChanges.php +++ b/lib/plugin/RecentChanges.php @@ -1,5 +1,5 @@ getImageURL('logo'); + if (!$img_url) + return false; + return array('title' => WIKI_NAME, 'link' => WikiURL(_("HomePage"), false, 'absurl'), - 'url' => DataURL($GLOBALS['logo'])); + 'url' => $img_url); } function textinput_properties () { diff --git a/lib/stdlib.php b/lib/stdlib.php index 2e1099822..6171762f1 100644 --- a/lib/stdlib.php +++ b/lib/stdlib.php @@ -1,8 +1,7 @@ - stuff and the and . */ @@ -10,7 +10,7 @@ @@ -24,7 +24,7 @@ $Id: top.tmpl,v 1.1 2002-01-17 20:41:13 dairiki Exp $ - + getCSS() ?> <?=$WIKI_NAME?> - <?=$TITLE?> -- 2.45.0