Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2002
Posts: 37
User
User
Offline
Joined: Jun 2002
Posts: 37
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.

Sponsored Links
Entire Thread
Subject Posted By Posted
[v5/v6] Underline Tag Add-on for UBB Code WrÅith 06/06/2002 8:43 PM
Re: [v5/v6] Underline Tag Add-on for UBB Code jerry 08/13/2002 5:38 PM
Re: [v5/v6] Underline Tag Add-on for UBB Code WrÅith 08/13/2002 6:11 PM
Re: [v5/v6] Underline Tag Add-on for UBB Code jerry 08/13/2002 8:22 PM
Re: [v5/v6] Underline Tag Add-on for UBB Code Gardener 08/14/2002 3:28 PM
Re: [v5/v6] Underline Tag Add-on for UBB Code Dave_L_dup1 08/14/2002 5:38 PM
Re: [v5/v6] Underline Tag Add-on for UBB Code jerry 08/14/2002 7:03 PM
Re: [v5/v6] Underline Tag Add-on for UBB Code jerry 08/14/2002 7:51 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)