mirror of
https://github.com/e107inc/e107.git
synced 2025-07-26 09:20:28 +02:00
Eradicate obsolete prefs
This commit is contained in:
@@ -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_admin/update_routines.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
||||||
| $Revision: 1.26 $
|
| $Revision: 1.27 $
|
||||||
| $Date: 2008-08-23 09:08:56 $
|
| $Date: 2008-08-24 09:56:57 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -31,7 +31,7 @@ require_once(e_HANDLER.'db_table_admin_class.php');
|
|||||||
// To do - how do we handle multi-language tables?
|
// To do - how do we handle multi-language tables?
|
||||||
|
|
||||||
// If following line uncommented, enables a test routine
|
// If following line uncommented, enables a test routine
|
||||||
define('TEST_UPDATE',TRUE);
|
//define('TEST_UPDATE',TRUE);
|
||||||
$update_debug = FALSE; // TRUE gives extra messages in places
|
$update_debug = FALSE; // TRUE gives extra messages in places
|
||||||
//$update_debug = TRUE; // TRUE gives extra messages in places
|
//$update_debug = TRUE; // TRUE gives extra messages in places
|
||||||
if (defined('TEST_UPDATE')) $update_debug = TRUE;
|
if (defined('TEST_UPDATE')) $update_debug = TRUE;
|
||||||
@@ -197,49 +197,6 @@ if (defined('TEST_UPDATE'))
|
|||||||
// Add your test code in here
|
// Add your test code in here
|
||||||
//--------------**************---------------
|
//--------------**************---------------
|
||||||
|
|
||||||
// Check notify prefs
|
|
||||||
global $sysprefs, $eArrayStorage, $tp;
|
|
||||||
$notify_prefs = $sysprefs -> get('notify_prefs');
|
|
||||||
$notify_prefs = $eArrayStorage -> ReadArray($notify_prefs);
|
|
||||||
$nt_changed = 0;
|
|
||||||
foreach ($notify_prefs['event'] as $e => $d)
|
|
||||||
{
|
|
||||||
if (isset($d['type']))
|
|
||||||
{
|
|
||||||
if ($just_check) return update_needed('Notify pref: '.$e.' outdated');
|
|
||||||
switch ($d['type'])
|
|
||||||
{
|
|
||||||
case 'main' :
|
|
||||||
$notify_prefs['event'][$e]['class'] = e_UC_MAINADMIN;
|
|
||||||
break;
|
|
||||||
case 'class' : // Should already have class defined
|
|
||||||
break;
|
|
||||||
case 'email' :
|
|
||||||
$notify_prefs['event'][$e]['class'] = 'email';
|
|
||||||
break;
|
|
||||||
case 'off' : // Need to disable
|
|
||||||
default :
|
|
||||||
$notify_prefs['event'][$e]['class'] = e_UC_NOBODY; // Just disable if we don't know what else to do
|
|
||||||
}
|
|
||||||
$nt_changed++;
|
|
||||||
unset($notify_prefs['event'][$e]['type']);
|
|
||||||
echo "Update value for {$e}<br />";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($nt_changed)
|
|
||||||
{
|
|
||||||
$s_prefs = $tp -> toDB($notify_prefs);
|
|
||||||
$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
|
|
||||||
// Could we use $sysprefs->set($s_prefs,'notify_prefs') instead - avoids caching problems ????
|
|
||||||
if ($sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'") === FALSE)
|
|
||||||
{
|
|
||||||
echo "Error writing notify values<br />";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo "Notify values written - {$nt_changed} updates<br />";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $just_check;
|
return $just_check;
|
||||||
}
|
}
|
||||||
} // End of test routine
|
} // End of test routine
|
||||||
@@ -253,7 +210,8 @@ function update_706_to_800($type='')
|
|||||||
|
|
||||||
// List of unwanted $pref values which can go
|
// List of unwanted $pref values which can go
|
||||||
$obs_prefs = array('frontpage_type','rss_feeds', 'log_lvcount', 'zone', 'upload_allowedfiletype', 'real', 'forum_user_customtitle',
|
$obs_prefs = array('frontpage_type','rss_feeds', 'log_lvcount', 'zone', 'upload_allowedfiletype', 'real', 'forum_user_customtitle',
|
||||||
'utf-compatmode','frontpage_method','standards_mode','image_owner','im_quality', 'signup_option_timezone');
|
'utf-compatmode','frontpage_method','standards_mode','image_owner','im_quality', 'signup_option_timezone',
|
||||||
|
'plug_sc', 'plug_bb');
|
||||||
|
|
||||||
// List of DB tables not required (includes a few from 0.6xx)
|
// List of DB tables not required (includes a few from 0.6xx)
|
||||||
$obs_tables = array('flood', 'headlines', 'stat_info', 'stat_counter', 'stat_last');
|
$obs_tables = array('flood', 'headlines', 'stat_info', 'stat_counter', 'stat_last');
|
||||||
@@ -283,6 +241,51 @@ function update_706_to_800($type='')
|
|||||||
$just_check = $type == 'do' ? FALSE : TRUE; // TRUE if we're just seeing whether an update is needed
|
$just_check = $type == 'do' ? FALSE : TRUE; // TRUE if we're just seeing whether an update is needed
|
||||||
|
|
||||||
|
|
||||||
|
// Check notify prefs
|
||||||
|
global $sysprefs, $eArrayStorage, $tp;
|
||||||
|
$notify_prefs = $sysprefs -> get('notify_prefs');
|
||||||
|
$notify_prefs = $eArrayStorage -> ReadArray($notify_prefs);
|
||||||
|
$nt_changed = 0;
|
||||||
|
foreach ($notify_prefs['event'] as $e => $d)
|
||||||
|
{
|
||||||
|
if (isset($d['type']))
|
||||||
|
{
|
||||||
|
if ($just_check) return update_needed('Notify pref: '.$e.' outdated');
|
||||||
|
switch ($d['type'])
|
||||||
|
{
|
||||||
|
case 'main' :
|
||||||
|
$notify_prefs['event'][$e]['class'] = e_UC_MAINADMIN;
|
||||||
|
break;
|
||||||
|
case 'class' : // Should already have class defined
|
||||||
|
break;
|
||||||
|
case 'email' :
|
||||||
|
$notify_prefs['event'][$e]['class'] = 'email';
|
||||||
|
break;
|
||||||
|
case 'off' : // Need to disable
|
||||||
|
default :
|
||||||
|
$notify_prefs['event'][$e]['class'] = e_UC_NOBODY; // Just disable if we don't know what else to do
|
||||||
|
}
|
||||||
|
$nt_changed++;
|
||||||
|
unset($notify_prefs['event'][$e]['type']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($nt_changed)
|
||||||
|
{
|
||||||
|
$s_prefs = $tp -> toDB($notify_prefs);
|
||||||
|
$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
|
||||||
|
// Could we use $sysprefs->set($s_prefs,'notify_prefs') instead - avoids caching problems ????
|
||||||
|
if ($sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'") === FALSE)
|
||||||
|
{
|
||||||
|
echo "Error writing notify values<br />";
|
||||||
|
}
|
||||||
|
/* else
|
||||||
|
{
|
||||||
|
echo "Notify values written - {$nt_changed} updates<br />";
|
||||||
|
} */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($pref['forum_user_customtitle']) && !isset($pref['signup_option_customtitle']))
|
if (isset($pref['forum_user_customtitle']) && !isset($pref['signup_option_customtitle']))
|
||||||
{
|
{
|
||||||
if ($just_check) return update_needed();
|
if ($just_check) return update_needed();
|
||||||
|
@@ -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_files/def_e107_prefs.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_files/def_e107_prefs.php,v $
|
||||||
| $Revision: 1.13 $
|
| $Revision: 1.14 $
|
||||||
| $Date: 2008-08-13 20:46:59 $
|
| $Date: 2008-08-24 09:56:57 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -128,7 +128,6 @@ City, State, Country
|
|||||||
'mail_pause' => '3',
|
'mail_pause' => '3',
|
||||||
'mail_pausetime' => '4',
|
'mail_pausetime' => '4',
|
||||||
'themecss' => 'canvas.css',
|
'themecss' => 'canvas.css',
|
||||||
'plug_sc' => ':featurebox',
|
|
||||||
'auth_method' => '',
|
'auth_method' => '',
|
||||||
'post_html' => '254',
|
'post_html' => '254',
|
||||||
'redirectsiteurl' => '0',
|
'redirectsiteurl' => '0',
|
||||||
|
@@ -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.47 $
|
| $Revision: 1.48 $
|
||||||
| $Date: 2008-08-23 09:08:57 $
|
| $Date: 2008-08-24 09:56:58 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -49,10 +49,10 @@ class e107plugin
|
|||||||
'eplug_prefs',
|
'eplug_prefs',
|
||||||
'eplug_array_pref',
|
'eplug_array_pref',
|
||||||
'eplug_table_names',
|
'eplug_table_names',
|
||||||
'eplug_sc',
|
// 'eplug_sc', // Not used in 0.8 (or later 0.7)
|
||||||
'eplug_userclass',
|
'eplug_userclass',
|
||||||
'eplug_module',
|
'eplug_module',
|
||||||
'eplug_bb',
|
// 'eplug_bb', // Not used in 0.8 (or later 0.7)
|
||||||
'eplug_latest',
|
'eplug_latest',
|
||||||
'eplug_status',
|
'eplug_status',
|
||||||
'eplug_comment_ids',
|
'eplug_comment_ids',
|
||||||
@@ -64,10 +64,10 @@ class e107plugin
|
|||||||
// Deprecated in 0.8 (used in plugin.php only). Probably delete in 0.9
|
// Deprecated in 0.8 (used in plugin.php only). Probably delete in 0.9
|
||||||
var $all_eplug_update_variables = array (
|
var $all_eplug_update_variables = array (
|
||||||
'upgrade_alter_tables',
|
'upgrade_alter_tables',
|
||||||
'upgrade_add_eplug_sc',
|
// 'upgrade_add_eplug_sc', // Not used in 0.8 (or later 0.7)
|
||||||
'upgrade_remove_eplug_sc',
|
// 'upgrade_remove_eplug_sc', // Not used in 0.8 (or later 0.7)
|
||||||
'upgrade_add_eplug_bb',
|
// 'upgrade_add_eplug_bb', // Not used in 0.8 (or later 0.7)
|
||||||
'upgrade_remove_eplug_bb',
|
// 'upgrade_remove_eplug_bb', // Not used in 0.8 (or later 0.7)
|
||||||
'upgrade_add_prefs',
|
'upgrade_add_prefs',
|
||||||
'upgrade_remove_prefs',
|
'upgrade_remove_prefs',
|
||||||
'upgrade_add_array_pref',
|
'upgrade_add_array_pref',
|
||||||
@@ -508,6 +508,7 @@ class e107plugin
|
|||||||
function manage_plugin_prefs($action, $prefname, $plugin_folder, $varArray = '')
|
function manage_plugin_prefs($action, $prefname, $plugin_folder, $varArray = '')
|
||||||
{ // These prefs are 'cumulative' - several plugins may contribute an array element
|
{ // These prefs are 'cumulative' - several plugins may contribute an array element
|
||||||
global $pref;
|
global $pref;
|
||||||
|
/*
|
||||||
if ($prefname == 'plug_sc' || $prefname == 'plug_bb')
|
if ($prefname == 'plug_sc' || $prefname == 'plug_bb')
|
||||||
{ // Special cases - shortcodes and bbcodes - each plugin may contribute several elements
|
{ // Special cases - shortcodes and bbcodes - each plugin may contribute several elements
|
||||||
foreach($varArray as $code)
|
foreach($varArray as $code)
|
||||||
@@ -517,9 +518,10 @@ class e107plugin
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
*/
|
||||||
$prefvals[] = $varArray;
|
$prefvals[] = $varArray;
|
||||||
// $prefvals[] = $plugin_folder;
|
// $prefvals[] = $plugin_folder;
|
||||||
}
|
// }
|
||||||
$curvals = explode(',', $pref[$prefname]);
|
$curvals = explode(',', $pref[$prefname]);
|
||||||
|
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
@@ -1132,7 +1134,7 @@ class e107plugin
|
|||||||
$this->manage_plugin_prefs('add', $key, $eplug_folder, $val);
|
$this->manage_plugin_prefs('add', $key, $eplug_folder, $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (is_array($eplug_sc))
|
if (is_array($eplug_sc))
|
||||||
{
|
{
|
||||||
$this->manage_plugin_prefs('add', 'plug_sc', $eplug_folder, $eplug_sc);
|
$this->manage_plugin_prefs('add', 'plug_sc', $eplug_folder, $eplug_sc);
|
||||||
@@ -1142,7 +1144,7 @@ class e107plugin
|
|||||||
{
|
{
|
||||||
$this->manage_plugin_prefs('add', 'plug_bb', $eplug_folder, $eplug_bb);
|
$this->manage_plugin_prefs('add', 'plug_bb', $eplug_folder, $eplug_bb);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if ($eplug_link === TRUE && $eplug_link_url != '' && $eplug_link_name != '')
|
if ($eplug_link === TRUE && $eplug_link_url != '' && $eplug_link_name != '')
|
||||||
{
|
{
|
||||||
$linkperm = (isset($eplug_link_perms) ? $eplug_link_perms : e_UC_PUBLIC);
|
$linkperm = (isset($eplug_link_perms) ? $eplug_link_perms : e_UC_PUBLIC);
|
||||||
@@ -1419,7 +1421,8 @@ class e107plugin
|
|||||||
include($path.'plugin.php');
|
include($path.'plugin.php');
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
||||||
$ret['installRequired'] = ($eplug_conffile || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_module || $eplug_userclass || $eplug_status || $eplug_latest);
|
// $ret['installRequired'] = ($eplug_conffile || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_module || $eplug_userclass || $eplug_status || $eplug_latest);
|
||||||
|
$ret['installRequired'] = ($eplug_conffile || is_array($eplug_table_names) || is_array($eplug_prefs) || $eplug_module || $eplug_userclass || $eplug_status || $eplug_latest);
|
||||||
|
|
||||||
$ret['version'] = varset($eplug_version);
|
$ret['version'] = varset($eplug_version);
|
||||||
$ret['name'] = varset($eplug_name);
|
$ret['name'] = varset($eplug_name);
|
||||||
|
@@ -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_plugins/pm/pm_update.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_update.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:35:39 $
|
| $Date: 2008-08-24 09:57:08 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ pm_block_count int(10) unsigned NOT NULL default '0',
|
|||||||
PRIMARY KEY (pm_block_id)
|
PRIMARY KEY (pm_block_id)
|
||||||
) TYPE=MyISAM AUTO_INCREMENT=1 ;");
|
) TYPE=MyISAM AUTO_INCREMENT=1 ;");
|
||||||
|
|
||||||
$plugin -> manage_plugin_prefs('add', 'plug_sc', 'pm', 'SENDPM');
|
//$plugin -> manage_plugin_prefs('add', 'plug_sc', 'pm', 'SENDPM'); // Obsolete pref
|
||||||
|
|
||||||
pm_convert();
|
pm_convert();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user