+
+ ";
+ $e107->ns->tablerender($stepCaption, $text);
+ return;
+ }
+ else
+ {
+ $text .= "
+ There were no orphaned files found
+
+
+ ";
+ $e107->ns->tablerender($stepCaption, $text);
+ return;
+ }
+}
+
+function step12()
+{
+ $e107 = e107::getInstance();
+ $f = new forumUpgrade;
+ $stepCaption = 'Step 12: Delete old forum data';
+ if(!isset($_POST['delete_old']))
+ {
+ $text = "
+ The forum upgrade should now be complete. During the upgrade process the old forum tables were
+ retained, it is now time to remove the tables.
+ We will also be marking the forum upgrade as completed!
+
+
+
+ ";
+ $e107->ns->tablerender($stepCaption, $text);
+ return;
+ }
+
+ $qryArray = array(
+ "DROP TABLE `#forum_old`",
+ "DROP TABLE `#forum_t",
+ "DELETE * FROM `#generic` WHERE gen_type = 'forumUpgrade'"
+ );
+ foreach($qryArray as $qry)
+ {
+ $e107->sql->db_Select_gen($qry, true);
+ }
+ $ret = $f->setNewVersion();
+
+ $text = "
+ Congratulations, the forum upgrade is now completed!
+ {$ret}
+
+ ";
+ $e107->ns->tablerender($stepCaption, $text);
+ return;
+}
class forumUpgrade
{
- var $newVersion = '2.0';
+ var $newVersion = '2.0';
var $error = array();
public $updateInfo;
@@ -850,6 +995,13 @@ class forumUpgrade
$this->updateInfo['lastThread'] = 0;
}
+ public function checkUpdateNeeded()
+ {
+ include_once(e_PLUGIN.'forum/forum_update_check.php');
+ $needed = update_forum_08('check');
+ return !$needed;
+ }
+
function forumUpgrade()
{
$this->getUpdateInfo();
@@ -907,8 +1059,11 @@ class forumUpgrade
function setNewVersion()
{
+ global $pref;
$e107 = e107::getInstance();
- $e107->sql->db_Update('plugin',"plugin_version = '{$this->newVersion}' WHERE plugin_name='Forum'");
+ $e107->sql->db_Update('plugin',"plugin_version = '{$this->newVersion}' WHERE plugin_name='Forum'", true);
+ $pref['plug_installed']['forum'] = $this->newVersion;
+ save_prefs();
return "Forum Version updated to version: {$this->newVersion} ";
}
@@ -1172,9 +1327,12 @@ function forum_update_adminmenu()
$var[10]['text'] = '10 - Migrate any attachments';
$var[10]['link'] = '#';
- $var[11]['text'] = '11 - Delete old forum data';
+ $var[11]['text'] = '11 - Delete old attachments';
$var[11]['link'] = '#';
+ $var[12]['text'] = '12 - Delete old forum data';
+ $var[12]['link'] = '#';
+
for($i=1; $i < $currentStep; $i++)
{
diff --git a/e107_plugins/forum/forum_update_check.php b/e107_plugins/forum/forum_update_check.php
index 4b686be2d..c98df431c 100644
--- a/e107_plugins/forum/forum_update_check.php
+++ b/e107_plugins/forum/forum_update_check.php
@@ -8,10 +8,8 @@
*
*
*
- * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_update_check.php,v $
- * $Revision$
- * $Date$
- * $Author$
+ * $URL$
+ * $Id$
*/
if (!defined('e107_INIT')) { exit; }
@@ -29,6 +27,7 @@ function update_forum_08($type)
return;
}
}
- return !version_compare($pref['plug_installed']['forum'], '3.0', '<');
+ $vc = !version_compare($pref['plug_installed']['forum'], '2.0', '<');
+ return $vc;
}
?>