Mod Name / Version: Omit adding break tags when HTML is enabled
Description: This is the most non-spectacular modification I ever posted, but it can be extremely useful.
Till now when one inserted html in posts(with HTML enabled) it had to be formatted so the code is all on one line or it screwed it up.
Also there was no way to enter or edit the HTML correctly after the post has been posted since it would keep adding the pesky break tags again.
This mod fixes it.
Working Under: UBB.Threads 6.4-6.5
Mod Status: Finished
Any pre-requisites: none
Author(s): Anno
Date: 01/26/05
Credits: Files Altered: addpost.php
modifypost.php
New Files: none
Database Altered: no
Info/Instructions: <br />In addpost.php <br /> <br />search for: <br /> <br /> $PrintBody = preg_replace("/(\r\n|\r|\n)/i","<br />",$PrintBody); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br /> $PrintBody = preg_replace("/(\r\n|\r|\n)/i","<br />",$PrintBody); <br />} <br /> <br />search for: <br /> <br /> $Body = preg_replace("/(\r\n|\r|\n)/i","<br />",$Body); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br /> $Body = preg_replace("/(\r\n|\r|\n)/i","<br />",$Body); <br />} <br /> <br /> <br />in modifypost.php <br /> <br />search for: <br /> <br /> $PrintBody = str_replace("\n","<br />",$PrintBody); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br /> $PrintBody = preg_replace("/(\r\n|\r|\n)/i","<br />",$PrintBody); <br />} <br /> <br />search for: <br /> <br /> $Body = preg_replace("/(\r\n|\r|\n)/i","<br />",$Body); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br /> $Body = preg_replace("/(\r\n|\r|\n)/i","<br />",$Body); <br />} <br /> <br />
Note: The above lines can differ a bit depending on the exact version you have.
But it should always be
$Body = preg_replace("a combination of /n and /r ","<br />",$Body);
$PrintBody = preg_replace("a combination of /n and /r ","<br />",$PrintBody);
The replace code is always as in the directions.
Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.