phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Creating bbcode with php supported.


 
Search this topic... | Search MOD Writing... | Search Box
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Author Message
katates
Board Member



Joined: 19 Feb 2013

Posts: 2



PostPosted: Wed Mar 27, 2013 9:11 pm 
Post subject: Creating bbcode with php supported.

Hey guys i am working on phpbb2 icon_cool.gif And i am trying to create a new bbcode with php function.

I tried to add php code in bbcode.tpl and include another tpl, it didn't worked altough having eXtreme Styles mod.

And i can't set it.

Code:


function bbcode_indb($var1)
{
    global $phpEx;

    include('indb.' . $phpEx);

    if(intval($var1))
    {
        $indb = new InDB('http://mysite.net/title/ff' . $var1);
    }
    else
    {
        $var1 = preg_replace('#[^\d]+#', '', $var1);
        $indb = new InDB('http://mysite.net/title/ff' . $var1);
    }

    if ($oInDB->isReady) {
        $content.= 'hello';
        echo $content;
    }
}


and this is the replacement code.


Code:

// [indb]

$patterns[] = "#\[indb\](.*?)\[/indb\]#is";
$replacements[] = $this->bbcode_indb('\$1');



But it's not working. I am getting Fatal error: Using $this when not in object context in... this error.

And i tried this:

Code:

// [indb]

$patterns[] = "#\[indb\](.*?)\[/indb\]#is";
$replacements[] = bbcode_indb('\$1');



It's a little bit working, it's always pulling 1 (because of the bbcode_indb('\$1'); ) data, not [indb]this one[/indb].

What's wrong?
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 653
Location: Texas


flag
PostPosted: Thu Mar 28, 2013 5:50 pm 
Post subject: Re: Creating bbcode with php supported.

Are you sure such a MOD doesn't already exist?
_________________
phpBBDoctor Blog
Back to top
katates
Board Member



Joined: 19 Feb 2013

Posts: 2



PostPosted: Thu Mar 28, 2013 6:42 pm 
Post subject: Re: Creating bbcode with php supported.

drathbun wrote:
Are you sure such a MOD doesn't already exist?


Yeah, there is no mod like this. Otherwise if i can found a bbcode using php not template that would be great because i can transcribe it.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0089 seconds using 16 queries. (SQL 0.0014 Parse 0.0005 Other 0.0069)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo