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

   Finished-[6.4-6.5] Omit adding break tags when HTML is enabled to Del.icio.us Add to del.icio.us
  Digg Finished-[6.4-6.5] Omit adding break tags when HTML is enabled Digg it
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 (), 35 Guests and 5 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by AllenAyres
10/07/08 02:05 PM
What do you use to edit the files
by Ian_W
10/05/08 03:33 PM
BeyondCompare v3.00
by Ian_W
10/05/08 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
10/05/08 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
pisa666, ghengis317, NitroX, Dogan, EliYah-
13345 Registered Users
Top Posters Last 30 Days
AllenAyres 12
blaaskaak 8
tackaberry 7
FREAK1 6
Gizmo 4
Mike L_dup1 4
Chris Bale 4

 

 

 
fusionbb message board php hacks