hi edear
Quote:
newbb patch for XOOPS 2.0.6RC is incomplete?
still bugs : can't redirect the url after user posts, the navigater just stay in post.php with blank page
newbb patch is complete.
Perhaps, you have another trouble with newbb irrelevant with 2.0.6RC's bug.
You should turn PHP debug on.
It will be displayed some useful messages after user's posts.
I upgrade my xoops from 2.0.6 rc to 2.0.6 ,Forum bug still exits. After user post, ie stay on post.php ,
I turn on the php debug options, the error msg is :
Fatal error: Cannot redeclare newbb_notify_iteminfo() (previously declared in E:\gzsz\html\modules\newbb\include\notification.inc.php:28) in e:\gzsz\html\modules\newbb\include\notification.inc.php on line 28
Notice [PHP]: Undefined index: nosmiley in file E:\gzsz\html\modules\newbb\post.php line 166
Notice [PHP]: Undefined index: icon in file E:\gzsz\html\modules\newbb\post.php line 167
Notice [PHP]: Undefined index: attachsig in file E:\gzsz\html\modules\newbb\post.php line 168
I don't know whether is it bug or not.
At least, I've never seen the error.
Perhaps, some hacks harms it.
eg. used include() instead of include_once()
My hack code is a patch against enbugs at 2.0.6RC, and I don't know another bug.
Since I'm not a member of XOOPS core team, you should ask
www.xoops.org.But this error is quite simple, and easy to avoid only by adding 2 lines like this.
if( ! function_exists( 'newbb_notify_iteminfo' ) ) {
function newbb_notify_iteminfo($category, $item_id)
{
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('newbb');
if ($category=='global') {
$item['name'] = '';
$item['url'] = '';
return $item;
}
global $xoopsDB;
if ($category=='forum') {
// Assume we have a valid forum id
$sql = 'SELECT forum_name FROM ' . $xoopsDB->prefix('bb_forums') . ' WHERE forum_id = '.$item_id;
$result = $xoopsDB->query($sql); // TODO: error check
$result_array = $xoopsDB->fetchArray($result);
$item['name'] = $result_array['forum_name'];
$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewforum.php?forum=' . $item_id;
return $item;
}
if ($category=='thread') {
// Assume we have a valid topid id
$sql = 'SELECT t.topic_title,f.forum_id,f.forum_name FROM '.$xoopsDB->prefix('bb_topics') . ' t, ' . $xoopsDB->prefix('bb_forums') . ' f WHERE t.forum_id = f.forum_id AND t.topic_id = '. $item_id . ' limit 1';
$result = $xoopsDB->query($sql); // TODO: error check
$result_array = $xoopsDB->fetchArray($result);
$item['name'] = $result_array['topic_title'];
$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum=' . $result_array['forum_id'] . '&topic_id=' . $item_id;
return $item;
}
if ($category=='post') {
// Assume we have a valid post id
$sql = 'SELECT subject,topic_id,forum_id FROM ' . $xoopsDB->prefix('bb_posts') . ' WHERE post_id = ' . $item_id . ' LIMIT 1';
$result = $xoopsDB->query($sql);
$result_array = $xoopsDB->fetchArray($result);
$item['name'] = $result_array['subject'];
$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum= ' . $result_array['forum_id'] . '&topic_id=' . $result_array['topic_id'] . '#forumpost' . $item_id;
return $item;
}
}
}
thank you very much GIJOE, with your help, i solve the bug.