From 7be113be2092be8741b31b5a4de428e5e07f5d43 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 11 Mar 2008 17:28:30 +0000 Subject: Fixes for previous git-svn-id: https://code.elgg.org/elgg/trunk@169 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 9 +++++++-- engine/lib/plugins.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 973de2680..cb1651f40 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -56,6 +56,7 @@ global $CONFIG, $strings; static $usercache; + if (!is_array($usercache)) { $usercache = array(); } @@ -112,6 +113,7 @@ } if (file_exists($location . "{$viewtype}/{$view}.php") && !@include($location . "{$viewtype}/{$view}.php")) { $success = false; + if ($viewtype != "default") { if (@include($location . "default/{$view}.php")) { $success = true; @@ -121,6 +123,7 @@ echo " [This view ({$view}) does not exist] "; } } else if ($CONFIG->debug == true) { + echo $location . "{$viewtype}/{$view}.php"; echo " [This view ({$view}) does not exist] "; } @@ -192,10 +195,12 @@ while ($view = readdir($handle)) { if (!in_array($view,array('.','..','.svn','CVS')) && !is_dir($folder . "/" . $view)) { if (substr_count($view,".php") > 0) { - set_view_location($view_base . "/" . str_replace(".php","",$view), $base_location_path); + if (!empty($view_base)) { $view_base_new = $view_base . "/"; } else { $view_base_new = ""; } + set_view_location($view_base_new . str_replace(".php","",$view), $base_location_path); } } else if (!in_array($view,array('.','..','.svn','CVS')) && is_dir($folder . "/" . $view)) { - autoregister_views($view_base . "/" . $view, $folder . "/" . $view, $base_location_path); + if (!empty($view_base)) { $view_base_new = $view_base . "/"; } else { $view_base_new = ""; } + autoregister_views($view_base_new . $view, $folder . "/" . $view, $base_location_path); } } } diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 92294faea..447be32af 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -29,7 +29,7 @@ if (!@include($CONFIG->pluginspath . $mod . "/start.php")) throw new PluginException("{$mod} is a misconfigured plugin."); if (is_dir($CONFIG->pluginspath . $mod . "/views/default")) { - autoregister_views($mod,$CONFIG->pluginspath . $mod . "/views/default",$CONFIG->pluginspath . $mod . "/views"); + autoregister_views("",$CONFIG->pluginspath . $mod . "/views/default",$CONFIG->pluginspath . $mod . "/views/"); } } } -- cgit v1.2.3