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;
}
}
}