PEAK XOOPS - can't redirect the url after user posts in englishin japanese

can't redirect the url after user posts

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2004/3/14 16:21
edear  企霹始   Posts: 3
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
Votes:3 Average:6.67
Previous post - Next post | Parent - Children.1 | Posted on 2004/3/19 10:55
GIJOE  黎扦烦菱   Posts: 4110
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.
Votes:2 Average:5.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/3/20 14:24
edear  企霹始   Posts: 3
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
Votes:3 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/3/21 18:19
GIJOE  黎扦烦菱   Posts: 4110
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;
	}
}
}


Votes:2 Average:5.00
Previous post - Next post | Parent - No child | Posted on 2004/3/21 19:04
edear  企霹始   Posts: 3
thank you very much GIJOE, with your help, i solve the bug.
Votes:2 Average:10.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!