<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>How to use BBCode into an external website ?</title>
        <description> Hi. I need to use BBCode on my website (I&amp;#039;m a php coder) and I don&amp;#039;t know what file(s) or function(s) I&amp;#039;ve got to include in my code. My phorum files are in the &amp;#039;/forum&amp;#039; directory and the page where I want the BBCode to apply is &amp;#039;index.php&amp;#039; (in the root directory).

Thanks in advance for you help.

P.S : Sorry if there&amp;#039;re some mistakes, I&amp;#039;m not fluent in English ^^.</description>
        <link>https://www.phorum.org/support/read.php?28,142344,142344#msg-142344</link>
        <lastBuildDate>Mon, 12 Oct 2026 14:19:53 -0500</lastBuildDate>
        <generator>Phorum 6.0.4</generator>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142360#msg-142360</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142360#msg-142360</link>
            <description><![CDATA[ Those are buttons. Editor Tools is the name of the module that implements those.<br />
<br />
I don&#039;t have a quick way for you to put those buttons at arbitrary places in your pages. You could take a look at the module for inspiration though.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 12:51:17 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142359#msg-142359</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142359#msg-142359</link>
            <description><![CDATA[ This :<br />
<img src="http://img35.imageshack.us/img35/2825/bbcodebarre.png" class="bbcode" border="0" /><br />
<br />
I thought &#039;input&#039; was the word ^^.]]></description>
            <dc:creator>.IrØniK</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 12:37:12 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142357#msg-142357</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142357#msg-142357</link>
            <description><![CDATA[ What are &quot;inputs&quot; ?]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 10:17:42 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142355#msg-142355</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142355#msg-142355</link>
            <description><![CDATA[ Thank you two ! It&#039;s working now...<br />
<br />
Now, I want to include the BBCode &#039;inputs&#039; in my own form. I searched on the bbcode directory but I didn&#039;t find anything. I also search on read.php... but I actually didn&#039;t understand anything from it.<br />
<br />
Thanks in advance for helping me.]]></description>
            <dc:creator>.IrØniK</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 08:30:58 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142351#msg-142351</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142351#msg-142351</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>Thomas Seifert</strong><br />Also it expects as input an array of messages with body and subject which are formatted accordingly.</div></blockquote>
<br />
I you look further in the bbcode.php file you will see:<br />
[code=&quot;php&quot; number=&quot;56&quot;]<br />
$body = $message[&quot;body&quot;];<br />
[/code]<br />
<br />
So, for your purposes:<br />
[code=&quot;php&quot;]<br />
echo phorum_mod_bbcode_format(&#039;<b>test</b>&#039;);<br />
[/code]<br />
should be:<br />
[code=&quot;php&quot;]<br />
$test_text = array(1 =&gt; array(&quot;body&quot; =&gt; &quot;<b>test</b>&quot;));<br />
$formatted_text = phorum_mod_bbcode_format($test_text);<br />
echo $formatted_text[1][&quot;body&quot;];<br />
[/code]<br />
<br />
Also, once you change directory, you do not need to call the other required bbcode module files as the module does that itself.  You will need to return to your original working directory after you have run the bbcode formatting.  The easiest way to do that is:<br />
<pre class="bbcode">
$curdir = getcwd();
chdir(&#039;forum&#039;);

. . .

chdir($curdir);
</pre>]]></description>
            <dc:creator>Joe Curia</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 05:51:35 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142350#msg-142350</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142350#msg-142350</link>
            <description><![CDATA[ quoting myself again ...<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />Also it expects as input an array of messages with body and subject which are formatted accordingly.</div></blockquote>
<br />
your input won&#039;t work but needs to be an array containing your data.<br />
something like (not tested):<br />
<br />
[code=&quot;php&quot;]<br />
print_r(phorum_mod_bbcode_format(array(array(&#039;body&#039;=&gt;&#039;<b>test</b>&#039;,&#039;subject&#039;=&gt;&#039;&#039;));<br />
[/code]]]></description>
            <dc:creator>Thomas Seifert</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 05:44:47 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142349#msg-142349</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142349#msg-142349</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>Thomas Seifert</strong><br />
you didn&#039;t look at the code at all.</div></blockquote>
<br />
I did...<br />
<br />
Well, I put this at the beginning of my page :<br />
<br />
[code=&quot;php&quot;]<br />
chdir(&#039;forum&#039;);<br />
require_once(&#039;./common.php&#039;);<br />
require_once(&#039;./mods/bbcode/api.php&#039;);<br />
require_once(&#039;./mods/bbcode/builtin_tags.php&#039;);<br />
require_once(&#039;./mods/bbcode/defaults.php&#039;);<br />
require_once(&#039;./mods/bbcode/bbcode.php&#039;);<br />
echo phorum_mod_bbcode_format(&#039;<b>test</b>&#039;);<br />
[/code]<br />
<br />
and I got :<br />
<br />
<b>Warning: Invalid argument supplied for foreach() in /home/a3574827/public_html/forum/mods/bbcode/bbcode.php on line 45</b><br />
<br />
Here&#039;s the 45th line of bbcode.php :<br />
<br />
[code=&quot;php&quot;]<br />
foreach ($data as $message_id =&gt; $message)<br />
[/code]<br />
<br />
I suppose either $message_id or $message (or both) are empty or something like that.<br />
<br />
Thanks for your help.]]></description>
            <dc:creator>.IrØniK</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 05:25:58 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142348#msg-142348</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142348#msg-142348</link>
            <description><![CDATA[ you didn&#039;t look at the code at all.<br />
The module does some includes in the beginning:<br />
[code=&quot;php&quot;]<br />
require_once(&#039;./mods/bbcode/api.php&#039;);<br />
require_once(&#039;./mods/bbcode/builtin_tags.php&#039;);<br />
require_once(&#039;./mods/bbcode/defaults.php&#039;);<br />
[/code]<br />
<br />
<br />
Therefore you need to &quot;chdir&quot; to the phorum directory before including the bbcode.php file (search the forums, this was explained a lot)-<br />
Also it expects as input an array of messages with body and subject which are formatted accordingly.]]></description>
            <dc:creator>Thomas Seifert</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 03:52:39 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142347#msg-142347</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142347#msg-142347</link>
            <description><![CDATA[ I&#039;ve already done that. I&#039;ve tried this in my page index.php :<br />
<br />
[code=&quot;php&quot;]<br />
require_once(&#039;forum/mods/bbcode/bbcode.php&#039;);<br />
[/code]<br />
<br />
and after typing that :<br />
[code=&quot;php&quot;]<br />
echo phorum_mod_bbcode_format(&#039;<b>test</b>&#039;);<br />
[/code]<br />
<br />
...php displays the following message :<br />
<br />
<b>Fatal error: Call to undefined function bbcode_api_initparser() in /home/a3574827/public_html/includes/bbcode/bbcode.php on line 41</b><br />
<br />
The function bbcode_api_initparser() is definitely undefined...<br />
<br />
What is the problem ?]]></description>
            <dc:creator>.IrØniK</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Dec 2009 03:37:58 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142346#msg-142346</guid>
            <title>Re: How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142346#msg-142346</link>
            <description><![CDATA[ check out the bbcode module in the mods folder.]]></description>
            <dc:creator>Thomas Seifert</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 15 Dec 2009 14:35:54 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,142344,142344#msg-142344</guid>
            <title>How to use BBCode into an external website ?</title>
            <link>https://www.phorum.org/support/read.php?28,142344,142344#msg-142344</link>
            <description><![CDATA[ Hi. I need to use BBCode on my website (I&#039;m a php coder) and I don&#039;t know what file(s) or function(s) I&#039;ve got to include in my code. My phorum files are in the &#039;/forum&#039; directory and the page where I want the BBCode to apply is &#039;index.php&#039; (in the root directory).<br />
<br />
Thanks in advance for you help.<br />
<br />
P.S : Sorry if there&#039;re some mistakes, I&#039;m not fluent in English ^^.]]></description>
            <dc:creator>.IrØniK</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 15 Dec 2009 11:44:35 -0600</pubDate>
        </item>
    </channel>
</rss>
