Mod Name / Version: Omit adding break tags when HTML is enabled <br /> <br />
Description: This is the most non-spectacular modification I ever posted, but it can be extremely useful. <br /> <br />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. <br /> <br />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. <br /> <br />This mod fixes it. <br /> <br />
Working Under: UBB.Threads 6.4-6.5 <br /> <br />
Mod Status: Finished <br /> <br />
Any pre-requisites: none <br /> <br />
Author(s): Anno <br /> <br />
Date: 01/26/05 <br /> <br />
Credits: <br /> <br />
Files Altered: <br />addpost.php <br />modifypost.php <br /> <br />
New Files: none <br /> <br />
Database Altered: no <br /> <br />
Info/Instructions: <br />
<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 /> <br /> <br />Note: The above lines can differ a bit depending on the exact version you have. <br />But it should always be <br />$Body = preg_replace("a combination of /n and /r ","<br />",$Body); <br />$PrintBody = preg_replace("a combination of /n and /r ","<br />",$PrintBody); <br /> <br />The replace code is always as in the directions. <br /> <br />
Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /> <br />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.