mirror of
https://github.com/e107inc/e107.git
synced 2025-07-15 12:06:19 +02:00
EONE-1, upgrade process now converts the forum preferences. Removing them from core and placing them in their own row.
This commit is contained in:
@ -228,12 +228,13 @@ function step3()
|
|||||||
|
|
||||||
function step4()
|
function step4()
|
||||||
{
|
{
|
||||||
|
global $pref;
|
||||||
$e107 = e107::getInstance();
|
$e107 = e107::getInstance();
|
||||||
$stepCaption = 'Step 4: Move user specific forum data';
|
$stepCaption = 'Step 4: Move user specific forum data and forum prefs';
|
||||||
if(!isset($_POST['move_user_data']))
|
if(!isset($_POST['move_user_data']))
|
||||||
{
|
{
|
||||||
$text = "
|
$text = "
|
||||||
This step will move the user_viewed data from user table into the user extended table.<br />
|
This step will move the main forum preferences into its own table row. It will also move all user_viewed data from user table into the user extended table.<br />
|
||||||
The user_forum field data will not be moved, as it will be recalculated later.<br />
|
The user_forum field data will not be moved, as it will be recalculated later.<br />
|
||||||
<br />
|
<br />
|
||||||
Depending on the size of your user table, this step could take a while.
|
Depending on the size of your user table, this step could take a while.
|
||||||
@ -245,6 +246,22 @@ function step4()
|
|||||||
$e107->ns->tablerender($stepCaption, $text);
|
$e107->ns->tablerender($stepCaption, $text);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Convert forum prefs to their own row **/
|
||||||
|
$fconf = e107::getPlugConfig('forum', '', false);
|
||||||
|
$coreConfig = e107::getConfig();
|
||||||
|
$old_prefs = array();
|
||||||
|
foreach($pref as $k => $v)
|
||||||
|
{
|
||||||
|
if(substr($key, 0, 6) == 'forum_')
|
||||||
|
{
|
||||||
|
$old_prefs[substr($key,6)] = $v;
|
||||||
|
$coreConfig->remove($key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$fconf->setPref($old_prefs)->save(false, true);
|
||||||
|
$coreConfig->save(false, true);
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'usercount' => 0,
|
'usercount' => 0,
|
||||||
'viewcount' => 0,
|
'viewcount' => 0,
|
||||||
|
Reference in New Issue
Block a user