<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
		<link>https://punbb.informer.com/forums/topic/20293/how-to-add-bbcodes-into-punbbcode-official-extension/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/20293/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [How To] Add BBCODES into pun_bbcode OFFICIAL Extension.]]></description>
		<lastBuildDate>Thu, 27 Oct 2016 17:18:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/156522/#p156522</link>
			<description><![CDATA[<p>Is there anyone who is familiar enough with this to help me add a twitter tag?</p>]]></description>
			<author><![CDATA[null@example.com (paulcambull)]]></author>
			<pubDate>Thu, 27 Oct 2016 17:18:21 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/156522/#p156522</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/141764/#p141764</link>
			<description><![CDATA[<p>I want to know about add &#039;highlight&#039;, &#039;indent&#039; in bbcode button</p>]]></description>
			<author><![CDATA[null@example.com (sohelarmanbd)]]></author>
			<pubDate>Fri, 04 Nov 2011 00:28:59 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/141764/#p141764</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/138604/#p138604</link>
			<description><![CDATA[<p>Thanks!<br />Ill will try it out later.</p>]]></description>
			<author><![CDATA[null@example.com (iTommy)]]></author>
			<pubDate>Tue, 16 Nov 2010 21:52:43 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/138604/#p138604</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/138603/#p138603</link>
			<description><![CDATA[<div class="quotebox"><cite>iTommy wrote:</cite><blockquote><p>I don&#039;t seem to get this one to work<br />When i edit bar.php, and refresh the all the format icons and smileys disappear.<br />It does not matter if i edit parser.php or not.</p><p>This is my bar.php edit:<br />// List of tags, which may have attribute<br />&nbsp; &nbsp; $tags_without_attr = array(&#039;b&#039;, &#039;i&#039;, &#039;u&#039;, &#039;email&#039;, &#039;list&#039;, &#039;youtube&#039;, &#039;li&#039; =&gt; &#039;*&#039;, &#039;quote&#039;, &#039;code&#039;, &#039;url&#039;);</p><p>I only want YouTube.</p><p>I have tried to disable and enable the extension but it does not make any difference! </p><p>pun_bbcode extension works by itself (unedited), no problem.</p><p>Any ideas?</p></blockquote></div><p>Change in parser to :</p><p>line 83<br /></p><div class="codebox"><pre><code>        // Remove empty tags
        while ($new_text = preg_replace(&#039;/\[(b|u|i|h|colou?r|quote|code|youtube|img|url|email|list)(?:\=[^\]]*)?\]\[\/\1\]/&#039;, &#039;&#039;, $text))</code></pre></div><p>line 112<br /></p><div class="codebox"><pre><code>    $tags = array(&#039;quote&#039;, &#039;code&#039;, &#039;youtube&#039;, &#039;b&#039;, &#039;i&#039;, &#039;u&#039;, &#039;color&#039;, &#039;colour&#039;, &#039;url&#039;, &#039;email&#039;, &#039;img&#039;, &#039;list&#039;, &#039;*&#039;, &#039;h&#039;);</code></pre></div><p>line 124<br /></p><div class="codebox"><pre><code>    $tags_inline = array(&#039;b&#039;, &#039;i&#039;, &#039;u&#039;, &#039;color&#039;, &#039;colour&#039;, &#039;h&#039;, &#039;youtube&#039;);</code></pre></div><p>line 137<br /></p><div class="codebox"><pre><code>    // Tags we can automatically fix bad nesting
    $tags_fix = array(&#039;quote&#039;, &#039;youtube&#039;, &#039;b&#039;, &#039;i&#039;, &#039;u&#039;, &#039;color&#039;, &#039;colour&#039;, &#039;url&#039;, &#039;email&#039;, &#039;h&#039;);</code></pre></div><p>then after line 739 add this<br /></p><div class="codebox"><pre><code>    $pattern[] = &#039;#\[youtube\](.*?)\[/youtube\]#s&#039;;
    $replace[] = &#039;&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/$1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/$1&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&#039;;</code></pre></div><p>I just tried it works.<br />Sorry for my poor english <img src="https://punbb.informer.com/forums/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<author><![CDATA[null@example.com (Nonante)]]></author>
			<pubDate>Tue, 16 Nov 2010 21:11:04 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/138603/#p138603</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/138601/#p138601</link>
			<description><![CDATA[<p>I don&#039;t seem to get this one to work<br />When i edit bar.php, and refresh the all the format icons and smileys disappear.<br />It does not matter if i edit parser.php or not.</p><p>This is my bar.php edit:<br />// List of tags, which may have attribute<br />&nbsp; &nbsp; $tags_without_attr = array(&#039;b&#039;, &#039;i&#039;, &#039;u&#039;, &#039;email&#039;, &#039;list&#039;, &#039;youtube&#039;, &#039;li&#039; =&gt; &#039;*&#039;, &#039;quote&#039;, &#039;code&#039;, &#039;url&#039;);</p><p>I only want YouTube.</p><p>I have tried to disable and enable the extension but it does not make any difference! </p><p>pun_bbcode extension works by itself (unedited), no problem.</p><p>Any ideas?</p>]]></description>
			<author><![CDATA[null@example.com (iTommy)]]></author>
			<pubDate>Tue, 16 Nov 2010 16:53:49 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/138601/#p138601</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/137132/#p137132</link>
			<description><![CDATA[<p>help please! <br /><span class="postimg"><img src="http://i34.tinypic.com/33yqkpc.jpg" alt="http://i34.tinypic.com/33yqkpc.jpg" /></span></p><p>the video doesn&#039;t display<br />My PunBB version - PunBB 1.3.4</p>]]></description>
			<author><![CDATA[null@example.com (prashanth1990)]]></author>
			<pubDate>Mon, 23 Aug 2010 16:16:20 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/137132/#p137132</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/137046/#p137046</link>
			<description><![CDATA[<p>Why would you hack the source, they made it extensible for a reason! Using this extensibility makes something like adding another bbcode really easy!</p><p>Just use this hook!</p><div class="codebox"><pre><code>&lt;hook id=&quot;ps_do_bbcode_replace&quot;&gt;&lt;![CDATA[
        
    $pattern[] = &#039;#\[youtube\](.*?)\[/youtube\]#s&#039;;
    $replace[] = &#039;&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/$1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/$1&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&#039;;
        
]]&gt;&lt;/hook&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (nhodges)]]></author>
			<pubDate>Sun, 22 Aug 2010 06:08:23 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/137046/#p137046</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/135567/#p135567</link>
			<description><![CDATA[<p>Hello theres<br />I was looking for upgrades in your new version of PunBB hosted at my domain forum.sawayra.com but are having issue for creating the youtube bbcode. can anyone there help me to do modifications in prser.php file?<br />Shall be very thankful to you.<br />if anyone found any extension or have update file to simply replaceable files than do me a mail at my mail address admin at sawayra.com<br />shall be very thankfull to you for this</p>]]></description>
			<author><![CDATA[null@example.com (sawayra)]]></author>
			<pubDate>Tue, 08 Jun 2010 12:14:39 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/135567/#p135567</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/124460/#p124460</link>
			<description><![CDATA[<p>hey did any one maked extension out of that.</p>]]></description>
			<author><![CDATA[null@example.com (SuperMAG)]]></author>
			<pubDate>Wed, 11 Feb 2009 19:17:34 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124460/#p124460</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/124169/#p124169</link>
			<description><![CDATA[<p>I got those smilies from PunBB 1.2 forum, from here I guess <a href="http://punbb.informer.com/forums/post/5779/#p5779">http://punbb.informer.com/forums/post/5779/#p5779</a>. Anyway you can download from <a href="http://www.latifa.ro/forum/css/smilies.zip">here</a>.</p>]]></description>
			<author><![CDATA[null@example.com (gherosh)]]></author>
			<pubDate>Thu, 05 Feb 2009 23:38:44 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124169/#p124169</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/124116/#p124116</link>
			<description><![CDATA[<p>BTW: what kind of set of smilies are you using? Got a link to them?</p>]]></description>
			<author><![CDATA[null@example.com (KeyDog)]]></author>
			<pubDate>Wed, 04 Feb 2009 23:17:52 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124116/#p124116</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/124112/#p124112</link>
			<description><![CDATA[<p>I had PunBB 1.2.x with youtube movies, upgraded to 1.3.&nbsp; Here is how I manage the youtube links movies:</p><div class="codebox"><pre><code>Youtube BBCode example: [youtube]http://youtube.com/watch?v=uDybmxbKf4Y[/youtube]

1. Modify $tags_without_attr = array(&#039;b&#039;, &#039;i&#039;, &#039;u&#039;, &#039;url&#039;, &#039;email&#039;, &#039;img&#039;, &#039;list&#039;, &#039;li&#039; =&gt; &#039;*&#039;, &#039;quote&#039;, &#039;code&#039;, &#039;youtube&#039;); #add youtube in /extensions/pun_bbcode/bar.php

2. add youtube image button to /extensions/pun_bbcode/buttons/[your_style]/

3. In includes/parser.php modify function handle_url_tag replace:

if ($full_url == $link)
    return &#039;[url]&#039;.$link.&#039;[/url]&#039;;
else
    return &#039;[url=&#039;.$full_url.&#039;]&#039;.$link.&#039;[/url]&#039;;
---------------------------------------------------------
with:
if ($full_url == $link)
    if(strpos($link, &#039;youtube.com/watch&#039;) === 0)
        return &#039;[url]&#039;.$link.&#039;[/url]&#039;;
    else
        return $link;
else
    return &#039;[url=&#039;.$full_url.&#039;]&#039;.$link.&#039;[/url]&#039;;
-----------------------------------------------------
this will not transform your youtube url into a href link before inserting message into db.


4. In includes/parser.php modify function do_bbcode  add (at the end of $pattern and $replace array):
$pattern[] = &#039;#\[youtube\]http://(?:www\.)?youtube.com/watch\?v=([0-9A-Za-z-_]{11})[^[]*\[/youtube\]#is&#039;;
and
$replace[] = &#039;&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;$1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/$1&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&#039;;

5. If you have upgraded from 1.2 and used [youtube][/youtube] BBCode run this queries on the posts table:
- update `forum_posts` set `message` = replace(`message`, &#039;[youtube][url]&#039;,&#039;[youtube]&#039;) WHERE message LIKE &#039;%[youtube][url]%
- update `forum_posts` set `message` = replace(`message`, &#039;[/url][/youtube]&#039;,&#039;[/youtube]&#039;) WHERE message LIKE &#039;%[/url][/youtube]%&#039;&#039;</code></pre></div><p>See it in action <a href="http://www.latifa.ro/forum/post10107.html#p10107">http://www.latifa.ro/forum/post10107.html#p10107</a></p><p>Hope this help. <img src="https://punbb.informer.com/forums/img/smilies/roll.png" width="15" height="15" alt="roll" /></p>]]></description>
			<author><![CDATA[null@example.com (gherosh)]]></author>
			<pubDate>Wed, 04 Feb 2009 22:23:19 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124112/#p124112</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/123588/#p123588</link>
			<description><![CDATA[<p>I tried exactly what you say, but it doesn&#039;t work for me...</p>]]></description>
			<author><![CDATA[null@example.com (Eretz)]]></author>
			<pubDate>Tue, 27 Jan 2009 18:23:11 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/123588/#p123588</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/120458/#p120458</link>
			<description><![CDATA[<div class="quotebox"><cite>chali wrote:</cite><blockquote><p>Where can i get the icons (youtube.png, etc..)?</p></blockquote></div><br /><p><span class="postimg"><img src="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/youtube.png" alt="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/youtube.png" /></span> <br />Youtube</p><p><span class="postimg"><img src="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/youtube_wide.png" alt="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/youtube_wide.png" /></span> Youtube Wide</p><p><span class="postimg"><img src="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/google.png" alt="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/google.png" /></span> Google Video</p><p><span class="postimg"><img src="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/vimeo.png" alt="http://www.snowboard-zamora.net/foro/extensions/pun_bbcode/buttons/Oxygen/vimeo.png" /></span> Vimeo</p>]]></description>
			<author><![CDATA[null@example.com (raul.lnx)]]></author>
			<pubDate>Fri, 05 Dec 2008 18:25:19 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/120458/#p120458</guid>
		</item>
		<item>
			<title><![CDATA[Re: [How To] Add BBCODES into pun_bbcode OFFICIAL Extension]]></title>
			<link>https://punbb.informer.com/forums/post/120454/#p120454</link>
			<description><![CDATA[<p>Where can i get the icons (youtube.png, etc..)?</p>]]></description>
			<author><![CDATA[null@example.com (chali)]]></author>
			<pubDate>Fri, 05 Dec 2008 17:13:09 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/120454/#p120454</guid>
		</item>
	</channel>
</rss>
