Subdreamer.org
 

Go Back   Subdreamer.org > Subdreamer > Code Mods Support

Reply
 
Thread Tools Display Modes
Old 12-03-2008, 07:43 AM   #1
badtrik
Junior Member
 
Join Date: Sep 2008
Posts: 4
Default include phpbb3 common.php in plugin subdreamer

Hi,

I need your help.
I want to create a plugin that will create subjects in the phpbb.
I need to include some files from the phpbb3 but I always got errors.

My function
PHP Code:
function add_topic($forum_id$postman$title$content)
{

define('IN_PHPBB'true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH 'forum/';
$phpEx substr(strrchr(__FILE__'.'), 1);

include_once(
$phpbb_root_path 'common.' $phpEx);


when I call it i've this error
PHP Code:
Fatal errorCannot redeclare utf8_str_split() in /home/bedance/public_html/forum/includes/utf/utf_tools.php on line 626 
Does somebody knows if this function is already declared in subdreamer somewhere ?
I don't understand because i don't make other includes.

Thanks in advance
badtrik is offline   Reply With Quote
Old 12-04-2008, 05:31 PM   #2
falc
Junior Member
 
Join Date: Oct 2006
Posts: 21
Default

nobody can help him?
falc is offline   Reply With Quote
Old 12-05-2008, 04:59 AM   #3
TullyMan
Senior Member
 
TullyMan's Avatar
 
Join Date: Dec 2006
Location: Arizona
Posts: 258
Default

I can't help him much but if the function was called prior to this there should be another part to the error saying where the function was previously called.
TullyMan is offline   Reply With Quote
Old 12-06-2008, 06:51 AM   #4
XhUnTeR
Senior Member
 
XhUnTeR's Avatar
 
Join Date: Sep 2006
Posts: 555
Default

well "utf_tools.php" is included "includes/usersystems/phpbb3.php" ,

the file you are trying to include (or files included by that file) is also including "utf_tools.php" again,

your best bet is to search within your "phpbb3" directory and replace any place that includes "utf_tools.php" , with "include_once", so it doens't get included twice.
XhUnTeR is offline   Reply With Quote
Old 12-09-2008, 10:33 AM   #5
badtrik
Junior Member
 
Join Date: Sep 2008
Posts: 4
Default

I checked in the "includes/usersystems/" directory.
utf_tools.php is only included in phpbb3.php but it's already included with include_once

Quote:
I can't help him much but if the function was called prior to this there should be another part to the error saying where the function was previously called.
Do you know if there's a way to enable error reporting in subdreamer?
Errors doesn't display often.
badtrik is offline   Reply With Quote
Old 12-09-2008, 10:53 AM   #6
XhUnTeR
Senior Member
 
XhUnTeR's Avatar
 
Join Date: Sep 2006
Posts: 555
Default

Quote:
Originally Posted by badtrik View Post
I checked in the "includes/usersystems/" directory.
utf_tools.php is only included in phpbb3.php but it's already included with include_once



Do you know if there's a way to enable error reporting in subdreamer?
Errors doesn't display often.
I know, that's why I said you should look into the forum directory,
if it is included with "include_once" in SD, it doesn't mean if somewhere (ie your forum files) "include" without "once" is used, it won't include it for the 2nd time,
all of the includes should be "include_once",

with a quick search it seems to be in "common.php",
it uses "require" ,
change that to "require_once", if it didn't work, change it to "include_once"
XhUnTeR is offline   Reply With Quote
Old 04-17-2009, 08:12 AM   #7
Gossioii2
Junior Member
 
Join Date: Mar 2009
Posts: 4
Wink Thanks

Looks like your question thing at the end of the post worked. Also not having to sign in is nice too. Good job. Nice list. Thanks.
Gossioii2 is offline   Reply With Quote
Reply

Tags
phpbb3 functions, plugin sd, submit_post() api

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 06:59 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.