From: <dh...@us...> - 2012-02-19 12:59:18
|
Revision: 9026 http://xoops.svn.sourceforge.net/xoops/?rev=9026&view=rev Author: dhcst Date: 2012-02-19 12:59:12 +0000 (Sun, 19 Feb 2012) Log Message: ----------- fix move/merge topics Modified Paths: -------------- XoopsModules/newbb/branches/alfred/newbb/class/forum.php XoopsModules/newbb/branches/alfred/newbb/topicmanager.php Modified: XoopsModules/newbb/branches/alfred/newbb/class/forum.php =================================================================== --- XoopsModules/newbb/branches/alfred/newbb/class/forum.php 2012-02-19 12:26:40 UTC (rev 9025) +++ XoopsModules/newbb/branches/alfred/newbb/class/forum.php 2012-02-19 12:59:12 UTC (rev 9026) @@ -651,7 +651,7 @@ } } } - + return $this->insert($object, true); } Modified: XoopsModules/newbb/branches/alfred/newbb/topicmanager.php =================================================================== --- XoopsModules/newbb/branches/alfred/newbb/topicmanager.php 2012-02-19 12:26:40 UTC (rev 9025) +++ XoopsModules/newbb/branches/alfred/newbb/topicmanager.php 2012-02-19 12:59:12 UTC (rev 9026) @@ -52,6 +52,12 @@ $topic_handler =& xoops_getmodulehandler('topic', 'newbb'); $forum_handler =& xoops_getmodulehandler('forum', 'newbb'); +if ( !$forum ) { + $topic_obj =& $topic_handler->get($topic_id); + $forum = $topic_obj->getVar("forum_id"); + unset($topic_obj); +} + if ($xoopsModuleConfig['wol_enabled']) { $online_handler =& xoops_getmodulehandler('online', 'newbb'); $online_handler->init($forum); @@ -89,7 +95,7 @@ //sync($topic_id, "topic"); //xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id); } - echo $action[$mode]['msg']."<p><a href='viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; + echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } elseif ('restore' == $mode) { //$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); $forums = array(); @@ -183,7 +189,7 @@ } elseif ('move' == $mode) { if ($newforum > 0) { $topic_id = $topic_id[0]; - $topic_obj =& $topic_handler->get($topic_id); + $topic_obj = $topic_handler->get($topic_id); $topic_obj->loadFilters("update"); $topic_obj->setVar("forum_id", $newforum, true); $topic_handler->insert($topic_obj, true); @@ -193,7 +199,9 @@ if ( !$r = $xoopsDB->query($sql) ) { return false; } - $forum_handler->synchronization(); + $forum_handler->synchronization($forum); + $forum_handler->synchronization($newforum); + echo $action[$mode]['msg']."<p><a href='viewtopic.php?topic_id=$topic_id&forum=$newforum'>"._MD_GOTONEWFORUM."</a></p><p><a href='".XOOPS_URL."/modules/newbb/index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } else { redirect_header("javascript:history.go(-1)",2,_MD_ERRORFORUM); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |