1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Eradicate obsolete prefs

This commit is contained in:
e107steved 2008-08-24 09:57:08 +00:00
parent 8879aa9211
commit d2da01b8db
4 changed files with 71 additions and 66 deletions

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
| $Revision: 1.26 $
| $Date: 2008-08-23 09:08:56 $
| $Revision: 1.27 $
| $Date: 2008-08-24 09:56:57 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -31,7 +31,7 @@ require_once(e_HANDLER.'db_table_admin_class.php');
// To do - how do we handle multi-language tables?
// 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 = TRUE; // TRUE gives extra messages in places
if (defined('TEST_UPDATE')) $update_debug = TRUE;
@ -197,49 +197,6 @@ if (defined('TEST_UPDATE'))
// 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;
}
} // End of test routine
@ -253,7 +210,8 @@ function update_706_to_800($type='')
// List of unwanted $pref values which can go
$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)
$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
// 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 ($just_check) return update_needed();

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_files/def_e107_prefs.php,v $
| $Revision: 1.13 $
| $Date: 2008-08-13 20:46:59 $
| $Revision: 1.14 $
| $Date: 2008-08-24 09:56:57 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -128,7 +128,6 @@ City, State, Country
'mail_pause' => '3',
'mail_pausetime' => '4',
'themecss' => 'canvas.css',
'plug_sc' => ':featurebox',
'auth_method' => '',
'post_html' => '254',
'redirectsiteurl' => '0',

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
| $Revision: 1.47 $
| $Date: 2008-08-23 09:08:57 $
| $Revision: 1.48 $
| $Date: 2008-08-24 09:56:58 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -49,10 +49,10 @@ class e107plugin
'eplug_prefs',
'eplug_array_pref',
'eplug_table_names',
'eplug_sc',
// 'eplug_sc', // Not used in 0.8 (or later 0.7)
'eplug_userclass',
'eplug_module',
'eplug_bb',
// 'eplug_bb', // Not used in 0.8 (or later 0.7)
'eplug_latest',
'eplug_status',
'eplug_comment_ids',
@ -64,10 +64,10 @@ class e107plugin
// Deprecated in 0.8 (used in plugin.php only). Probably delete in 0.9
var $all_eplug_update_variables = array (
'upgrade_alter_tables',
'upgrade_add_eplug_sc',
'upgrade_remove_eplug_sc',
'upgrade_add_eplug_bb',
'upgrade_remove_eplug_bb',
// 'upgrade_add_eplug_sc', // Not used in 0.8 (or later 0.7)
// 'upgrade_remove_eplug_sc', // Not used in 0.8 (or later 0.7)
// 'upgrade_add_eplug_bb', // Not used in 0.8 (or later 0.7)
// 'upgrade_remove_eplug_bb', // Not used in 0.8 (or later 0.7)
'upgrade_add_prefs',
'upgrade_remove_prefs',
'upgrade_add_array_pref',
@ -508,6 +508,7 @@ class e107plugin
function manage_plugin_prefs($action, $prefname, $plugin_folder, $varArray = '')
{ // These prefs are 'cumulative' - several plugins may contribute an array element
global $pref;
/*
if ($prefname == 'plug_sc' || $prefname == 'plug_bb')
{ // Special cases - shortcodes and bbcodes - each plugin may contribute several elements
foreach($varArray as $code)
@ -517,9 +518,10 @@ class e107plugin
}
else
{
*/
$prefvals[] = $varArray;
// $prefvals[] = $plugin_folder;
}
// }
$curvals = explode(',', $pref[$prefname]);
if ($action == 'add')
@ -1132,7 +1134,7 @@ class e107plugin
$this->manage_plugin_prefs('add', $key, $eplug_folder, $val);
}
}
/*
if (is_array($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);
}
*/
if ($eplug_link === TRUE && $eplug_link_url != '' && $eplug_link_name != '')
{
$linkperm = (isset($eplug_link_perms) ? $eplug_link_perms : e_UC_PUBLIC);
@ -1419,7 +1421,8 @@ class e107plugin
include($path.'plugin.php');
$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['name'] = varset($eplug_name);

View File

@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_update.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:39 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2008-08-24 09:57:08 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -56,7 +56,7 @@ pm_block_count int(10) unsigned NOT NULL default '0',
PRIMARY KEY (pm_block_id)
) 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();