From c2f241d87166d6922eef8d73f27864129962c4e5 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 2 May 2017 13:53:31 -0700 Subject: [PATCH] Issue #2610 - attempt to auto-remove legacy URL files from forum. --- e107_plugins/download/download_setup.php | 2 -- e107_plugins/forum/forum_setup.php | 24 ++++++++++++++++++++++++ e107_plugins/forum/plugin.xml | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/e107_plugins/download/download_setup.php b/e107_plugins/download/download_setup.php index d309b3341..f1fd3493e 100644 --- a/e107_plugins/download/download_setup.php +++ b/e107_plugins/download/download_setup.php @@ -83,8 +83,6 @@ class download_setup $bld = new eRouter; $bld->buildGlobalConfig(); - - } return $this->upgradeFilePaths($needed); diff --git a/e107_plugins/forum/forum_setup.php b/e107_plugins/forum/forum_setup.php index 6c7296651..79f93d52d 100644 --- a/e107_plugins/forum/forum_setup.php +++ b/e107_plugins/forum/forum_setup.php @@ -98,6 +98,30 @@ class forum_setup { $sql = e107::getDb(); + $config = e107::getPref('url_config'); + + if(!empty($config['forum'])) + { + e107::getConfig() + ->removePref('url_config/forum') + ->removePref('url_locations/forum') + ->save(false,true); + + if(file_exists(e_PLUGIN."forum/url/url.php")) + { + @unlink(e_PLUGIN."forum/url/url.php"); + @unlink(e_PLUGIN."forum/url/rewrite_url.php"); + } + + $bld = new eRouter; + $bld->buildGlobalConfig(); + + } + + + + + if($sql->isEmpty('forum_thread') === true && $sql->isTable('forum_t') && $sql->isEmpty('forum_t') === false) { $mes = e107::getMessage(); diff --git a/e107_plugins/forum/plugin.xml b/e107_plugins/forum/plugin.xml index 002e83927..8e68c54d7 100755 --- a/e107_plugins/forum/plugin.xml +++ b/e107_plugins/forum/plugin.xml @@ -1,5 +1,5 @@ - + This plugin is a fully featured forum system content