1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-09 16:17:14 +02:00

Install fixes and notice removal

This commit is contained in:
CaMer0n
2009-09-17 00:13:40 +00:00
parent 8f1e2bea62
commit db3a16fdc6
8 changed files with 148 additions and 101 deletions

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/emote_filter.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/emote_filter.php,v $
| $Revision: 1.4 $ | $Revision: 1.5 $
| $Date: 2009-09-01 20:09:35 $ | $Date: 2009-09-17 00:13:39 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -35,6 +35,11 @@ class e_emotefilter {
$this->emotes = $sysprefs->getArray("emote_".$pref['emotepack']); $this->emotes = $sysprefs->getArray("emote_".$pref['emotepack']);
if(!vartrue($this->emotes))
{
return;
}
foreach($this->emotes as $key => $value) foreach($this->emotes as $key => $value)
{ {

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/event_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/event_class.php,v $
| $Revision: 1.6 $ | $Revision: 1.7 $
| $Date: 2009-01-22 23:14:48 $ | $Date: 2009-09-17 00:13:39 $
| $Author: lisa_ $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -71,11 +71,12 @@ class e107_event
} }
if(isset($pref['e_admin_events_list']) && is_array($pref['e_admin_events_list'])) if(isset($pref['e_admin_events_list']) && is_array($pref['e_admin_events_list']))
{ {
$called = getcachedvars('admin_events_called'); // $called = getcachedvars('admin_events_called');
$called = e107::getRegistry('core/cachedvars/admin_events_called', false);
if(!is_array($called)) { $called = array(); } if(!is_array($called)) { $called = array(); }
foreach($pref['e_admin_events_list'] as $plugin) foreach($pref['e_admin_events_list'] as $plugin)
{ {
if(plugInstalled($plugin)) if(e107::isInstalled($plugin))
{ {
$func = 'plugin_'.$plugin.'_admin_events'; $func = 'plugin_'.$plugin.'_admin_events';
if(!function_exists($func)) if(!function_exists($func))
@@ -89,7 +90,8 @@ class e107_event
if ($event_func && function_exists($event_func) && !in_array($event_func, $called)) if ($event_func && function_exists($event_func) && !in_array($event_func, $called))
{ {
$called[] = $event_func; $called[] = $event_func;
cachevars('admin_events_called', $called); // cachevars('admin_events_called', $called);
e107::setRegistry('core/cachedvars/admin_events_called', $called);
call_user_func($event_func); call_user_func($event_func);
} }
} }
@@ -120,7 +122,7 @@ class e107_event
{ {
foreach($pref['e_event_list'] as $hook) foreach($pref['e_event_list'] as $hook)
{ {
if(plugInstalled($hook)) if(e107::isInstalled($hook))
{ {
if(is_readable(e_PLUGIN.$hook."/e_event.php")) if(is_readable(e_PLUGIN.$hook."/e_event.php"))
{ {

View File

@@ -9,9 +9,9 @@
* mySQL Handler * mySQL Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
* $Revision: 1.52 $ * $Revision: 1.53 $
* $Date: 2009-09-13 10:29:56 $ * $Date: 2009-09-17 00:13:39 $
* $Author: secretr $ * $Author: e107coders $
*/ */
if(defined('MYSQL_LIGHT')) if(defined('MYSQL_LIGHT'))
@@ -24,7 +24,7 @@ if(defined('MYSQL_LIGHT'))
$sql = new db; $sql = new db;
$sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb); $sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
} }
elseif(defined('E107_INSTALL')) //TODO Remove the need for this if possible elseif(defined('E107_INSTALL'))
{ {
define('E107_DEBUG_LEVEL', 0); define('E107_DEBUG_LEVEL', 0);
define('e_QUERY', ''); define('e_QUERY', '');
@@ -49,8 +49,8 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s
* *
* @package e107 * @package e107
* @category e107_handlers * @category e107_handlers
* @version $Revision: 1.52 $ * @version $Revision: 1.53 $
* @author $Author: secretr $ * @author $Author: e107coders $
* *
*/ */
class e_db_mysql { class e_db_mysql {
@@ -93,8 +93,9 @@ class e_db_mysql {
e107::getSingleton('e107_traffic')->BumpWho('Create db object', 1); e107::getSingleton('e107_traffic')->BumpWho('Create db object', 1);
$this->mySQLPrefix = MPREFIX; // Set the default prefix - may be overridden $this->mySQLPrefix = MPREFIX; // Set the default prefix - may be overridden
$langid = 'e107language_'.$pref['cookie_name'];
if ($pref['user_tracking'] == 'session') $langid = (isset($pref['cookie_name'])) ? 'e107language_'.$pref['cookie_name'] : 'e107language_temp';
if (isset($pref['user_tracking']) && ($pref['user_tracking'] == 'session'))
{ {
if (!isset($_SESSION[$langid])) { return; } if (!isset($_SESSION[$langid])) { return; }
$this->mySQLlanguage = $_SESSION[$langid]; $this->mySQLlanguage = $_SESSION[$langid];

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
| $Revision: 1.86 $ | $Revision: 1.87 $
| $Date: 2009-09-16 13:01:17 $ | $Date: 2009-09-17 00:13:39 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -1058,10 +1058,10 @@ class e107plugin
} }
} }
} }
//main menu items //main menu items
if(isset($plug_vars['menuLink'])) if(isset($plug_vars['menuLink']))
{ {
foreach($plug_vars['menuLink'] as $link) foreach($plug_vars['menuLink'] as $link)
{ {
$attrib = $link['@attributes']; $attrib = $link['@attributes'];
@@ -1147,12 +1147,18 @@ class e107plugin
} }
} }
} }
//Plugin pref items
if(isset($plug_vars['pluginPrefs']))
{
//TODO plugin pref handling.
}
//Userclasses //Userclasses
//$this->manage_userclass('add', $eplug_userclass, $eplug_userclass_description); //$this->manage_userclass('add', $eplug_userclass, $eplug_userclass_description);
if(isset($plug_vars['userclass'])) if(isset($plug_vars['userclass']))
{ {
$uclass_list = (isset($plug_vars['userclass'][0]) ? $plug_vars['userclass'] : array($plug_vars['userclass']));
foreach($uclass_list as $uclass) foreach($uclass_list as $uclass)
{ {
$attrib = $uclass['@attributes']; $attrib = $uclass['@attributes'];
@@ -1195,7 +1201,6 @@ class e107plugin
//Extended user fields //Extended user fields
if(isset($plug_vars['extendedField'])) if(isset($plug_vars['extendedField']))
{ {
$efield_list = (isset($plug_vars['extendedField'][0]) ? $plug_vars['extendedField'] : array($plug_vars['extendedFields']));
foreach($efield_list as $efield) foreach($efield_list as $efield)
{ {
$attrib = $efield['@attributes']; $attrib = $efield['@attributes'];
@@ -1244,8 +1249,7 @@ class e107plugin
//If any commentIDs are configured, we need to remove all comments on uninstall //If any commentIDs are configured, we need to remove all comments on uninstall
if($function == 'uninstall' && isset($plug_vars['commentID'])) if($function == 'uninstall' && isset($plug_vars['commentID']))
{ {
$commentArray = (is_array($plug_vars['commentID']) ? $plug_vars['commentID'] : array($plug_vars['commentID'])); $txt .= 'Removing all plugin comments: ('.implode(', ', $plug_vars['commentID']).')<br />';
$txt .= 'Removing all plugin comments: ('.implode(', ', $commentArray).')<br />';
$this->manage_comments('remove', $commentArray); $this->manage_comments('remove', $commentArray);
} }
@@ -1749,7 +1753,7 @@ class e107plugin
$ret['@attributes']['name'] = varset($eplug_name); $ret['@attributes']['name'] = varset($eplug_name);
$ret['@attributes']['compatibility'] = varset($eplug_compatible); $ret['@attributes']['compatibility'] = varset($eplug_compatible);
$ret['folder'] = varset($eplug_folder); $ret['folder'] = varset($eplug_folder);
$ret['category'] = $this->manage_category($eplug_category); $ret['category'] = varset($eplug_category) ? $this->manage_category($eplug_category) : "misc";
$ret['description'] = varset($eplug_description); $ret['description'] = varset($eplug_description);
$ret['author']['@attributes']['name'] = varset($eplug_author); $ret['author']['@attributes']['name'] = varset($eplug_author);
$ret['author']['@attributes']['url'] = varset($eplug_url); $ret['author']['@attributes']['url'] = varset($eplug_url);
@@ -1779,7 +1783,7 @@ class e107plugin
// loadLanFiles($plugName, 'admin'); // Look for LAN files on default paths // loadLanFiles($plugName, 'admin'); // Look for LAN files on default paths
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; $xml = new xmlClass;
$xml->setOptArrayTags('extendedField,userclass,menuLink'); // always arrays for these tags. $xml->setOptArrayTags('extendedField,userclass,menuLink,commentID'); // always arrays for these tags.
$this->plug_vars = $xml->loadXMLfile(e_PLUGIN.$plugName.'/plugin.xml', true, true); $this->plug_vars = $xml->loadXMLfile(e_PLUGIN.$plugName.'/plugin.xml', true, true);
if ($this->plug_vars === FALSE) if ($this->plug_vars === FALSE)
@@ -1790,7 +1794,7 @@ class e107plugin
return FALSE; return FALSE;
} }
$this->plug_vars['category'] = $this->manage_category($this->plug_vars['category']); $this->plug_vars['category'] = (isset($this->plug_vars['category'])) ? $this->manage_category($this->plug_vars['category']) : "misc";
return TRUE; return TRUE;
} }

View File

@@ -9,8 +9,8 @@
* e107 Admin Theme Handler * e107 Admin Theme Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $
* $Revision: 1.51 $ * $Revision: 1.52 $
* $Date: 2009-09-02 02:38:50 $ * $Date: 2009-09-17 00:13:39 $
* $Author: e107coders $ * $Author: e107coders $
*/ */
@@ -33,6 +33,7 @@ class themeHandler{
var $frm; var $frm;
var $fl; var $fl;
var $themeConfigObj = null; var $themeConfigObj = null;
var $noLog = FALSE;
public $allowedCategories = array( public $allowedCategories = array(
'generic', 'generic',
'adult', 'adult',
@@ -58,8 +59,7 @@ class themeHandler{
require_once(e_HANDLER."form_handler.php"); require_once(e_HANDLER."form_handler.php");
$this->frm = new e_form(); //enable inner tabindex counter $this->frm = new e_form(); //enable inner tabindex counter
require_once(e_HANDLER."file_class.php"); $this->fl = e107::getFile();
$this->fl = new e_file;
if (isset($_POST['upload'])) if (isset($_POST['upload']))
@@ -67,7 +67,7 @@ class themeHandler{
$this -> themeUpload(); $this -> themeUpload();
} }
$this -> themeArray = $this -> getThemes(); $this->themeArray = (defined('E107_INSTALL')) ? $this -> getThemes('xml') : $this -> getThemes();
// print_a($this -> themeArray); // print_a($this -> themeArray);
@@ -155,6 +155,7 @@ class themeHandler{
} }
function getThemes($mode=FALSE) function getThemes($mode=FALSE)
{ {
@@ -165,6 +166,11 @@ class themeHandler{
while (false !== ($file = readdir($handle))) while (false !== ($file = readdir($handle)))
{ {
if(($mode == 'xml') && !is_readable(e_THEME.$file."/theme.xml"))
{
continue;
}
if ($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && is_readable(e_THEME.$file."/theme.php") ) if ($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && is_readable(e_THEME.$file."/theme.php") )
{ {
if($mode == "id") if($mode == "id")
@@ -267,8 +273,13 @@ class themeHandler{
* @param object $categoryfromXML * @param object $categoryfromXML
* @return * @return
*/ */
function getThemeCategory($categoryfromXML) function getThemeCategory($categoryfromXML='')
{ {
if(!$categoryfromXML)
{
return 'generic';
}
$tmp = explode(",",$categoryfromXML); $tmp = explode(",",$categoryfromXML);
$category = array(); $category = array();
foreach($tmp as $cat) foreach($tmp as $cat)
@@ -280,7 +291,7 @@ class themeHandler{
} }
else else
{ {
$category[] = '(invalid category)'; $category[] = 'generic';
} }
} }
@@ -891,8 +902,7 @@ class themeHandler{
{ {
$astext = ""; $astext = "";
require_once(e_HANDLER."file_class.php"); $file = e107::getFile();
$file = new e_file;
$adminstyles = $file -> get_files(e_ADMIN."includes"); $adminstyles = $file -> get_files(e_ADMIN."includes");
@@ -1013,34 +1023,54 @@ class themeHandler{
$ns->tablerender(TPVLAN_2, $text); $ns->tablerender(TPVLAN_2, $text);
} }
function setTheme()
/**
* Set Theme as Main Theme.
* @param object $name [optional] name (folder) of the theme to set.
* @return
*/
function setTheme($name='')
{ {
global $pref, $e107cache, $ns, $sql, $emessage; $core = e107::getConfig('core');
$sql = e107::getDb();
$emessage = eMessage::getInstance();
$themeArray = $this -> getThemes("id"); $themeArray = $this -> getThemes("id");
$pref['sitetheme'] = $themeArray[$this -> id]; $name = ($name) ? $name : $themeArray[$this -> id];
$pref['themecss'] ='style.css'; $layout = $pref['sitetheme_layouts'] = is_array($this->themeArray[$name]['layouts']) ? $this->themeArray[$name]['layouts'] : array();
$pref['sitetheme_deflayout'] = $this->findDefault($themeArray[$this -> id]); $deflayout = $this->findDefault($name);
$pref['sitetheme_layouts'] = is_array($this->themeArray[$pref['sitetheme']]['layouts']) ? $this->themeArray[$pref['sitetheme']]['layouts'] : array(); $customPages = $this->themeArray[$name]['custompages'];
$pref['sitetheme_custompages'] = $this->themeArray[$pref['sitetheme']]['custompages']; $version = $this->themeArray[$name]['version'];
$pref['sitetheme_version'] = $this->themeArray[$pref['sitetheme']]['version'];
$pref['sitetheme_releaseUrl'] = $this->themeArray[$pref['sitetheme']]['releaseUrl']; $core->set('sitetheme',$name);
$core->set('themecss','style.css');
$core->set('sitetheme_layouts',$layout);
$core->set('sitetheme_deflayout',$deflayout);
$core->set('sitetheme_custompages',$customPages);
$core->set('sitetheme_version',$version);
$core->set('sitetheme_releaseUrl',$this->themeArray[$name]['releaseUrl']);
$sql -> db_Delete("menus", "menu_layout !='' "); $sql -> db_Delete("menus", "menu_layout !='' ");
$e107cache->clear_sys(); ecache::clear_sys();
if(save_prefs())
if($core->save())
{ {
$emessage->add(TPVLAN_3." <b>'".$themeArray[$this -> id]."'</b>", E_MESSAGE_SUCCESS); //TODO LANs
$emessage->add(TPVLAN_3." <b>'".$themeArray[$this -> id]." v".$version."'</b>", E_MESSAGE_SUCCESS);
$emessage->add("Default Layout: ".$deflayout,E_MESSAGE_SUCCESS);
$emessage->add("Custom Pages: ".$customPages,E_MESSAGE_SUCCESS);
$this->theme_adminlog('01',$name.', style.css');
return TRUE;
} }
else else
{ {
$emessage->add(TPVLAN_3." <b>'".$themeArray[$this -> id]."'</b>", E_MESSAGE_ERROR); $emessage->add(TPVLAN_3." <b>'".$name."'</b>", E_MESSAGE_ERROR);
return FALSE;
} }
$this->theme_adminlog('01',$pref['sitetheme'].', '.$pref['themecss']);
// $ns->tablerender("Admin Message", "<br /><div style='text-align:center;'>".TPVLAN_3." <b>'".$themeArray[$this -> id]."'</b>.</div><br />");
} }
function findDefault($theme) function findDefault($theme)
@@ -1155,6 +1185,10 @@ class themeHandler{
// Log event to admin log // Log event to admin log
function theme_adminlog($msg_num='00', $woffle='') function theme_adminlog($msg_num='00', $woffle='')
{ {
if($this->noLog)
{
return;
}
global $pref, $admin_log; global $pref, $admin_log;
// if (!varset($pref['admin_log_log']['admin_banlist'],0)) return; // if (!varset($pref['admin_log_log']['admin_banlist'],0)) return;
$admin_log->log_event('THEME_'.$msg_num,$woffle,E_LOG_INFORMATIVE,''); $admin_log->log_event('THEME_'.$msg_num,$woffle,E_LOG_INFORMATIVE,'');
@@ -1239,6 +1273,7 @@ class themeHandler{
// loadLanFiles($path, 'admin'); // Look for LAN files on default paths // loadLanFiles($path, 'admin'); // Look for LAN files on default paths
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; $xml = new xmlClass;
$xml->setOptArrayTags('layout'); // layout should always be an array.
$vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true); $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true);
$vars['name'] = varset($vars['@attributes']['name']); $vars['name'] = varset($vars['@attributes']['name']);
@@ -1249,43 +1284,31 @@ class themeHandler{
$vars['email'] = varset($vars['author']['@attributes']['email']); $vars['email'] = varset($vars['author']['@attributes']['email']);
$vars['website'] = varset($vars['author']['@attributes']['url']); $vars['website'] = varset($vars['author']['@attributes']['url']);
$vars['author'] = varset($vars['author']['@attributes']['name']); $vars['author'] = varset($vars['author']['@attributes']['name']);
$vars['info'] = $vars['description']; $vars['info'] = varset($vars['description']);
$vars['category'] = $this->getThemeCategory($vars['category']); $vars['category'] = $this->getThemeCategory(varset($vars['category']));
$vars['xhtmlcompliant'] = varset($vars['compliance']['@attributes']['xhtml']); $vars['xhtmlcompliant'] = varset($vars['compliance']['@attributes']['xhtml']);
$vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']); $vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']);
$vars['path'] = $path; $vars['path'] = $path;
$vars['@attributes']['default'] = (strtolower($vars['@attributes']['default'])=='true') ? 1 : 0; $vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0;
unset($vars['authorEmail'],$vars['authorUrl'],$vars['xhtmlCompliant'],$vars['cssCompliant'],$vars['description']); unset($vars['authorEmail'],$vars['authorUrl'],$vars['xhtmlCompliant'],$vars['cssCompliant'],$vars['description']);
// Compile layout information into a more usable format. // Compile layout information into a more usable format.
$custom = array(); $custom = array();
foreach($vars['layouts'] as $layout) foreach($vars['layouts'] as $layout)
{ {
if(is_array($layout[0])) foreach($layout as $key=>$val)
{ {
foreach($layout as $key=>$val) $name = $val['@attributes']['name'];
unset($val['@attributes']['name']);
$lays[$name] = $val;
if(isset($val['customPages']))
{ {
$custom[$name] = array_filter(explode(" ",$val['customPages']));
$name = $val['@attributes']['name'];
unset($val['@attributes']['name']);
$lays[$name] = $val;
if(isset($val['customPages']))
{
$custom[$name] = array_filter(explode(" ",$val['customPages']));
}
}
}
else
{
$name = $layout['@attributes']['name'];
unset($layout['@attributes']['name']);
$lays[$name] = $layout;
if(isset($val['customPages']))
{
$custom[$name] = array_filter(explode(" ",$layout['customPages']));
} }
} }
} }
@@ -1293,7 +1316,7 @@ class themeHandler{
$vars['layouts'] = $lays; $vars['layouts'] = $lays;
$vars['path'] = $path; $vars['path'] = $path;
$vars['custompages'] = $custom; $vars['custompages'] = $custom;
return $vars; return $vars;
} }

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $
| $Revision: 1.41 $ | $Revision: 1.42 $
| $Date: 2009-08-22 21:27:34 $ | $Date: 2009-09-17 00:13:40 $
| $Author: e107steved $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -69,7 +69,7 @@ class user_class
function user_class() function user_class()
{ {
$this->sql_r = new db; $this->sql_r = e107::getDb('sql_r');
$this->isAdmin = FALSE; $this->isAdmin = FALSE;
$this->fixed_classes = array(e_UC_PUBLIC => UC_LAN_0, $this->fixed_classes = array(e_UC_PUBLIC => UC_LAN_0,

View File

@@ -9,8 +9,8 @@
* Simple XML Parser * Simple XML Parser
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/xml_class.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/xml_class.php,v $
* $Revision: 1.25 $ * $Revision: 1.26 $
* $Date: 2009-09-16 13:01:19 $ * $Date: 2009-09-17 00:13:40 $
* $Author: e107coders $ * $Author: e107coders $
*/ */
@@ -541,11 +541,10 @@ class xmlClass
return $vars; return $vars;
} }
// $array_tags = array("extendedField","userclass","menuLink");
foreach($this->arrayTags as $vl) foreach($this->arrayTags as $vl)
{ {
if(is_array($vars[$vl]) && !varset($vars[$vl][0])) if(isset($vars[$vl]) && is_array($vars[$vl]) && !varset($vars[$vl][0]))
{ {
$vars[$vl] = array($vars[$vl]); $vars[$vl] = array($vars[$vl]);
@@ -762,9 +761,9 @@ class xmlClass
$pref = array(); $pref = array();
foreach($XMLData['prefs'][$prefType] as $val) foreach($XMLData['prefs'][$prefType] as $val)
{ {
$value = (substr($val['@value'],0,7) == "array (") ? e107::getArrayStorage()->ReadArray($val['@value']) : $val['@value'];
$name = $val['@attributes']['name']; $name = $val['@attributes']['name'];
$value = (substr($val['@value'],0,7) == "array (") ? e107::getArrayStorage()->ReadArray($val['@value']) : $val['@value'];
$pref[$name] = $value; $pref[$name] = $value;
} }

View File

@@ -9,8 +9,8 @@
* Installation file * Installation file
* *
* $Source: /cvs_backup/e107_0.8/install_.php,v $ * $Source: /cvs_backup/e107_0.8/install_.php,v $
* $Revision: 1.38 $ * $Revision: 1.39 $
* $Date: 2009-09-13 12:12:23 $ * $Date: 2009-09-17 00:13:40 $
* $Author: e107coders $ * $Author: e107coders $
* *
*/ */
@@ -54,6 +54,8 @@ define("e_UC_MEMBER", 253);
define("e_UC_ADMIN", 254); define("e_UC_ADMIN", 254);
define("e_UC_NOBODY", 255); define("e_UC_NOBODY", 255);
define("E107_INSTALL",TRUE);
error_reporting(E_ALL); error_reporting(E_ALL);
@@ -930,7 +932,7 @@ class e_install
{ {
// Basic stuff to get the handlers/classes to work. // Basic stuff to get the handlers/classes to work.
define("E107_INSTALL",TRUE); //FIXME - remove the need for this - ie. make the MySQL class work without it.
$udirs = "admin/|plugins/|temp"; $udirs = "admin/|plugins/|temp";
$e_SELF = $_SERVER['PHP_SELF']; $e_SELF = $_SERVER['PHP_SELF'];
$e_HTTP = preg_replace("#".$udirs."#i", "", substr($e_SELF, 0, strrpos($e_SELF, "/"))."/"); $e_HTTP = preg_replace("#".$udirs."#i", "", substr($e_SELF, 0, strrpos($e_SELF, "/"))."/");
@@ -966,6 +968,7 @@ class e_install
$tp = e107::getParser(); $tp = e107::getParser();
include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/lan_prefs.php"); include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/lan_prefs.php");
include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/admin/lan_theme.php");
//Create default plugin-table entries. //Create default plugin-table entries.
e107::getSingleton('e107plugin')->update_plugins_table(); e107::getSingleton('e107plugin')->update_plugins_table();
@@ -984,11 +987,13 @@ class e_install
} }
} }
} }
e107::getSingleton('xmlClass')->e107Import($XMLImportfile,'add'); // Add missing core pref values e107::getSingleton('xmlClass')->e107Import($XMLImportfile,'add'); // Add missing core pref values
e107::getSingleton('e107plugin')->save_addon_prefs(); // save plugin addon pref-lists. eg. e_latest_list. e107::getSingleton('e107plugin')->save_addon_prefs(); // save plugin addon pref-lists. eg. e_latest_list.
$tm = e107::getSingleton('themeHandler');
$tm->noLog = TRUE;
$tm->setTheme($this->previous_steps['prefs']['sitetheme']);
// Set Preferences defined during install - overwriting those that may exist in the XML. // Set Preferences defined during install - overwriting those that may exist in the XML.
@@ -1094,6 +1099,7 @@ class e_install
function get_themes() function get_themes()
{ {
$handle = opendir($this->e107->e107_dirs['THEMES_DIRECTORY']); $handle = opendir($this->e107->e107_dirs['THEMES_DIRECTORY']);
$lanlist = array(); $lanlist = array();
while ($file = readdir($handle)) while ($file = readdir($handle))
@@ -1114,15 +1120,22 @@ class e_install
function get_theme_xml($theme_folder) function get_theme_xml($theme_folder)
{ {
if(!defined("SITEURL"))
{
define("SITEURL","");
}
$path = $this->e107->e107_dirs['THEMES_DIRECTORY'].$theme_folder."/theme.xml"; $path = $this->e107->e107_dirs['THEMES_DIRECTORY'].$theme_folder."/theme.xml";
if(!is_readable($path)) if(!is_readable($path))
{ {
return FALSE; return FALSE;
} }
require_once($this->e107->e107_dirs['HANDLERS_DIRECTORY']."xml_class.php"); require_once($this->e107->e107_dirs['HANDLERS_DIRECTORY']."theme_handler.php");
$xml = new xmlClass; $tm = new themeHandler;
$xmlArray = $xml->loadXMLfile($path,'advanced'); $xmlArray = $tm->parse_theme_xml($theme_folder);
// require_once($this->e107->e107_dirs['HANDLERS_DIRECTORY']."xml_class.php");
// $xml = new xmlClass;
// $xmlArray = $xml->loadXMLfile($path,'advanced');
return (is_array($xmlArray)) ? $xmlArray : FALSE; return (is_array($xmlArray)) ? $xmlArray : FALSE;
} }