diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php
index 790f2afd4..ef721812a 100644
--- a/e107_plugins/forum/forum_admin.php
+++ b/e107_plugins/forum/forum_admin.php
@@ -20,17 +20,17 @@ if (!getperms('P'))
e107::includeLan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/English_admin.php');
e107::lan('forum','', 'front');
+$legacy = false;
-
-if(E107_DEBUG_LEVEL == 0)
+if(E107_DEBUG_LEVEL > 0 && $legacy == true)
{
- define('NEW_FORUMADMIN', true);
+ define('OLD_FORUMADMIN', true);
//e107::getMessage()->addwarning("Experimental code now active. Using this page in debug mode active could break your forum configuration.");
}
// Generated e107 Plugin Admin Area
-if(deftrue('NEW_FORUMADMIN'))
+if(!deftrue('OLD_FORUMADMIN'))
{
class forum_admin extends e_admin_dispatcher
@@ -89,6 +89,18 @@ if(deftrue('NEW_FORUMADMIN'))
);
protected $menuTitle = 'Forum';
+
+
+ function init()
+ {
+ if(E107_DEBUG_LEVEL > 0)
+ {
+ $this->adminMenu['opt3'] = array('divider'=>true);
+ $this->adminMenu['main/update'] = array('caption'=>"Redo v1.x Forum Upgrade", 'perm'=>0, 'uri'=>'{e_PLUGIN}forum/forum_update.php');
+ }
+
+
+ }
}
@@ -691,10 +703,136 @@ if(deftrue('NEW_FORUMADMIN'))
+ function toolsPageProcess()
+ {
+ $mes = e107::getMessage();
+
+ $fList = array();
+
+ if(isset($_POST['tools']))
+ {
+ $msg = '';
+ if(isset($_POST['forum_all']))
+ {
+ $fList[]='all';
+ }
+ else
+ {
+ foreach(array_keys($_POST['forumlist']) as $k)
+ {
+ $fList[] = $k;
+ }
+ }
+ foreach($fList as $fid)
+ {
+ if(isset($_POST['counts']))
+ {
+ $this->forumObj->forumUpdateCounts($fid, $_POST['counts_threads']);
+ $msg .= FORLAN_167.": $fid
";
+ }
+ if(isset($_POST['lastpost']))
+ {
+ $with_threads = (!empty($_POST['lastpost_nothread'])) ? FALSE : TRUE;
+ $this->forumObj->forumUpdateLastpost('forum', $fid, $with_threads);
+ $msg .= FORLAN_168.": $fid
";
+ }
+ }
+ if(isset($_POST['userpostcounts']))
+ {
+ $ue = e107::getUserExt();
+
+ $list = $this->forumObj->getUserCounts();
+ foreach($list as $uid => $cnt)
+ {
+ $ue->user_extended_setvalue($uid, 'user_plugin_forum_posts', $cnt, 'int');
+ }
+ $msg .= FORLAN_169.'
';
+ }
+
+ $mes->addSuccess($msg);
+ // $ns->tablerender($caption, $mes->render().$text);
+ }
+
+
+ }
+
+
+ //TODO Add SEF-url generation for forum and threads where missing.
function toolsPage()
{
- return "Coming Soon!";
+ $sql = e107::getDb();
+ $ns = e107::getRender();
+ $tp = e107::getParser();
+ $frm = e107::getForm();
+
+ $this->toolsPageProcess();
+
+ $txt = "
+