php forum
php mysql forum
php mysql smarty
 
Topic Options
#283259 - 01/26/05 07:44 AM Finished-[6.4-6.5] Omit adding break tags when HTML is enabled
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
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 />
Code:
 <br />In addpost.php <br /> <br />search for: <br /> <br />	$PrintBody = preg_replace("/(\r\n|\r|\n)/i","&lt;br /&gt;",$PrintBody); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br />	$PrintBody = preg_replace("/(\r\n|\r|\n)/i","&lt;br /&gt;",$PrintBody); <br />} <br /> <br />search for: <br /> <br />	$Body = preg_replace("/(\r\n|\r|\n)/i","&lt;br /&gt;",$Body); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br />	$Body = preg_replace("/(\r\n|\r|\n)/i","&lt;br /&gt;",$Body); <br />} <br /> <br /> <br />in modifypost.php <br /> <br />search for: <br /> <br />	$PrintBody = str_replace("\n","&lt;br /&gt;",$PrintBody); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br />	$PrintBody = preg_replace("/(\r\n|\r|\n)/i","&lt;br /&gt;",$PrintBody); <br />} <br /> <br />search for: <br /> <br />	$Body = preg_replace("/(\r\n|\r|\n)/i","&lt;br /&gt;",$Body); <br /> <br />replace with: <br /> <br />if ($convert != "html"){ <br />	$Body = preg_replace("/(\r\n|\r|\n)/i","&lt;br /&gt;",$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.

Top
#283260 - 01/27/05 06:33 AM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: domain123]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Indead, very useful.<br />Thx!
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#283261 - 01/29/05 07:21 AM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: -Fusion-]
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
Another clarification: these parts of the code seem to be very inconsistent over the different versions of the boards.<br /><br />Some versions have only <br /><br />$Body = preg_replace("/\n/i","<br />",$Body);<br /><br />some do it twice for the same variable....<br /><br />Your best bet to find all occurances of the break tag substitution is to search for<br /><br />"<br />" <br /><br />(including the quotes) in connection with the $Body, $Body_q and the $PrintBody variables.

Top
#283262 - 01/30/05 12:50 PM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: domain123]
Pasqualist Offline
Member

Registered: 01/30/03
Posts: 285
Loc: Amsterdam, The Netherlands
If this is such a usefull "non-spectacular modification", then why did infopop never modify their code? Are their any 'dangers'/disadvantages by changing the code as desribed? <br /><br />For me posting HTML in threads is always a pain in the ..s! I'm very glad with this mod and will test it out later tonight. Thanks! <img src="http://www.ubbdev.com/forum/images/graemlins/laugh.gif" alt="" />

Top
#283263 - 01/30/05 01:59 PM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: 10k]
Zarzal Offline
Coder

Registered: 07/03/01
Posts: 806
Loc: Berlin, Germany
This works well. Modifypost need another enhancement. While editing a HTML enabled posting UBBt convert some code. Example: I use
Code:
&amp;euro;
and edit the post. The editor now show me the euro char &#8364;. Then I submit it and now the posting shows me
Code:
&amp;#8364;
instead the euro char.
_________________________
my forum: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de

Top
#283264 - 01/31/05 07:14 AM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: 10k]
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
>If this is such a usefull "non-spectacular modification", then why did infopop <br />>never modify their code?<br /><br />I have no idea. Laziness? <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />>Are their any 'dangers'/disadvantages by changing the code as desribed? <br /><br />No.

Top
#283265 - 02/16/05 01:01 PM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: domain123]
ZealotOnAStick_dup1 Offline
Member

Registered: 06/14/02
Posts: 166
Loc: Indiana
This seems to be included in the 6.5.1 stock files. I went to apply this mod, but from what I could tell, it was already in place.

Top
#283266 - 02/17/05 01:58 AM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: astre]
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
Yes.

Top
#283267 - 05/20/05 07:56 AM Re: Finished-[6.4-6.5] Omit adding break tags when HTML is enabled [Re: domain123]
Snowbe Offline
Lurker

Registered: 05/20/05
Posts: 1
Tnx, Anno!!<br /><br />[:"#DFE6EF"]video strip poker[/]

Top


Moderator:  Ian_W 
Who's Online
0 registered (), 31 Guests and 16 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Forum 'Trader Ratings'.
by blaaskaak
11/20/08 08:27 AM
Problems reading a lot of old posts here
by Ruben Rocha
11/18/08 04:33 PM
PhotoPost BB Code Popup
by Iann128
11/15/08 01:24 PM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
Active Topics.
by AllenAyres
11/11/08 02:13 PM
Looking for a simple upload script
by AllenAyres
11/11/08 02:12 PM
New Mods
Forum 'Trader Ratings'.
by McLemore
11/19/08 02:14 PM
[7.4] Keep log of custom title changes
by blaaskaak
10/27/08 07:51 AM
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Newest Members
Begbie, cenk, MATTO, DougMMcts, tim Anderson
13361 Registered Users
Top Posters
AllenAyres 25448
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks