BBCode in Text

By BlindWanderer Last update May 19, 2008 — Installed 2,403 times. Daily Installs: 1, 1, 0, 0, 0, 0, 4, 2, 0, 0, 3, 3, 2, 0, 0, 0, 1, 0, 1, 1, 0, 1, 7, 0, 1, 1, 1, 3, 0, 1, 2, 1
Script Summary:
Some forums have disabled BBCode (UBBCode) leaving them hard to read. This script is designed to work with vBulletin and convert BBCode into HTML.

Remotely hosted version

Recently Updated TopicsPosts
Archived Comments2

this script has 1 topic, 2 posts

This script has no reviews.

It does this in a three step process.

  1. Scan for sections that should contain BBCode.
  2. Scan those sections for BBCode tags and isolate those tags and make them individual elements, building a table of tags in the process.
  3. Use the table to reconstruct the tag tree.
Caveats:
  1. Step 1 could be improved (currently uses 3 xpath expressions).
Changes:
  • Better stripping of VBulletin inserted spaces.
  • Reverted a change in how it handles code.
  • Added support for text formatting tags in code blocks, (it's a bad hack and the wrong solution but it's easier then doing it right)
  • Remove double spaces from urls.
  • Shortening the display of long URLs to 65 charcters.
  • handling of img tags in such a way as to allow for it not to step on the toes of native img handling.
  • Stripped BR tags from code & php tags.
  • Better error detection and recovery.
  • Ability to parse non-bbcode urls into links (not perfect but it's a good hack)
  • Small bug fixes.