mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Issue #1336 and Forum menu prefs upgrade and newforumpost_menu fix. e_menu.php pending.
This commit is contained in:
@@ -745,7 +745,7 @@ class e107forum
|
||||
$postInfo['post_thread'] = $newThreadId;
|
||||
$newPostId = $this->postAdd($postInfo, false);
|
||||
$this->threadMarkAsRead($newThreadId);
|
||||
$threadInfo['thread_sef'] = eHelper::title2sef($threadInfo['thread_name'],'dashl');
|
||||
$threadInfo['thread_sef'] = $this->getThreadsef($threadInfo);
|
||||
|
||||
return array('postid' => $newPostId, 'threadid' => $newThreadId, 'threadsef'=>$threadInfo['thread_sef']);
|
||||
}
|
||||
@@ -753,6 +753,12 @@ class e107forum
|
||||
}
|
||||
|
||||
|
||||
function getThreadSef($threadInfo)
|
||||
{
|
||||
return eHelper::title2sef($threadInfo['thread_name'],'dashl');
|
||||
}
|
||||
|
||||
|
||||
|
||||
function threadMove($threadId, $newForumId, $threadTitle= '', $titleType=0)
|
||||
{
|
||||
@@ -2198,6 +2204,42 @@ class e107forum
|
||||
return $deleted; // return boolean. $threadInfo['thread_total_replies'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check for legacy Prefernces and upgrade if neccessary.
|
||||
*/
|
||||
public function upgradeLegacyPrefs()
|
||||
{
|
||||
|
||||
e107::getMessage()->addDebug("Legacy Forum Menu Pref Detected. Upgrading..");
|
||||
|
||||
$legacyMenuPrefs = array(
|
||||
'newforumposts_caption' => 'caption',
|
||||
'newforumposts_display' => 'display',
|
||||
'newforumposts_maxage' => 'maxage',
|
||||
'newforumposts_characters' => 'chars',
|
||||
'newforumposts_postfix' => 'postfix',
|
||||
'newforumposts_title' => 'title'
|
||||
);
|
||||
|
||||
if($newPrefs = e107::getConfig('menu')->migrateData($legacyMenuPrefs, true)) // returns false if no match found.
|
||||
{
|
||||
if(e107::getMenu()->setParms('forum','newforumposts_menu', $newPrefs) !== false)
|
||||
{
|
||||
e107::getMessage()->addDebug("Sucessfully Migrated newforumposts prefs from core to menu table. ");
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addDebug("Legacy Forum Menu Pref Detected. Upgrading..");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user