<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>bbcode &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/bbcode/</link>
	<description>Feed of posts on WordPress.com tagged "bbcode"</description>
	<pubDate>Mon, 30 Nov 2009 05:27:25 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Pár dolog zyxon.tk-ról. :)]]></title>
<link>http://zyxon.wordpress.com/2009/11/12/par-dolog-zyxon-tk-rol/</link>
<pubDate>Thu, 12 Nov 2009 16:46:37 +0000</pubDate>
<dc:creator>ckop64</dc:creator>
<guid>http://zyxon.wordpress.com/2009/11/12/par-dolog-zyxon-tk-rol/</guid>
<description><![CDATA[Nos, ez a post arról fog szólni, hogy hogyan is hostoltam a saját blogomat. A hosztom a 000webhost v]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Nos, ez a post arról fog szólni, hogy hogyan is hostoltam a saját blogomat.</p>
<p>A hosztom a <a title="000webhost" href="http://000webhost.com" target="_blank">000webhost</a> volt. Nem a leggyorsabb, de zökkenőmentes, sok tárhelyel, MySQL és PHP supportal. Kezdőknek és profiknak is egyaránt sok-sok hasznos PHP alapú eszközt nyújt a szájt elleprzése érdekében. (Ilyen pl. a PHPMyAdmin felület). Webes fájlkezelőből van pl. 2. Az egyik a szokásos, a másik egy WinXP kinézetű. Kizárólagh akkor, ha nincs kedved az FTP-n molyolni. A feltöltés elég gáz volt. Csak FTP-n, az oldal vizuális felületén gyorsan ment minden. Asszem 2 GB tárhelyem volt. Egy accounton több tárhelyed is lehet. Mind ingyen, Szóval ha ügyes vagy, akkor össze tudod linkelni a tárhelyeket, ezzel megtöbbszörözve az eredeti méretet. Ez csak egy érdekesség. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Blogmotornak a <a title="Flatpress" href="http://flatpress.org" target="_blank">Flatpress</a>-t használtam. Szuper engine, jópár fontos pluginnal, de ezekből nincsen több úgy ca. 40-nél. Ami a legjobb benne &#8211; és erre is volt kihegyezve-, az a BBcode-ban való posztírás. Nekem állatira bejött, -és akár hiszitek, akár nem &#8211; Mindig ilyen blogról álmodoztam. Amúgy az már a dolog másik fele, hogy a BBcode íráson kívül nem sok mindenre alkalmas, és pl. egy kép beszúrása elég macerás. Vannak ezt megkönnyítő eszközök, de akkoris, egy [img=images/pelda.jpg scale=50% float=left] nem egyenértékű 2-3 kattintással. Van hozzá WYSIWYG szövegszerkesztő plugin is, amit a wordpress alapján kreáltak. Lassú volt, nekem nem tetszett. Akkor még ottvan az is, hogy videókat csak yt-ról lehet berakni, és azokat is macerás. Legalább is én szenvedtem vele.<br />
Róla még annyi érdekességet: Az &#8220;Adatbázis nélküli WordPress&#8221;-ként is szokták emlegetni, ami azért valljuk be messze nem fedi a valóságot. De azért hasonló DB nélküli motorokhoz képest elég sok fícsört tartalmaz alapból, és nem győzöm hangsúlyozni, hogy a pluginek is jópofák. És a BBcode is isteni. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>A BBcode-ról: A <a title="BBcode" href="http://hu.wikipedia.org/wiki/BBCode" target="_blank">BBcode</a>-t Bulletin Board code-nak is szokták nevezni, és azért hozták létre, hogy a fórumok stílusát a júzerek le tudják megtörni különböző HTML kódokkal. Ez nyújt védelmet a különböző hekkelések ellen is. Miért is volt jó ez akkor, amikor tényleg limitálja a lehetőségeidet? Hát egyszerűen azért, mert egyszerű! Könnyen tanulható, és ami a legfontosabb: működik! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Ja, és tényleg semmit nem lehet elbaszni. Kivéve egy plugint, ha szarul van megírva. Arról mondjuk nem a BBcode tehet. Lényeg a lényeg: A BBcode jó. Hol találkozhatsz BBcode-dal? A leggyakoribb &#8211; mint azt már említettem -, a fórumokon. Különösen a phpBB motoros fórumokon.</p>
<p>Hirtelen most ennyi jutott eszembe, majd legközelebb jövök többel.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Learning Diplomacy and Strategy from Travian, Part II]]></title>
<link>http://reyadel.wordpress.com/2009/10/28/learning-diplomacy-and-strategy-from-travian-part-ii/</link>
<pubDate>Wed, 28 Oct 2009 23:59:02 +0000</pubDate>
<dc:creator>reyadel</dc:creator>
<guid>http://reyadel.wordpress.com/2009/10/28/learning-diplomacy-and-strategy-from-travian-part-ii/</guid>
<description><![CDATA[Continued from yesterday&#8217;s post &#8230; The next morning, I had a seemingly large smile on my ]]></description>
<content:encoded><![CDATA[Continued from yesterday&#8217;s post &#8230; The next morning, I had a seemingly large smile on my ]]></content:encoded>
</item>
<item>
<title><![CDATA[BBCode Guide]]></title>
<link>http://amargaera.wordpress.com/2009/08/23/bbcode-guide/</link>
<pubDate>Sun, 23 Aug 2009 15:47:45 +0000</pubDate>
<dc:creator>reengah</dc:creator>
<guid>http://amargaera.wordpress.com/2009/08/23/bbcode-guide/</guid>
<description><![CDATA[http://www.phpbb.com/community/faq.php?mode=bbcode Buscando esto weeeee [url=http:// ruta... ][img] ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.phpbb.com/community/faq.php?mode=bbcode">http://www.phpbb.com/community/faq.php?mode=bbcode</a></p>
<p>Buscando esto weeeee
</p></blockquote>
<p>[url=http:// ruta... ][img] pic.. [/img][/url]</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Textpattern-Formatierung über BBCode-Firefox-AddOn]]></title>
<link>http://netztaucher.wordpress.com/2009/08/16/textpattern-formatierung-ueber-bbcode-addon/</link>
<pubDate>Sun, 16 Aug 2009 20:05:23 +0000</pubDate>
<dc:creator>Torsten</dc:creator>
<guid>http://netztaucher.wordpress.com/2009/08/16/textpattern-formatierung-ueber-bbcode-addon/</guid>
<description><![CDATA[Viele Blogger benutzen nicht WordPress, sondern Textpattern als Blog-Engine. Ähnlich wie BBCode in F]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Viele Blogger benutzen nicht <a href="http://wordpress-deutschland.org/">WordPress</a>, sondern <a href="http://de.wikipedia.org/wiki/Textpattern">Textpattern</a> als Blog-Engine. Ähnlich wie BBCode in Foren benutzt wird, nutzt Textpattern eine eigene Auszeichnungssprache für Formatierungen und Links, genannt <a href="http://de.wikipedia.org/wiki/Textile">Textile</a>. Da ich mir diese Befehle nie merken kann, habe ich mir in dem <a href="https://addons.mozilla.org/en-US/firefox/addon/128">Firefox-AddOn BBCode</a> eigene Tags eingerichtet, mit denen man die Textile/Textpattern-Formatierungen bauen kann.<br />
<!--more Weiterlesen ...--><br />
„_value_“ steht dabei für den markierten Text, „_clipboard_“ für die Zwischenablage:</p>
<p>TXP Linktext<br />
&#8220;_value_&#8221;:_clipboard_</p>
<p>TXP Link<br />
&#8220;_clipboard_&#8221;:_value_</p>
<p>TXP fett<br />
*_value_*</p>
<p>TXP kursiv<br />
__value__</p>
<p>TXP Zitat<br />
??_value_??</p>
<p>TXP durchgestrichen<br />
-_value_-</p>
<p>TXP hinzugefügt<br />
+_value_+</p>
<p>TXP hochgestellt<br />
^_value_^</p>
<p>TXP tiefgestellt<br />
~_value_~</p>
<p>[BBCode-Plugin via <a href="http://www.webwork-tools.de/2008/08/bbcode-fuer-mozilla/">Perun</a>]</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[First bug encountered on SMF 2.0 (Firefox, Safari, and Google Chrome only)]]></title>
<link>http://ichirakudev.wordpress.com/2009/06/26/first-bug-encountered-on-smf-2-0-firefox-safari-and-google-chrome-only/</link>
<pubDate>Thu, 25 Jun 2009 23:52:52 +0000</pubDate>
<dc:creator>Zanyuki</dc:creator>
<guid>http://ichirakudev.wordpress.com/2009/06/26/first-bug-encountered-on-smf-2-0-firefox-safari-and-google-chrome-only/</guid>
<description><![CDATA[Hello everyone, As you may well know, SMF 2.0 is still in its pre-release stage, as the current vers]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hello everyone,</p>
<p>As you may well know, SMF 2.0 is still in its pre-release stage, as the current version installed on Ichiraku is Release Candidate 1.1. As it&#8217;s not the final release yet, we are expecting some bugs to crop up once in a while, so we are very, very critical of the system&#8217;s performance and are always on the lookout for issues that may manifest as users utilize it for their purposes.</p>
<p>A somewhat frustrating bug has appeared for users of Firefox, Safari, and Google Chrome (we have tested it on Internet Explorer 8 and Opera 9.6 without any error, so if you are users of these browsers, this issue does not concern you). This is a rather annoying problem to users of the SMF Rich Editor, commonly called WYSIWYG (what you see is what you get). This is a new feature of SMF 2 that enables users not familiar with BBCode like [img] or [b] to format their posts and see in real-time, within the posting window, what their posts would look like when submitted. However, a problem with the coding, as described in this article, there is an acknowledged bug in SMF 2.0 that will be addressed in the second Release Candidate of SMF 2. To quote:</p>
<blockquote><p><strong>The new lines thing is a bug in Webkit.</p>
<p>Webkit wraps lines in iframes in &#60;divs&#62;</strong></p>
</blockquote>
<p>To see the entire article, click <a href="http://www.simplemachines.org/community/index.php?topic=304751.0" target="_blank">THIS</a>.</p>
<p>Basically, what happens is that when you try to format an entire post with several line breaks, SMF&#8217;s WYSIWYG editor automatically cuts the line breaks from them and jams them all together in one big paragraph.</p>
<p>We have already submitted a report to the developers regarding this issue.</p>
<p>A few images of the problem using Firefox:</p>
<div id="attachment_22" class="wp-caption alignnone" style="width: 520px"><img class="size-full wp-image-22" title="TEST1" src="http://ichirakudev.wordpress.com/files/2009/06/test11.jpg" alt="Test message using single line of text." width="510" height="460" /><p class="wp-caption-text">Test message using single line of text.</p></div>
<p>As you can see here, you can format your text with as many combinations of style as you can think of, and it would appear as nice as it appears in the window AS LONG AS THERE IS NO LINE BREAK. However, when line breaks are involved, this:</p>
<div id="attachment_23" class="wp-caption alignnone" style="width: 520px"><img class="size-full wp-image-23" title="TEST3" src="http://ichirakudev.wordpress.com/files/2009/06/test3.jpg" alt="Test message, with several line breaks" width="510" height="447" /><p class="wp-caption-text">Test message, with several line breaks</p></div>
<p>You will see that all line breaks were removed, and that there was an additional [/] after your text.</p>
<p>We have found however that you can actually work around this issue by inputting one whole block of text, formatting them, and then dividing them into paragraphs. The problem seems to be triggered by typing several paragraphs then formatting them afterward.</p>
<p>Again we are working with the SMF developers to fix this issue, so until the issue is fixed, bear with us. Otherwise, use Opera or Internet Explorer for the meantime if you want to use the WYSIWYG editor without complications, or manually format your posts using BBCode or using WYSIWYG one line at a time.</p>
<p>Cheers,</p>
<p>Ichiraku DEV</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Uploading images with a firefox extension]]></title>
<link>http://dirtmind.wordpress.com/2009/05/06/uploading-images-with-a-firefox-extension/</link>
<pubDate>Wed, 06 May 2009 10:34:20 +0000</pubDate>
<dc:creator>dirtmind</dc:creator>
<guid>http://dirtmind.wordpress.com/2009/05/06/uploading-images-with-a-firefox-extension/</guid>
<description><![CDATA[I&#8217;ve blogged before about some of the technology behind the free DirtMind image gallery so her]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;ve blogged before about some of the technology behind the free DirtMind image gallery so here&#8217;s some more&#8230;</p>
<p>For a long time I&#8217;ve wanted to make uploading and using images on forums simpler. FireFox gives us the capabilities to do this since when writing a firefox extension you&#8217;ve got access to a bit more functionality than you normally do from javascript as it&#8217;s trusted code.</p>
<p>The mission, upload an image by right clicking on it, generating all necessary BBCode.</p>
<p>The solution:</p>
<p>1) Write a nice XUL user interface for adding right click options to the firefox browser, selecting a local picture, establishing selection of a remote picture and providing nice upload feedback</p>
<p>2) Using the firefox extension encode the local image, or download a remote image and encode it (without saving a local file &#8211; that would be cheating)</p>
<p>3) Upload to the image host, decode the image data back into a picture.</p>
<p>After that it&#8217;s easy  because we&#8217;re just into the normal serverside image processing stuff that the image host does.</p>
<p>Here&#8217;s some screenshots of it in action:</p>
<div class="wp-caption alignnone" style="width: 485px"><a href="http://www.dirtmind.com/tools/ffdmbbcode.php"><img title="Selecting an image to upload" src="http://www.dirtmind.com/images/dmbbcode3.jpg" alt="Selecting an image to upload" width="475" height="377" /></a><p class="wp-caption-text">Selecting an image to upload</p></div>
<div class="wp-caption alignnone" style="width: 468px"><a href="http://www.dirtmind.com/tools/ffdmbbcode.php"><img title="The image uploaded" src="http://www.dirtmind.com/images/dmbbcode4.jpg" alt="The image uploaded" width="458" height="337" /></a><p class="wp-caption-text">The image uploaded</p></div>
<p>Because of the other stuff I&#8217;ve blogged about before in terms of image captioning and deep site integration with phpBB you can now upload an image, caption it and post it extremely easily. Check out this HQ <a href="http://www.dirtmind.com/top_stories/psst-upload-images-to-dirtmind-using-a-firefox-extension-706.php">video of the whole process</a>!</p>
<p>Or watch in in lower quality on youtubte:</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/mtnFPxN3gg4&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/mtnFPxN3gg4&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[BBCodeXtra]]></title>
<link>http://fuechschen.wordpress.com/2009/03/28/bbcodextra/</link>
<pubDate>Sat, 28 Mar 2009 23:32:27 +0000</pubDate>
<dc:creator>wordpressi</dc:creator>
<guid>http://fuechschen.wordpress.com/2009/03/28/bbcodextra/</guid>
<description><![CDATA[http://www.erweiterungen.de/detail/BBCodeXtra/ Fügt Befehle zur Formatierung mit BBCode/HTML/XHTML d]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.erweiterungen.de/detail/BBCodeXtra" target="_blank"><strong>http://www.erweiterungen.de/detail/BBCodeXtra/</strong></a></p>
<blockquote><p>Fügt Befehle zur Formatierung mit BBCode/HTML/XHTML dem Kontextmenü hinzu.<strong><br />
</strong></p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[BBCode]]></title>
<link>http://fuechschen.wordpress.com/2009/03/28/bbcode/</link>
<pubDate>Sat, 28 Mar 2009 23:28:37 +0000</pubDate>
<dc:creator>wordpressi</dc:creator>
<guid>http://fuechschen.wordpress.com/2009/03/28/bbcode/</guid>
<description><![CDATA[http://www.erweiterungen.de/detail/BBCode/ Fügt dem Kontextmenü Formatierungsbefehle (BBCode/HTML/XH]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.erweiterungen.de/detail/BBCode/" target="_blank"><strong>http://www.erweiterungen.de/detail/BBCode/</strong></a></p>
<blockquote><p>Fügt dem Kontextmenü Formatierungsbefehle (BBCode/HTML/XHTML/etc.) für Blogs und Foren (phpBB u.a.) hinzu.</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to get reviews for FireFox extensions]]></title>
<link>http://dirtmind.wordpress.com/2009/02/20/how-to-get-reviews-for-firefox-extensions/</link>
<pubDate>Fri, 20 Feb 2009 02:06:37 +0000</pubDate>
<dc:creator>dirtmind</dc:creator>
<guid>http://dirtmind.wordpress.com/2009/02/20/how-to-get-reviews-for-firefox-extensions/</guid>
<description><![CDATA[I posted this guidance recently based on the response I got from a comment on an AMO (addons.mozilla]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I posted <a href="http://www.dirtmind.com/top_stories/please-review-the-bbcode-firefox-extension-501.php" target="_blank">this guidance</a> recently based on the response I got from a comment on an AMO (<a href="http://addons.mozilla.org" target="_blank">addons.mozilla.org</a>) editor&#8217;s blog. Basically it&#8217;s instructions on how to leave a review but not how to get a review. I&#8217;ve released several firefox addons/extensions under various different IDs so here&#8217;s my advice on actually getting reviews&#8230;</p>
<p>Reviews are all important for firefox extension developers as without a number (minumum 3 decent) reviews you can&#8217;t get an extension out of the sandbox and into the public site. That&#8217;s important because in the sandbox you have to have a log in to get at an extension on the main public area anyone can download and use anonymously, so clearly there&#8217;s a barrier to normal users for sandbox extensions. This is for a good reason of course, good reviews mean that an extension isn&#8217;t just spam or complete shit, it&#8217;s actually useful.</p>
<hr />So, 3 things:</p>
<p>1) If you have a <a href="https://addons.mozilla.org/en-US/firefox/users/login" target="_blank">log in to AMO</a> then please leave reviews for the extensions you like, even if they&#8217;re already public</p>
<p>2) Please leave a review for <a href="https://addons.mozilla.org/en-US/firefox/user/3933582" target="_blank">my extensions</a> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>3) If you&#8217;re just sponging off the way extension developers make cool stuff for free help them out by leaving a review, it&#8217;s not like it costs anything more than 5 mins of your time!</p>
<hr />If you&#8217;re an extension developer, then you already know all this. So the critical question is how do you get reviews for your extension?</p>
<p>The obvious answer is to <strong>get your users to do leave reviews</strong>. The problem is it can be hard to get users if you don&#8217;t have reviews. I&#8217;ve gone about this by examining the target user base for my addon, and then telling them about it. My latest extension is about generating bbcode for forum users so naturally forum users are my target audience, I started off with my own forum and then let other forums know about it. If an extension is properly labelled then interested people will find it, of course many of them use google rather than AMO so you need to think about getting a website or page up that shows off your extension that people will find by search engines. Be careful with forums though, they are notoriously twitchy about percieved spam!</p>
<p>Do you personally know people/internet peeps that would be interested in using your addon? Then <strong>invite them</strong> to <a href="http://www.dirtmind.com/top_stories/please-review-the-bbcode-firefox-extension-501.php" target="_blank">leave a review and make sure you explain how to</a>!</p>
<p><strong>List it on AMO.</strong> People do naturally find extensions by searching AMO, I know because they&#8217;ve found mine!</p>
<p><strong>Blog it!</strong> Blogs are a great way to direct search engine traffic to something of interest.</p>
<p><strong>Tweet it! </strong>If you have a twitter following then let your tweeps know about your new found extension awesomeness.  It&#8217;s bound to be relevant to some of them, or at least as relevant as knowing that you&#8217;ve woken up.</p>
<p><strong>Get external links!</strong> If your target audience has a community or reference website then ask the webmasters if they&#8217;d be interested in linking to your extension in their resources section. Remember, everyone hates a spammer but people like contributors so you&#8217;ll often find that if you word your communication properly you&#8217;ll get a positive response. This will drive users to your extension, and in turn will drive up the number of reviews.</p>
<p><strong>Pimp it out!</strong> Whatever mediums/networks you&#8217;re a part of should know about your extension. Post it to Facebook, twitter, yammer, bebo, blinko, linkedin, hi5, plaxo, friendfeed, plurj, rejaw, meemi etc. But only let them know once, otherwise you&#8217;ll be just another spammer and ignored as such.</p>
<p>Finally, get an AMO account and <strong>leave review for other people</strong>. If I see reviews for one of my extensions I&#8217;ll lookup the username and leave a review for their extension. A bit of quid quo pro works well. So <a href="http://www.dirtmind.com/top_stories/please-review-the-bbcode-firefox-extension-501.php" target="_blank">leave me a review and I&#8217;ll leave you one</a>, there are many others that have the same philosophy, if you&#8217;re one of them then why not leave a comment here gently spamming your firefox extension.</p>
<p>Do you have any other tips?</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[BBCode Extension 1.2]]></title>
<link>http://dirtmind.wordpress.com/2009/01/30/bbcode-extension-12/</link>
<pubDate>Fri, 30 Jan 2009 01:34:58 +0000</pubDate>
<dc:creator>dirtmind</dc:creator>
<guid>http://dirtmind.wordpress.com/2009/01/30/bbcode-extension-12/</guid>
<description><![CDATA[Oops, I forgot to disable some testing stuff before uploading to addons.mozilla.org (commonly known ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Oops, I forgot to disable some testing stuff before uploading to addons.mozilla.org (commonly known as amo). This is a common mistake when making FireFox extensions &#8211; you put in code to show debug messages and enable features for testing and then forget to turn that stuff off when you upload. Ooops  							<a href="http://www.dirtmind.com/forum/posting.php?mode=reply&#38;f=2&#38;t=379#"><img style="width:15px;height:15px;" title="Embarrassed" src="http://www.dirtmind.com/forum/images/smilies/icon_redface.gif" alt="" width="15" height="15" /></a></p>
<p>So, DM BBCode Extension 1.2 has been released, it&#8217;s exactly the <a href="http://dirtmind.wordpress.com/2009/01/28/bbcode-firefox-extension-v11/" target="_blank">same as 1.1 </a>but a proper release!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[BBCode FireFox Extension v1.1]]></title>
<link>http://dirtmind.wordpress.com/2009/01/28/bbcode-firefox-extension-v11/</link>
<pubDate>Wed, 28 Jan 2009 16:07:02 +0000</pubDate>
<dc:creator>dirtmind</dc:creator>
<guid>http://dirtmind.wordpress.com/2009/01/28/bbcode-firefox-extension-v11/</guid>
<description><![CDATA[As a user of forums I find I quickly get tired of messing around with all those BBCodes. It&#8217;s ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>As a user of forums I find I quickly get tired of messing around with all those BBCodes. It&#8217;s annoying when trying to post an image or link that I have to right click something, copy to clipboard, then paste, then put tags around, then type something etc. etc.</p>
<p>So I set out to simplify all this, I had a look at some other BBCode extensions, notably Jed Brown&#8217;s original. However I found it to be a little unweildy and complex for my needs so I decided to write my own, extremely simple, BBCode extension. So easy, yer mother could use it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s how it works, when you right click on something it has a look at what you&#8217;ve right clicked on and offers you some useful menu entries. For example:</p>
<div class="wp-caption alignnone" style="width: 456px"><a class="postlink-local img_link" href="http://www.dirtmind.com/gallery/viewimage.php?uid=2&#38;gallery=sfw&#38;imageid=dirtmindimage_12327471390.jpg"><img style="border:2px solid black;" src="http://www.dirtmind.com/gallery/images/2/sfw/dirtmindimage_12327471390.jpg" alt="Image" width="446" height="131" /></a><p class="wp-caption-text">Right clicking on a image that&#39;s also a link</p></div>
<div class="wp-caption alignnone" style="width: 456px"><a class="postlink-local img_link" href="http://www.dirtmind.com/gallery/viewimage.php?uid=2&#38;gallery=sfw&#38;imageid=dirtmindimage_12327471391.jpg"><img style="border:2px solid black;" src="http://www.dirtmind.com/gallery/images/2/sfw/dirtmindimage_12327471391.jpg" alt="Image" width="446" height="131" /></a><p class="wp-caption-text">Right clicking somewhere on a page</p></div>
<div class="wp-caption alignnone" style="width: 566px"><a class="postlink-local img_link" href="http://www.dirtmind.com/gallery/viewimage.php?uid=2&#38;gallery=sfw&#38;imageid=dirtmindimage_12331566460.png"><img style="border:2px solid black;" src="http://www.dirtmind.com/gallery/images/2/sfw/dirtmindimage_12331566460.png" alt="Image" width="556" height="317" /></a><p class="wp-caption-text">Right clicking in a text area</p></div>
<p>Also when you&#8217;re in a textarea (such as when posting on a forum) the extension adds new right click menu that applies BBCode such as quote, url, img tags etc. to the current selection. Thanks to unfocused for this suggestion! I wanted to avoid loads of nested menus and just make something that&#8217;s simple and easy to use that would make my life easier. As a result it&#8217;s going to make anyone else&#8217;s life easier if they&#8217;re a forum user. BBCode is used on most forum software like vBulletin and phpBB. As always with DirtMind stuff it&#8217;s free and there&#8217;s no ads so check it out:</p>
<p><a class="postlink" rel="nofollow" href="https://addons.mozilla.org/en-US/firefox/addon/10481" target="_blank"><img src="http://www.dirtmind.com/images/addtofirefox.png" border="0" alt="Add to FireFox" /></a></p>
<p>Please leave a review/rating on the <a class="postlink" rel="nofollow" href="https://addons.mozilla.org/en-US/firefox/addon/10481" target="_blank">FireFox website</a> :)</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Creating an image gallery for phpBB]]></title>
<link>http://dirtmind.wordpress.com/2009/01/27/creating-an-image-gallery-for-phpbb/</link>
<pubDate>Tue, 27 Jan 2009 15:37:27 +0000</pubDate>
<dc:creator>dirtmind</dc:creator>
<guid>http://dirtmind.wordpress.com/2009/01/27/creating-an-image-gallery-for-phpbb/</guid>
<description><![CDATA[As part of the dirtmind site I wanted to provide a gallery for users to uploads pics, emoticons etc.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>As part of the dirtmind site I wanted to provide a gallery for users to uploads pics, emoticons etc. for posting in the dirtmind forum and so we could start building some content. With the general philosophy of don&#8217;t pay for things when there&#8217;s so much great open source about I looked at the Coppermine image gallery. Ok, so there&#8217;s some not so great open source about too. All of the galleries I looked at were ok, but didn&#8217;t integrate deeply into my site (which was now based on the <a href="http://dirtmind.wordpress.com/2009/01/27/extending-phpbb3/" target="_blank">phpBB architecture</a>) so I set about (armed with no php skill but a bit of general programming skills) to write my own.</p>
<p><span style="text-decoration:underline;"><strong>Key Features</strong></span></p>
<ul>
<li>Users can upload images into their sfw or nsfw galleries</li>
<li>Users can delete images they&#8217;ve uploaded</li>
<li>Site admins can delete other people&#8217;s images</li>
<li>Very large images are automatically scaled down</li>
<li>Images are tagged intelligently (large image get a big tag, medium images get a smaller less obtrusive tag, tiny images get no tag at all so that thinks like emoticons or avatars can be uploaded)</li>
<li>Images should be exposed as RSS so that latest uploads can be shown</li>
<li>JPG, GIF  and PNG (static, transparent and animated) to be supported</li>
<li>Thumbnails are automatically created</li>
<li>Multiple files can be uploaded at once</li>
<li>BBCode is automatically generated for both single images and multiple selection</li>
</ul>
<p><span style="text-decoration:underline;"><strong>The Gallery</strong></span></p>
<p>Should be fairly easy right? Actually, it was fairly easy &#8211; there&#8217;s a lot out there on how to upload files, watermark and resize images so it was quite straightforward to manage the uploading into user directories. At first I thought &#8220;I don&#8217;t need a database&#8221; since I was using a user and gallery based directory structure to store the files. This was mind numbingly stupid as it caused performance issues once the image number got large and made things like images RSS very hard to do.</p>
<p>So I bit the bullet and refactored the gallery into using a database to record images. This was actually pretty simple and didn&#8217;t affect my code much, I do a DB insert when an image is uploaded, a DB delete when it&#8217;s removed and then there&#8217;s just a bunch of selects instead of directory scanning.</p>
<p>I&#8217;m really happy with the multiple file upload capability, this was based on the <a href="http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/" target="_blank">stick man&#8217;s idea</a> of making multiple file uploads look like they&#8217;re using a single file input element. Once uploaded the files are presented back to the user as a grid of thumbnails which can then be selected/unselected and with each change in selection the BBCode is automatically generated using javascript. Good stuff <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Of course since all the pages on my site are in the phpBB architecture I&#8217;ve got things like login, user rights etc. done for me but even so the result is I think an extremely clean and elegant image host &#8211; it&#8217;s got none of the complexity that the old Coppermine System used to have galleries are automatically created for users when they upload their first image. Due to the tight integration into the forum software it&#8217;s incredibly simple to post uploaded images (single or multiple) into the forum, in fact it&#8217;s a single click!</p>
<p>You can checkout the <a href="http://www.dirtmind.com/gallery" target="_blank">gallery here</a> including the bbcode generation features but you can&#8217;t upload images unless you&#8217;ve registered an account (this is to prevent abuses and spam) but registering is free like everything else at DirtMind so feel free to register and upload some images if you want to try it out.</p>
<p>Related to this I&#8217;ve also launched a <a href="http://www.dirtmind.com/top_stories/firefox-bbcode-extension-333.php">FireFox Extension for BBCode</a> to make BBCode as simple as right clicking on images and links <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ASP.Net BBCode (C#)]]></title>
<link>http://eksith.wordpress.com/2009/01/14/aspnet-bbcode-c/</link>
<pubDate>Wed, 14 Jan 2009 17:10:03 +0000</pubDate>
<dc:creator>eksith</dc:creator>
<guid>http://eksith.wordpress.com/2009/01/14/aspnet-bbcode-c/</guid>
<description><![CDATA[This problem comes up if you find yourself creating a forum from scratch or implementing some sort o]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This problem comes up if you find yourself creating a forum from scratch or implementing some sort of comment system and want to make sure you can introduce some formatting functionality without compromising security.</p>
<p>Well, there are plenty of regular expressions examples out there, but few deal directly with BBCode and of those, most don&#8217;t go beyond the basic <strong>Bold</strong>, <em>Italic</em>, and <span style="text-decoration:line-through;">Strike</span> formatting plus HTML links, images etc&#8230;</p>
<p>This example not only formats the above basic stuff, but also does quotes, alignment, Google search links, Wikipedia article links, as well embedded videos for several video sharing sites. You can always add more tags by following the same pattern. All the content is formatted into paragraphs (&#60;p&#62;) for proper validation. It checks for nested quotes up to a specified depth.</p>
<p><strong><span style="color:#f33;">There is no extensive input cleanup to prevent XSS attacks through tags.</span></strong> I&#8217;m just showing the basics like tag stripping which can be circumvented by clever attakers, so it&#8217;s up to you to implement a more thorough system. The reason I&#8217;m excluding it is because there are already many, many, many examples out there that do a wonderful job at it.</p>
<p>This does set a limited set of formatting options.</p>
<p>To make everything easier to read in the code file, I used multiple Regex replacements instead of one super duper pattern. This also makes adding quick tags for something else much simpler.</p>
<p>A sample of the rendered markup :</p>
<ul>
<li>[b]Bold[/b] = <strong>Bold</strong></li>
<li>[i]Italic[/i] = <em>Italic</em></li>
<li>[del]Strike[/de] = <del>Strike</del></li>
<li>[color=blue]Blue[/blue] = <span style="color:#0000ff;">Blue</span></li>
<li>[color=#FA9A99]Pinkish[/blue] = <span style="color:#fa9a99;">Pinkish</span></li>
<li>[size=2]Larger text[/size] (between 2 &#38; 5) = <span style="font-size:2em;">Larger text</span></li>
<li>[google]once in a blue moon[/google] = <a href="http://www.google.com/search?q=once+in+a+blue+moon">once in a blue moon</a></li>
<li>[wikipedia]Captain Haddock[/wikipedia] = <a href="http://wikipedia.org/wiki/Captain Haddock">Captain Haddock</a> (Remember, Wikipedia articles are case sensitive)</li>
<li>[img]http://www.google.com/logos/Logo_40blk.gif[/img] = <img src="http://www.google.com/logos/Logo_40blk.gif" alt="" /></li>
<li>[img=Google Logo]http://www.google.com/logos/Logo_40blk.gif[/img] = <img src="http://www.google.com/logos/Logo_40blk.gif" alt="Google Logo" /></li>
</ul>
<p>One major difference than other BBCode functions is the ability to embed YouTube, Metacafe and LiveVideo media players. You only need to specify the URL within the tags.</p>
<p>E.G. For youtube :</p>
<p>[youtube]http://www.youtube.com/watch?v=c_BgitzVKzw[/youtube]<br />
<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/c_BgitzVKzw&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/c_BgitzVKzw&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>For LiveVideo<br />
[livevideo]http://www.livevideo.com/video/Megalis/E7C2EEE8A7C740379F40B5ECA56ACE8A/momma-sophia-s-dream.aspx[/livevideo]<br />
<embed src='http://www.livevideo.com/flvplayer/embed/E7C2EEE8A7C740379F40B5ECA56ACE8A' type='application/x-shockwave-flash' quality='high' WIDTH='445' HEIGHT='405' wmode='transparent'></embed></p>
<p>I don&#8217;t think WordPress supports embedding Metacafe videos at the time of this post, but if you want to include those videos :<br />
</p>
<p>To find the exact URL of the LiveVideo page, click on &#8220;Get Codes&#8221; link underneath the video player.<br />
I tried to keep this as simple as possible for users as they just need to wrap the url around [tag][/tag] markers.</p>
<p>You can embed quotes following a similar convention to phpBB. But there are slight differences as this was for a custom application.</p>
<p>[quote]This is a quote[/quote]</p>
<blockquote><p>This is a quote</p></blockquote>
<p>[quote=Author]This is a quote[/quote]</p>
<blockquote><p><cite>Author wrote</cite></p>
<hr />This is a quote</p></blockquote>
<p>And so on&#8230;</p>
<p>This version also deals with Headers<br />
([h#]Header[/h#] becomes &#60;h#&#62;Header&#60;/h#&#62; from 1 to 6.)</p>
<h3 style="display:block;font-size:2em;width:auto;color:#fff;">[h3]Header[/h3]</h3>
<h4 style="display:block;font-size:1.5em;width:auto;color:#fff;">[h4]Header[/h4]</h4>
<p>And so on&#8230;</p>
<p>Of course, you would want to apply special formatting via CSS to keep the look of the page consistent with the rest of the site.</p>
<p>This particular excerpt was written for a .Net 3.5 app, but this portion should work on 2.0+ with no alterations since it doesn&#8217;t use anything unique to the newer framework.</p>
<p>This class is by no means meant to be a comprehensive bbcode plugin, but it should get you on the way to create your own custom tags.</p>
<p>Once again, this code has no usage restrictions. I&#8217;m just including a disclaimer like all other code samples I&#8217;ve posted here. You don&#8217;t have to ask me permission to use it for any purpose and I only ask that you abide by the disclaimer.</p>
<blockquote><p>THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221; AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p></blockquote>
<p>The tag function</p>
<pre class="brush: csharp;">/// &lt;summary&gt;
/// Converts the input plain-text BBCode to HTML output and replacing carriage returns
/// and spaces with &lt;br /&gt; and   etc...
/// Recommended: Use this function only during storage and updates.
/// Keep a seperate field in your database for HTML formatted content and raw text.
/// An optional third, plain text field, with no formatting info will make full text searching
/// more accurate.
/// E.G. BodyText(with BBCode for textarea/WYSIWYG), BodyPlain(plain text for searching),
/// BodyHtml(formatted HTML for output pages)
/// &lt;/summary&gt;
public static string ConvertToHtml(string content)
{
    // Clean your content here... E.G.:
    // content = CleanText(content);   

    // Basic tag stripping for this example (PLEASE EXTEND THIS!)
    content = StripTags(content);   

    content = MatchReplace(@&quot;\[b\]([^\]]+)\[\/b\]&quot;, &quot;&lt;strong&gt;$1&lt;/strong&gt;&quot;, content);
    content = MatchReplace(@&quot;\[i\]([^\]]+)\[\/i\]&quot;, &quot;&lt;em&gt;$1&lt;/em&gt;&quot;, content);
    content = MatchReplace(@&quot;\[u\]([^\]]+)\[\/u\]&quot;, &quot;&lt;span style=&quot;&quot;text-decoration:underline&quot;&quot;&gt;$1&lt;/span&gt;&quot;, content);
    content = MatchReplace(@&quot;\[del\]([^\]]+)\[\/del\]&quot;, &quot;&lt;span style=&quot;&quot;text-decoration:line-through&quot;&quot;&gt;$1&lt;/span&gt;&quot;, content);   

    // Colors and sizes
    content = MatchReplace(@&quot;\[color=(#[0-9a-fA-F]{6}&amp;#124;[a-z-]+)]([^\]]+)\[\/color\]&quot;, &quot;&lt;span style=&quot;&quot;color:$1;&quot;&quot;&gt;$2&lt;/span&gt;&quot;, content);
    content = MatchReplace(@&quot;\[size=([2-5])]([^\]]+)\[\/size\]&quot;, &quot;&lt;span style=&quot;&quot;font-size:$1em; font-weight:normal;&quot;&quot;&gt;$2&lt;/span&gt;&quot;, content);   

    // Text alignment
    content = MatchReplace(@&quot;\[left\]([^\]]+)\[\/left\]&quot;, &quot;&lt;span style=&quot;&quot;text-align:left&quot;&quot;&gt;$1&lt;/span&gt;&quot;, content);
    content = MatchReplace(@&quot;\[right\]([^\]]+)\[\/right\]&quot;, &quot;&lt;span style=&quot;&quot;text-align:right&quot;&quot;&gt;$1&lt;/span&gt;&quot;, content);
    content = MatchReplace(@&quot;\[center\]([^\]]+)\[\/center\]&quot;, &quot;&lt;span style=&quot;&quot;text-align:center&quot;&quot;&gt;$1&lt;/span&gt;&quot;, content);
    content = MatchReplace(@&quot;\[justify\]([^\]]+)\[\/justify\]&quot;, &quot;&lt;span style=&quot;&quot;text-align:justify&quot;&quot;&gt;$1&lt;/span&gt;&quot;, content);   

    // HTML Links
    content = MatchReplace(@&quot;\[url\]([^\]]+)\[\/url\]&quot;, &quot;&lt;a href=&quot;&quot;$1&quot;&quot;&gt;$1&lt;/a&gt;&quot;, content);
    content = MatchReplace(@&quot;\[url=([^\]]+)]([^\]]+)\[\/ur\l]&quot;, &quot;&lt;a href=&quot;&quot;$1&quot;&quot;&gt;$2&lt;/a&gt;&quot;, content);   

    // Images
    content = MatchReplace(@&quot;\[img\]([^\]]+)\[\/img\]&quot;, &quot;&lt;img src=&quot;&quot;$1&quot;&quot; alt=&quot;&quot;&quot;&quot; /&gt;&quot;, content);
    content = MatchReplace(@&quot;\[img=([^\]]+)]([^\]]+)\[\/img\]&quot;, &quot;&lt;img src=&quot;&quot;$2&quot;&quot; alt=&quot;&quot;$1&quot;&quot; /&gt;&quot;, content);   

    // Lists
    content = MatchReplace(@&quot;\[*\]([^\[]+)&quot;, &quot;&lt;li&gt;$1&lt;/li&gt;&quot;, content);
    content = MatchReplace(@&quot;\[list\]([^\]]+)\[\/list\]&quot;, &quot;&lt;ul&gt;$1&lt;/ul&gt;&lt;p&gt;&quot;, content);
    content = MatchReplace(@&quot;\[list=1\]([^\]]+)\[\/list\]&quot;, &quot;&lt;/p&gt;&lt;ol&gt;$1&lt;/ol&gt;&lt;p&gt;&quot;, content);   

    // Headers
    content = MatchReplace(@&quot;\[h1\]([^\]]+)\[\/h1\]&quot;, &quot;&lt;h1&gt;$1&lt;/h1&gt;&quot;, content);
    content = MatchReplace(@&quot;\[h2\]([^\]]+)\[\/h2\]&quot;, &quot;&lt;h2&gt;$1&lt;/h2&gt;&quot;, content);
    content = MatchReplace(@&quot;\[h3\]([^\]]+)\[\/h3\]&quot;, &quot;&lt;h3&gt;$1&lt;/h3&gt;&quot;, content);
    content = MatchReplace(@&quot;\[h4\]([^\]]+)\[\/h4\]&quot;, &quot;&lt;h4&gt;$1&lt;/h4&gt;&quot;, content);
    content = MatchReplace(@&quot;\[h5\]([^\]]+)\[\/h5\]&quot;, &quot;&lt;h5&gt;$1&lt;/h5&gt;&quot;, content);
    content = MatchReplace(@&quot;\[h6\]([^\]]+)\[\/h6\]&quot;, &quot;&lt;h6&gt;$1&lt;/h6&gt;&quot;, content);   

    // Horizontal rule
    content = MatchReplace(@&quot;\[hr\]&quot;, &quot;&lt;hr /&gt;&quot;, content);   

    // Set a maximum quote depth (In this case, hard coded to 3)
    for (int i = 1; i &lt; 3; i++)
    {
        // Quotes
        content = MatchReplace(@&quot;\[quote=([^\]]+)@([^\]]+)&amp;#124;([^\]]+)]([^\]]+)\[\/quote\]&quot;, &quot;&lt;/p&gt;&lt;div class=&quot;&quot;block&quot;&quot;&gt;&lt;blockquote&gt;&lt;cite&gt;$1 &lt;a href=&quot;&quot;&quot; + QuoteUrl(&quot;$3&quot;) + &quot;&quot;&quot;&gt;wrote&lt;/a&gt; on $2&lt;/cite&gt;&lt;hr /&gt;&lt;p&gt;$4&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&quot;, content);
        content = MatchReplace(@&quot;\[quote=([^\]]+)@([^\]]+)]([^\]]+)\[\/quote\]&quot;, &quot;&lt;/p&gt;&lt;div class=&quot;&quot;block&quot;&quot;&gt;&lt;blockquote&gt;&lt;cite&gt;$1 wrote on $2&lt;/cite&gt;&lt;hr /&gt;&lt;p&gt;$3&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p&gt;&quot;, content);
        content = MatchReplace(@&quot;\[quote=([^\]]+)]([^\]]+)\[\/quote\]&quot;, &quot;&lt;/p&gt;&lt;div class=&quot;&quot;block&quot;&quot;&gt;&lt;blockquote&gt;&lt;cite&gt;$1 wrote&lt;/cite&gt;&lt;hr /&gt;&lt;p&gt;$2&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p&gt;&quot;, content);
        content = MatchReplace(@&quot;\[quote\]([^\]]+)\[\/quote\]&quot;, &quot;&lt;/p&gt;&lt;div class=&quot;&quot;block&quot;&quot;&gt;&lt;blockquote&gt;&lt;p&gt;$1&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p&gt;&quot;, content);
    }   

    // The following markup is for embedded video --&gt;   

    // YouTube
    content = MatchReplace(@&quot;\[youtube\]http:\/\/([a-zA-Z]+.)youtube.com\/watch\?v=([a-zA-Z0-9_\-]+)\[\/youtube\]&quot;,
        &quot;&lt;object width=&quot;&quot;425&quot;&quot; height=&quot;&quot;344&quot;&quot;&gt;&lt;param name=&quot;&quot;movie&quot;&quot; value=&quot;&quot;http://www.youtube.com/v/$2&quot;&quot;&gt;&lt;/param&gt;&lt;param name=&quot;&quot;allowFullScreen&quot;&quot; value=&quot;&quot;true&quot;&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;&quot;http://www.youtube.com/v/$2&quot;&quot; type=&quot;&quot;application/x-shockwave-flash&quot;&quot; allowfullscreen=&quot;&quot;true&quot;&quot; width=&quot;&quot;425&quot;&quot; height=&quot;&quot;344&quot;&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&quot;, content);   

    // LiveVideo
    content = MatchReplace(@&quot;\[livevideo\]http:\/\/([a-zA-Z]+.)livevideo.com\/video\/([a-zA-Z0-9_\-]+)\/([a-zA-Z0-9]+)\/([a-zA-Z0-9_\-]+).aspx\[\/livevideo\]&quot;,
        &quot;&lt;object width=&quot;&quot;445&quot;&quot; height=&quot;&quot;369&quot;&quot;&gt;&lt;embed src=&quot;&quot;http://www.livevideo.com/flvplayer/embed/$3&quot;&quot; type=&quot;&quot;application/x-shockwave-flash&quot;&quot; quality=&quot;&quot;high&quot;&quot; width=&quot;&quot;445&quot;&quot; height=&quot;&quot;369&quot;&quot; wmode=&quot;&quot;transparent&quot;&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&quot;, content);   

    // LiveVideo (There are two types of links for LV)
    content = MatchReplace(@&quot;\[livevideo\]http:\/\/([a-zA-Z]+.)livevideo.com\/video\/([a-zA-Z0-9]+)\/([a-zA-Z0-9_\-]+).aspx\[\/livevideo\]&quot;,
        &quot;&lt;object width=&quot;&quot;445&quot;&quot; height=&quot;&quot;369&quot;&quot;&gt;&lt;embed src=&quot;&quot;http://www.livevideo.com/flvplayer/embed/$2&amp;autostart=0&quot;&quot; type=&quot;&quot;application/x-shockwave-flash&quot;&quot; quality=&quot;&quot;high&quot;&quot; width=&quot;&quot;445&quot;&quot; height=&quot;&quot;369&quot;&quot; wmode=&quot;&quot;transparent&quot;&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&quot;, content);   

    // Metacafe
    content = MatchReplace(@&quot;\http\:\/\/([a-zA-Z]+.)metacafe.com\/watch\/([0-9]+)\/([a-zA-Z0-9_]+)/\[\/metacafe\]&quot;,
        &quot;&lt;object width=&quot;&quot;400&quot;&quot; height=&quot;&quot;345&quot;&quot;&gt;&lt;embed src=&quot;&quot;http://www.metacafe.com/fplayer/$2/$3.swf&quot;&quot; width=&quot;&quot;400&quot;&quot; height=&quot;&quot;345&quot;&quot; wmode=&quot;&quot;transparent&quot;&quot; pluginspage=&quot;&quot;http://www.macromedia.com/go/getflashplayer&quot;&quot; type=&quot;&quot;application/x-shockwave-flash&quot;&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&quot;, content);   

    // LiveLeak
    content = MatchReplace(@&quot;\http:\/\/([a-zA-Z]+.)liveleak.com\/view\?i=([a-zA-Z0-9_]+)\[\/liveleak\]&quot;,
        &quot;&lt;object width=&quot;&quot;450&quot;&quot; height=&quot;&quot;370&quot;&quot;&gt;&lt;param name=&quot;&quot;movie&quot;&quot; value=&quot;&quot;http://www.liveleak.com/e/$2&quot;&quot;&gt;&lt;/param&gt;&lt;param name=&quot;&quot;wmode&quot;&quot; value=&quot;&quot;transparent&quot;&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;&quot;http://www.liveleak.com/e/59a_1231807882&quot;&quot; type=&quot;&quot;application/x-shockwave-flash&quot;&quot; wmode=&quot;&quot;transparent&quot;&quot; width=&quot;&quot;450&quot;&quot; height=&quot;&quot;370&quot;&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&quot;, content);

    // &lt; -- End video markup   

    // Google and Wikipedia page links
    content = MatchReplace(@&quot;\[google\]([^\]]+)\[\/google\]&quot;, &quot;&lt;a href=&quot;&quot;http://www.google.com/search?q=$1&quot;&quot;&gt;$1&quot;, content);
    content = MatchReplace(@&quot;\[wikipedia\]([^\]]+)\[\/wikipedia\]&quot;, &quot;&lt;a href=&quot;&quot;http://www.wikipedia.org/wiki/$1&quot;&quot;&gt;$1&lt;/a&gt;&quot;, content);   

    // Put the content in a paragraph
    content = &quot;&lt;/p&gt;&lt;p&gt;&quot; + content + &quot;&lt;/p&gt;&quot;;   

    // Clean up a few potential markup problems
    content = content.Replace(&quot;t&quot;, &quot;    &quot;)
        .Replace(&quot;  &quot;, &quot;  &quot;)
        .Replace(&quot;&lt;br /&gt;&quot;, &quot;&quot;)
        .Replace(&quot;&lt;p&gt;&lt;br /&gt;&quot;, &quot;&lt;/p&gt;&lt;p&gt;&quot;)
        .Replace(&quot;&lt;/p&gt;&lt;p&gt;&lt;blockquote&gt;&quot;, &quot;&lt;blockquote&gt;&quot;)
        .Replace(&quot;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/p&gt;&quot;, &quot;&quot;)
        .Replace(&quot;&lt;p&gt;&lt;/p&gt;&quot;, &quot;&quot;)
        .Replace(&quot;&lt;p&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/p&gt;&quot;, &quot;&lt;ul&gt;&quot;)
        .Replace(&quot;&lt;p&gt;&lt;/p&gt;&lt;/ul&gt;&quot;, &quot;&quot;)
        .Replace(&quot;&lt;p&gt;&lt;ol&gt;&lt;/ol&gt;&lt;/p&gt;&quot;, &quot;&lt;ol&gt;&quot;)
        .Replace(&quot;&lt;p&gt;&lt;/p&gt;&lt;/ol&gt;&quot;, &quot;&quot;)
        .Replace(&quot;&lt;p&gt;&lt;li&gt;&quot;, &quot;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&quot;)
        .Replace(&quot;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&quot;, &quot;&quot;);   

    return content;
}</pre>
<p>StripTags and Match Replace functions</p>
<pre class="brush: csharp;">/// &lt;summary&gt;
/// Strip any existing HTML tags
/// &lt;/summary&gt;
///
&lt;param name=&quot;content&quot;&gt;Raw input from user&lt;/param&gt;
/// &lt;returns&gt;Tag stripped storage safe text&lt;/returns&gt;
public static string StripTags(string content)
{
	return MatchReplace(@&quot;&lt; [^&gt;]+&gt;&quot;, &quot;&quot;, content, true, true, true);
}

public static string MatchReplace(string pattern, string match, string content)
{
	return MatchReplace(pattern, match, content, false, false, false);
}

public static string MatchReplace(string pattern, string match, string content, bool multi)
{
	return MatchReplace(pattern, match, content, multi, false, false);
}

public static string MatchReplace(string pattern, string match, string content, bool multi, bool white)
{
	return MatchReplace(pattern, match, content, multi, white);
}

/// &lt;summary&gt;
/// Match and replace a specific pattern with formatted text
/// &lt;/summary&gt;
///
&lt;param name=&quot;pattern&quot;&gt;Regular expression pattern&lt;/param&gt;
///
&lt;param name=&quot;match&quot;&gt;Match replacement&lt;/param&gt;
///
&lt;param name=&quot;content&quot;&gt;Text to format&lt;/param&gt;
///
&lt;param name=&quot;multi&quot;&gt;Multiline text (optional)&lt;/param&gt;
///
&lt;param name=&quot;white&quot;&gt;Ignore white space (optional)&lt;/param&gt;
/// &lt;returns&gt;HTML Formatted from the original BBCode&lt;/returns&gt;
public static string MatchReplace(string pattern, string match, string content, bool multi, bool white, bool cult)
{
	if (multi &amp;&amp; white &amp;&amp; cult)
		return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase &amp;#124; RegexOptions.Multiline &amp;#124; RegexOptions.IgnoreCase &amp;#124; RegexOptions.CultureInvariant);
	else if (multi &amp;&amp; white)
		return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase &amp;#124; RegexOptions.Multiline &amp;#124; RegexOptions.IgnoreCase);
	else if (multi &amp;&amp; cult)
		return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase &amp;#124; RegexOptions.Multiline &amp;#124; RegexOptions.CultureInvariant);
	else if (white &amp;&amp; cult)
		return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase &amp;#124; RegexOptions.IgnorePatternWhitespace &amp;#124; RegexOptions.CultureInvariant);
	else if (multi)
		return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase &amp;#124; RegexOptions.Multiline);
	else if (white)
		return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase &amp;#124; RegexOptions.IgnorePatternWhitespace);
	else if (cult)
		return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase &amp;#124; RegexOptions.CultureInvariant);

	// Default
	return Regex.Replace(content, pattern, match, RegexOptions.IgnoreCase);
}</pre>
<p>Enjoy!</p>
<p><strong>Addendum&#8230;</strong><br />
<a href="http://www.robertbeal.info/archives/37">Robert Beal</a>, in particular has created a wonderful <em>HtmlUtility</em> class for C# 3.0+ that will only allow certain tags and tag attributes. If your visitors make use of extensive HTML tags, then that is a better option than my system. If you want to implement a feedback system for guest writers with strong HTML support, Robert&#8217;s example is highly recommended.</p>
<p>My example is really only for people who post in plain text most of the time, would only post formatted text and videos semi-rarely.</p>
<p>In fact, it&#8217;s probably best to avoid extensive HTML support for ordinary comments, as that will only encourage users to abuse the system. You&#8217;re better off using this for something minimal.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[BBCode for Google Picasaweb images]]></title>
<link>http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/</link>
<pubDate>Mon, 05 Jan 2009 22:45:53 +0000</pubDate>
<dc:creator>osblues</dc:creator>
<guid>http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/</guid>
<description><![CDATA[If, like me, you post links to your Picasaweb images on forums, you&#8217;ll probably have scratched]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If, like me, you post links to your Picasaweb images on forums, you&#8217;ll probably have scratched your head in the past and wondered why Google doesn&#8217;t include a &#8216;BBCode&#8217; option in it&#8217;s &#8216;Link to this photo&#8217; section on the right hand side.</p>
<p>So, I thought I&#8217;d knock up a quick bookmarklet to achieve this, basically if you copy the code below as the location for a bookmark in your bookmark bar, you can click it to swap out the standard &#8216;Embed image&#8217; code for BBCode for insertion to forums.</p>
<p>Here you go -</p>
<pre>
javascript:void(function(){
&#160;&#160;var s=document.getElementById('lhid_snippet');
&#160;&#160;if(s){
&#160;&#160;&#160;&#160;s.value='[url='+document.location.href+'][img]'+/&#60;img src="([^"]+)"\/&#62;/i.exec(s.value)[1]+'[/img][/url]'};
}())
</pre>
<p>(you&#8217;ll need to get it back one line, it wont format correctly here as one line)<br />
Enjoy <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a title="add to del.icio.us" rel="nofollow" href="http://del.icio.us/post?url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/delicious.gif" alt="add to del.icio.us" /></a> :: <a title="add to Technorati" rel="nofollow" href="http://technorati.com/faves/?add=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/technorati.gif" alt="Bookmark Post in Technorati" /></a> :: <a title="add to Blinkslist" rel="nofollow" href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&#38;Description=&#38;Url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;Title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/blinklist.gif" alt="Add to Blinkslist" /></a> :: <a title="add to Furl" rel="nofollow" href="http://www.furl.net/storeIt.jsp?u=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;t=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/furl.gif" alt="add to furl" /></a> :: <a title="Digg it" rel="nofollow" href="http://digg.com/submit?phase=2&#38;url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/digg.gif" alt="Digg it" /></a> :: <a title="add to ma.gnolia" rel="nofollow" href="http://ma.gnolia.com/bookmarklet/add?url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/magnolia.gif" alt="add to ma.gnolia" /></a> :: <a title="Stumble it!" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/&#38;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/stumbleit.gif" alt="Stumble It!" /></a> :: <a title="add to Simpy" rel="nofollow" href="http://www.simpy.com/simpy/LinkAdd.do?url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/simpy.png" alt="add to simpy" /></a> :: <a title="seed the vine" rel="nofollow" href="http://www.newsvine.com/_tools/seed&#38;save?url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/newsvine.gif" alt="seed the vine" /></a> :: <a title="add to Reddit" rel="nofollow" href="http://reddit.com/submit?url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/reddit.gif" alt="" /></a> :: <a title="add to Fark" rel="nofollow" href="http://cgi.fark.com/cgi/fark/edit.pl?new_url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;new_comment=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/fark.png" alt="" /></a> :: <a title="add to TailRank" rel="nofollow" href="http://tailrank.com/share/?text=&#38;link_href=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/&#38;title=BBCode+for+Google+Picasaweb+images"><img src="http://osblues.files.wordpress.com/2008/07/tailrank.gif" alt="TailRank" /></a> :: <a title="post to FaceBook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/&#38;t=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://sunburntkamel.files.wordpress.com/2008/02/facebookcom.gif" alt="post to facebook" /></a> :: <a title="bookmark on Google" rel="nofollow" href="http://www.google.com/bookmarks/mark?op=edit&#38;bkmk=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/google_bmarks.gif" alt="Bookmark on Google" /></a> :: <a title="add to Netscape" rel="nofollow" href="http://www.netscape.com/submit/?U=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/netscape.gif" alt="Add to Netscape" /></a> :: <a title="share on Yahoo!" rel="nofollow" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/yahoo_myweb.gif" alt="Share on Yahoo" /></a> :: <a title="add this to Live" rel="nofollow" href="https://favorites.live.com/quickadd.aspx?marklet=1&#38;mkt=en-us&#38;url=http://osblues.com/2009/01/05/bbcode-for-google-picasaweb-images/;title=BBCode+for+Google+Picasaweb+images"><img title="BBCode+for+Google+Picasaweb+images" src="http://osblues.files.wordpress.com/2008/07/windows_live.gif" alt="Add this to Live" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Nambah BBcode imeem pada forum]]></title>
<link>http://nanku.wordpress.com/2008/12/05/88/</link>
<pubDate>Fri, 05 Dec 2008 03:25:08 +0000</pubDate>
<dc:creator>camaterasu</dc:creator>
<guid>http://nanku.wordpress.com/2008/12/05/88/</guid>
<description><![CDATA[BBCODE: Error: Invalid Imeem shortcode attribute HTML: &lt;object width=&#8221;300&#8243; height=]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>BBCODE:</strong></p>
<blockquote><p><code>Error: Invalid Imeem shortcode attribute</code></p></blockquote>
<p><strong>HTML:</strong></p>
<blockquote><p>&#60;object width=&#8221;300&#8243; height=&#8221;80&#8243;&#62;&#60;param name=&#8221;movie&#8221; value=&#8221;http://media.imeem.com/m/{TEXT}&#8221;&#62;&#60;/param&#62;&#60;param name=&#8221;wmmode&#8221; value=&#8221;transparent&#8221;&#62;&#60;/param&#62;&#60;embed src=&#8221;http://media.imeem.com/m/{TEXT}&#8221; type=&#8221;application/x-shockwave-flash&#8221; width=&#8221;300&#8243; height=&#8221;80&#8243; wmode=&#8221;transparent&#8221;&#62;&#60;/embed&#62;&#60;/object&#62;</p></blockquote>
<p>OK now to add an imeem song to your forum, first find the song, lets say:<br />
http://afghan4life.imeem.com/music/-jA7 &#8230; nt_playin/</p>
<p>There is a small spot that says embed and should have:</p>
<blockquote><p>&#60;object width=&#8221;300&#8243; height=&#8221;80&#8243; data=&#8221;http://media.imeem.com/m/tiqwj6NScg/aus=false/&#8221; type=&#8221;application/x-shockwave-flash&#8221;&#62;&#60;param name=&#8221;wmode&#8221; value=&#8221;transparent&#8221; /&#62;&#60;param name=&#8221;src&#8221; value=&#8221;http://media.imeem.com/m/tiqwj6NScg/aus=false/&#8221; /&#62;&#60;/object&#62;</p></blockquote>
<p>So, to add this song to your forum, type:</p>
<blockquote>Error: Invalid Imeem shortcode attribute</blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Over 25000 on Petition + More Banners + SOSGA Releases Vlog Compilation!]]></title>
<link>http://fightforatlantis.wordpress.com/2008/10/21/over-25000-on-petition-more-banners-sosga-releases-vlog-compilation/</link>
<pubDate>Tue, 21 Oct 2008 03:22:21 +0000</pubDate>
<dc:creator>TelepathicPebble</dc:creator>
<guid>http://fightforatlantis.wordpress.com/2008/10/21/over-25000-on-petition-more-banners-sosga-releases-vlog-compilation/</guid>
<description><![CDATA[We&#8217;ve reached over 25000 on the petition! Congrats! Let&#8217;s keep this up! ________________]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h3>We&#8217;ve reached over 25000 on the <a href="http://fightforatlantis.wordpress.com/banners-avatars/">petition</a>! Congrats! Let&#8217;s keep this up!</h3>
<h1>_________________________</h1>
<h3>More Banners! Here&#8217;s just a sample of some of the many new banners (check out the rest and get their BBcode <a href="http://fightforatlantis.wordpress.com/banners-avatars/">here</a>):</h3>
<p><img class="alignnone" src="http://i178.photobucket.com/albums/w266/slugmut/SGA6-1.jpg" alt="" width="450" height="150" /></p>
<p><img class="alignnone" src="http://i178.photobucket.com/albums/w266/slugmut/SGATOOOOOOD.jpg" alt="" width="433" height="150" /></p>
<p><img class="alignnone" src="http://i178.photobucket.com/albums/w266/slugmut/SGASHEPPER.jpg" alt="" width="426" height="166" /></p>
<p><img class="alignnone" src="http://i178.photobucket.com/albums/w266/slugmut/SGA5CAST-1.jpg" alt="" width="460" height="150" /></p>
<h1>__________________________</h1>
<h1>Vlog Compilation from Sosga:</h1>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/PBMFNKzF0V0&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/PBMFNKzF0V0&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<blockquote><p>The Vlog is going to be shown at Armageddon con, has been sent to MGM and Sci-Fi and will be sent to many other places in due course. <br />
SoSGA would like to thank all those who have contributed their time and creative energies to make this part of the campaign a success.</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[The ultimate PHPBB3 Youtube BBCODE]]></title>
<link>http://erdracu.wordpress.com/2008/10/12/the-ultimate-youtube-bbcode/</link>
<pubDate>Sun, 12 Oct 2008 14:45:05 +0000</pubDate>
<dc:creator>Erdracu</dc:creator>
<guid>http://erdracu.wordpress.com/2008/10/12/the-ultimate-youtube-bbcode/</guid>
<description><![CDATA[Bueno, la verdad que esto no sabía donde ponerlo, y lo pongo por aquí Si alguna vez habeis metido un]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Bueno, la verdad que esto no sabía donde ponerlo, y lo pongo por aquí</p>
<p>Si alguna vez habeis metido un bbcode en un foro, os habreís dado cuenta del problema que existe con el bbcode tipo de youtube. Si pones el bbcode que te dice de meter la url completa, si alguien pone la url del formato youtube<strong>/v/</strong>15s151 no funciona, porque por defecto son en formato youtube.com<strong>/watch?v=</strong>12dsfg5&#8230; por lo cual en otros foros se opta por introducir el identificador de youtube directamente a la hora de postear un video</p>
<p>Entonces, en el foro de Townportal, he desarrollado un pequeño mix de Bbcode con Javascript, que solventa esto, permitiendo meter cualquier dirección de video de youtube:</p>
<p>Entonces: En la mascara de entrada</p>
<p><Code>[youtube]http://{TEXT1}youtube.com/{TEXT2}[/youtube]</Code></p>
<p>En el reemplazo HTML</p>
<p><Code>&#60;script&#62;<br />
var youtube =&#8221;{TEXT2}&#8221;;<br />
var identificador;<br />
var clase;<br />
clase = youtube.substring (0,1);<br />
if (clase == &#8220;v&#8221;)<br />
document.write(&#8220;&#60;object width=\&#8221;425\&#8221; height=\&#8221;344\&#8221;&#62;&#60;param name=\&#8221;movie\&#8221; value=\&#8221;http://www.youtube.com/&#8221; + youtube + &#8220;\&#38;fs=1\&#8221;&#62;&#60;/param&#62;&#60;param name=\&#8221;allowFullScreen\&#8221; value=\&#8221;true\&#8221;&#62;&#60;/param&#62;&#60;embed src=\&#8221;http://www.youtube.com/&#8221; + youtube + &#8220;\&#38;fs=1\&#8221; type=\&#8221;application/x-shockwave-flash\&#8221; allowfullscreen=\&#8221;true\&#8221; width=\&#8221;425\&#8221; height=\&#8221;344\&#8221;&#62;&#60;/embed&#62;&#60;/object&#62;&#8221;);<br />
if (clase == &#8220;w&#8221;)<br />
{identificador = youtube.substring (8,youtube.length);<br />
document.write(&#8220;&#60;object width=\&#8221;425\&#8221; height=\&#8221;344\&#8221;&#62;&#60;param name=\&#8221;movie\&#8221; value=\&#8221;http://www.youtube.com/v/&#8221; + identificador + &#8220;\&#38;fs=1\&#8221;&#62;&#60;/param&#62;&#60;param name=\&#8221;allowFullScreen\&#8221; value=\&#8221;true\&#8221;&#62;&#60;/param&#62;&#60;embed src=\&#8221;http://www.youtube.com/v/&#8221; + identificador + &#8220;\&#38;fs=1\&#8221; type=\&#8221;application/x-shockwave-flash\&#8221; allowfullscreen=\&#8221;true\&#8221; width=\&#8221;425\&#8221; height=\&#8221;344\&#8221;&#62;&#60;/embed&#62;&#60;/object&#62;&#8221;)};<br />
&#60;/script&#62;</Code></p>
<p>Y en la linea de ayuda</p>
<p><code>[youtube]url de cualquier vídeo de youtube[/youtube]</code></p>
<p>En sí, el código es más simple que una patata, pero si no teneis ni idea de JS, como me pasó a mí, así os ahorráis aprenderlo <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Con este código os la sopla el es de http://es.youtube, o los &#38;related o la coletilla que sea, y además el vídeo siempre tendrá opción a pantalla completa. Y al ser bbcode, los usuarios podrán poner videos aunque el flash esté desactivado para usuarios.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Конвертим HTML в BBCode]]></title>
<link>http://theifish.wordpress.com/2008/09/24/%d0%ba%d0%be%d0%bd%d0%b2%d0%b5%d1%80%d1%82%d0%b8%d0%bc-html-%d0%b2-bbcode/</link>
<pubDate>Wed, 24 Sep 2008 19:06:18 +0000</pubDate>
<dc:creator>theifish</dc:creator>
<guid>http://theifish.wordpress.com/2008/09/24/%d0%ba%d0%be%d0%bd%d0%b2%d0%b5%d1%80%d1%82%d0%b8%d0%bc-html-%d0%b2-bbcode/</guid>
<description><![CDATA[На Блогоде посты с блогов подсасываются по RSS. Конечно хочется иметь вид постов близкий к оригиналу]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>На <a href="http://blogoda.ru">Блогоде</a> посты с блогов подсасываются по RSS. Конечно хочется иметь вид постов близкий к оригиналу, со всеми красотам офомления HTML(tm). Если с известными блогохостингами (ЖЖ, LI.ru  и прочее) ждать подставы в коде вроде бы не приходится, то со стендэлон блогов может приплыть все что угодно, вплоть до XSS.</p>
<p>Подставлять свой молодой проект и своих пользователей очень не хотелось, но и красоту HTML(tm) терять тоже не хотелось. Решение пришло просто и эффективное как каша из топора: конвертировать HTML в BBCode. Сразу вырисовывается несколько плюсов:<!--more--></p>
<p>+ Убираем возможный вредоносный код (&#60;a href=&#8221;#&#8221; onclick=&#8221;alert(&#8216;you are hacked!&#8217;);&#8221;&#62;нажми&#60;/a&#62;);<br />
+ Приводим форматирование текста к общему стилю на сайте (&#60;b style=&#8221;font-size: 50px&#8221;&#62;Ух&#60;/b&#62; не пройдет)<br />
+ Возможность форматирования картинок (с помощью max-width и max-height)<br />
+ Специально для спамеров: noindex и nofollow для ссылок</p>
<p>Погуглив немного по просторам сети, пришел к ужасу, что никто этим толком не занимался, поэтому пришлось писать свой код.</p>
<p>Вот что вышло:</p>
<pre>function to_bbcode($string) {
  //определяем валидный URL
  $str_http_valid = 'http:\/\/[a-z0-9]?[-a-z\.0-9=_%+\/$ ]*';
  $str_url_valid = $str_http_valid.'(\?[-a-z\.0-9_%+\/=&#38;]*)?';

  //Убираем все ненужные теги, чтобы потом удалить лишние переносы
  $string = strip_tags($string, '&#60;b&#62;&#60;a&#62;&#60;i&#62;&#60;em&#62;&#60;embed&#62;&#60;img&#62;&#60;u&#62;&#60;string&#62;&#60;ol&#62;&#60;ul&#62;&#60;li&#62;&#60;br&#62;&#60;p&#62;');

  //Преобразивания для кода
  $arr_replace    = array(
  //Преобразуем валидные ссылки вида &#60;a href="http://test.ru"&#62;test&#60;/a&#62; в код [url="http://test.ru"]test[/url]
"/&#60;a\s+[^&#62;]*?href=(['\"])($str_url_valid)\\1[^&#62;]*?&#62;(.*?)&#60;\/a&#62;/Xise"
                         =&#62; "('\\2' == '' &#124;&#124; trim('\\4') == ''? 	\"\\4\" : \"[url=\\\"\\2\\\"]\\4[/url]\")",
  //Преобразуем валидные картинки вида &#60;img src="http://test.ru/1.jpg"&#62; в код [img]http://test.ru/1.jpg[/img]
"/&#60;img\s+[^&#62;]*?src=(['\"])({$str_url_valid})\\1.*?&#62;/Xise"
                         =&#62; "('\\2' == '' ? '\\2' : '[img]\\2[/img]')",
  //преобразуем известные видеохостинги (youtube, rutube и blogoda.ru <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
"/&#60;embed\s+.*?src=(['\"])(http:\\/\\/www.youtube.com\\/v\\/([a-z0-9_-]+)(&#38;.*?))?\\1.*?&#62;/Xis" =&#62; '[youtube]\\3[/youtube]',
"/&#60;embed\s+.*?src=(['\"])(http:\\/\\/video.rutube.ru\\/([a-z0-9]+))\\1.*?&#62;/Xis" =&#62; '[rutube]\\3[/rutube]',
"/&#60;embed\s+.*?src=(['\"])http:\\/\\/blogoda.ru\\/v.swf\\1\s+.*?flashvars=(['\"])(u=([a-z0-9_-])+&#38;id=([0-9]+)).*?\\2*.?&#62;/Xis" =&#62; '[blogodavideo]\\3[/blogodavideo]',
"/&#60;embed\s+.*?src=(['\"])http:\\/\\/blogoda.ru\\/m.swf\\1\s+.*?flashvars=(['\"])(u=([a-z0-9_-])+&#38;id=([0-9]+)).*?\\2*.?&#62;/Xis" =&#62; '[blogodaaudio]\\3[/blogodaaudio]',
  //Преобразуем стандартные теги форматирования HTML в BBCode (пример: &#60;b&#62;test&#60;/b&#62; в [b]test[/b])
          '/&#60;(\/)?(strong&#124;em)&#62;/Xise' =&#62; '( strcasecmp("em", "\\2") ?
"[\\1b]" : "[\\1i]" )',
          '/&#60;(\/?(?:b&#124;i&#124;u))(( [^&#62;]*?)?)&#62;/Xise'  =&#62; 'strtolower("[\\1]")',
  //Преобразуем списки ol&#124;ul и заменяем li на [*]
          '/&#60;(\/)?[ou]l( [^&#62;]*?)?&#62;/Xis'    =&#62; '[\\1list]',
          '/&#60;(\/)?li( [^&#62;]*?)?&#62;/Xise'      =&#62; '( "\\1" == "" ? "[*]" : "" )',
  //Убираем повторяющиеся пробелы
          '/[\s]+/Xi' =&#62; ' ',
          '/[ ]{2,999}/Xi' =&#62; ' ',
  //Форматирем &#60;br&#62; - один перенос, &#60;p&#62; - два переноса
          '/&#60;br( [^&#62;]*?)?&#62;/Xis' =&#62; "\n",
          '/&#60;\/?p( [^&#62;]*?)?&#62;/Xis' =&#62; "\n\n",
  //Слишком много переносов тоже плохо, убираем
          "/(\n([ ]*)?){2,999}/Xis" =&#62; "\n"
      );
  //Преобразуем [ и ] на всякий случай
  $string = str_replace("[", "***^***", str_replace(']', '***@^@***', $string));
  //Запускаем процесс
  $string = preg_replace(array_keys($arr_replace),
                         array_values($arr_replace),
                         $string);
  //Очень важно: закрыть незакрытые теги
  $closetags = array('i','b','u', 'list');
  foreach ($closetags as $tag) {
	  if (($count = substr_count($string, "[$tag]") - substr_count($string, "[/$tag]"))&#62;0) {
	  	$string.=str_repeat("[/$tag]", $count);
	  }
  }
  //Готово
  return  $string;
}</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Return of BBCode]]></title>
<link>http://bigshiba.com/2008/09/22/the-return-of-bbcode/</link>
<pubDate>Mon, 22 Sep 2008 21:00:48 +0000</pubDate>
<dc:creator>Bill Sullivan</dc:creator>
<guid>http://bigshiba.com/2008/09/22/the-return-of-bbcode/</guid>
<description><![CDATA[Starting today, we&#8217;re happy to give all of our users a new choice for posting quiz results on ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Starting today, we&#8217;re happy to give all of our users a new choice for posting quiz results on other web pages. We&#8217;ve always offered HTML and today we&#8217;re giving you a BBCode option. To get BBCode, take any quiz the same way you always have, but when you go to get code to post, just click on the &#8220;BBCode&#8221; tab. Here&#8217;s a picture of what to look for.</p>
<div id="attachment_25" class="wp-caption alignnone" style="width: 459px"><a href="http://bigshiba.wordpress.com/files/2008/09/bbcode.png"><img class="size-full wp-image-25" title="BBCode quiz result code" src="http://bigshiba.wordpress.com/files/2008/09/bbcode.png" alt="Pick the BBCode tab when you finish a quiz to get BBCode to post" width="449" height="563" /></a><p class="wp-caption-text">Pick the BBCode tab when you finish a quiz to get BBCode to post</p></div>
<p>Enjoy the new posting choice, and keep an eye on Blogthings and this blog to see when we add more for you.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[BBCODE W RĘKACH LUDU]]></title>
<link>http://aulaitt.wordpress.com/2008/09/15/bbcode-w-rekach-ludu/</link>
<pubDate>Mon, 15 Sep 2008 17:30:18 +0000</pubDate>
<dc:creator>Ole</dc:creator>
<guid>http://aulaitt.wordpress.com/2008/09/15/bbcode-w-rekach-ludu/</guid>
<description><![CDATA[gazetowego ludu, w niewłaściwy sposób użyte, może się stać niebezpiecznym narzędziem, bez znieczulen]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;"><a href="http://forum.gazeta.pl/forum/0,0.html" target="_blank">gazetowego</a> ludu, w niewłaściwy sposób użyte, może się stać niebezpiecznym narzędziem, bez znieczulenia siekającym w dobry smak, umiar, wyczucie estetyki jako takiej&#8230; Dowód niżej.</p>
<p style="text-align:justify;">Otóż Naczelne Admiństwo <a title="Forum.gazeta.pl" href="http://forum.gazeta.pl/forum/0,0.html" target="_blank">Forum</a> <a href="http://www.gazeta.pl/0,0.html" target="_blank">Gazeta.pl</a> właśnie <a title="O BBcode na Forum.gazeta.pl" href="http://forum.gazeta.pl/forum/72,2.html?f=299&#38;w=84394513" target="_blank">oddało do użytku</a> moderatorom <a title="Fora prywatne Gazeta.pl" href="http://forum.gazeta.pl/forum/0,80310,4257074.html" target="_blank">Forów Prywatnych</a> portalu onego możliwość gmerania w bebechach forumowych <em>(konkretnie zaś w nieruszalnych do tej pory rejonach <strong>nagłówka forum</strong>)</em> przy pomocy wspomnianego <a title="O BBcode" href="http://pl.wikipedia.org/wiki/BBCode" target="_blank"><strong>BBcode</strong></a>.</p>
<p style="text-align:justify;">Wiadomo, jakie możliwości on daje: a to <strong>wygrubaszenie </strong>tekstu, a to <span style="text-decoration:underline;">podkreślonko</span> nieznaczne, a to <em>wyitalikowanie</em>, a to <span style="color:#ff00ff;">podkolorowanie</span>, a to wklejkę zdjątka. Dobra rzecz, w prosty sposób pozwalająca na zindywidualizowanie forum, dopasowanie jego wyglądu do zawartości.</p>
<p style="text-align:justify;">Miejscowy lud gazeciano-forumowy w  mig zakochał się w BBcode. Szkoda, że w niektórych przypadkach bez wzajemności&#8230; Chcecie przykładu? Macie przykład &#8211; jak ktoś chciał dobrze i przedobrzył:</p>
<p style="text-align:justify;"><a href="http://aulaitt.wordpress.com/files/2008/09/etopiryna.jpg"><img class="alignnone size-full wp-image-1174" style="border:1px solid black;" title="Forum Etopiryna na poddaszu" src="http://aulaitt.wordpress.com/files/2008/09/etopiryna.jpg" alt="" width="480" height="485" /></a></p>
<blockquote>
<p style="text-align:justify;">Źródło: <a href="http://forum.gazeta.pl/forum/0,0.html">Forum Gazeta.pl</a> &#62; <a href="http://forum.gazeta.pl/forum/71,1.html?f=39856" target="_blank">Forum Etopiryna na Poddaszu</a></p>
</blockquote>
<p style="text-align:justify;">Piękności. A jaki to hardkor <strong><a href="http://forum.gazeta.pl/forum/71,1.html?f=39856" target="_blank">na żywo</a></strong> jest&#8230; Uuu, bejbe! <!--more--></p>
<p style="text-align:justify;">Wymiotny doprawdy przykład <em>ekspresjonizmu forumnaiwnego</em>. Ja poproszę o tę etopirynę, bo mi <em>n i e z a t o p s z e</em> od tego, co widzę. Chyba, że to miał być taki żart, korespondujący z rozrywkowym charakterem <a href="http://forum.gazeta.pl/forum/71,1.html?f=39856" target="_blank">&#8220;Etopiryny na Poddaszu&#8221;</a>, wtedy ową nagłówkową hulaszczość jestem w stanie zrozumieć. Co nie znaczy, że nabieram się na taki żarcik. Nie da rady, sorry. Nie na moje to poczucie humoru.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
