Here's what I have so far, any suggestions? Comments? See any mistakes?
ubbt.inc.php:
=============
Required - This will create the [underline, align left, center, align right, justify] tag parser
insert:
code:
// ---------------------------
// Begin Encode Underline Hack
$Body =str_replace("","<u>",$Body);
$Body =str_replace("","</u>",$Body);
// ---------------------------
// Begin Encode Align Left Hack (default)
$Body =str_replace("[align left]","<p align=left>",$Body,"</p>");
$Body =str_replace("[/align left]","<p align=left>",$Body,"</p>");
// ---------------------------
// Begin Encode Center Hack
$Body =str_replace("[center]","<p align=center>",$Body,"</p>");
$Body =str_replace("[/center]","<p align=left>",$Body,"</p>");
// ---------------------------
// Begin Encode Align Right Hack
$Body =str_replace("[align right]","<p align=right>",$Body,"</p>");
$Body =str_replace("[/align right]","<p align=left>",$Body,"</p>");
// ---------------------------
// Begin Encode Justify Hack
$Body =str_replace("[justify]","<p align=justify>",$Body,"</p>");
$Body =str_replace("[/justify]","<p align=left>",$Body,"</p>");
before:
code:
// ---------------------------
// Do list elements
Now, so that the edit function will show UBBCode rather than HTML.. insert:
code:
// ---------------------------
// Convert the underline tags
$Body =str_replace("<u>","",$Body);
$Body =str_replace("</u>","",$Body);
// ---------------------------
// Convert the align left tags
$Body =str_replace("<p align=left>","[align left]",$Body,"</p>");
$Body =str_replace("</align left>","[/align left]",$Body,"</p>");
// ---------------------------
// Convert the center tags
$Body =str_replace("<p align=center>","[center]",$Body,"</p>");
$Body =str_replace("</center>","[/center]",$Body,"</p>");
// ---------------------------
// Convert the align right tags
$Body =str_replace("<p align=right>","[align right]",$Body,"</p>");
$Body =str_replace("</align right>","[/align right]",$Body,"</p>");
// ---------------------------
// Convert the justify tags
$Body =str_replace("<p align=justify>","[justify]",$Body,"</p>");
$Body =str_replace("</justify>","[/justify]",$Body,"</p>");
before:
code:
// ---------------------------
// Conver the list markup
Would it be wise to add these changes to ubbt_instant_ubbcode.tmpl and instant_markup.php? Would need more room on the UBBCode Panel to add these changes.