Previous Thread
Next Thread
Print Thread
Rating: 5
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
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:
Code
 <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.

Sponsored Links
Entire Thread
Subject Posted By Posted
Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Anno 01/26/2005 3:44 PM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Astaran 01/27/2005 2:33 PM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Anno 01/29/2005 3:21 PM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Pasqualist 01/30/2005 8:50 PM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Zarzal 01/30/2005 9:59 PM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Anno 01/31/2005 3:14 PM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled ZealotOnAStick_dup1 02/16/2005 9:01 PM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Anno 02/17/2005 9:58 AM
Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Snowbe 05/20/2005 2:56 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
hatter
hatter
USA
Posts: 69
Joined: January 2001
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
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)