Shinyshell Community Forums > Coding >
nl2br -- FusionNews


[1]


August 08 02009, 19:21 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

I really don't like XHTML. I prefer HTML Strict. So what I wish to do is change my FusionNews installation from <br /> to <br>. I don't know how. Can I just just str_replace()?

August 09 02009, 07:42 GMT
Nick^
merciful justice

Nick's avatar
Location: Brisbane, Australia
Post count: 78
au
Why does it matter?

As far I'm concerned, there is little difference in function. Besides, <br /> is closing the <br> tag you opened, which is following the rules of HTML. Plus, it looks better.
______________________________
Lazurane

August 09 02009, 20:49 GMT
lec**
Supra stultitiam

lec's avatar
Location: Varaždin, Croatia
Post count: 173
hr
Indeed, I don't know why you'd care so much. Besides, XHTML is a lot neater-looking, but...

nl2br() has been printing XHTML-compatible strings since early PHP 4. It has two parameters. The first is the text to process, and the second is a boolean value that determines whether to use <br /> or <br>. True is the default value, which prints "<br />". Call nl2br as

<?php 
echo nl2br("string\n", false);
?>
<?php
echo nl2br("string\n", false);
?>
]]>


to make it non-XHTML. Assuming you can't find where it does nl2br(), your idea would probably work. Unfortunately, I don't know anything about the code organisation of FusionNews, so I can't tell you where to put the str_replace(). You'll need to find out where it prints the page out.

August 10 02009, 01:02 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

Oh I see.

Well there's no point in using XHTML if I'm not going to take advantage of its potential.

August 10 02009, 01:22 GMT
lec**
Supra stultitiam

lec's avatar
Location: Varaždin, Croatia
Post count: 173
hr
Rubbish, I don't know where the sudden influx of people switching to HTML is coming from because they don't "take advantage of XHTML's potential", but rest assured there are several benefits to using XHTML, including closing every tag, which makes the data contained therein easier to extract and work with.

HTML is a description of the structure of a web page, XHTML is better-formed HTML. It's a sharpened, more modern, more sophisticated version of HTML.

HTML seems to promote the practice of leaving tags open, it seems to tempt the coder into creating messy, hacky code. XHTML on the other hand promotes tidiness. That alone is reason enough for me to use XHTML over HTML.

August 10 02009, 16:24 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

...

*switches to xhtml*


[1]



Forum Information
  Currently Active Members [detailed] (0 members and ? guests)
-
Forum Statistics
Topics: 0, Posts: 0, Members: 108.
Welcome to our newest member, adamthephantump
Most members online was 5, on August 28 2009, at 21:49:28.
Legend
    Forums with unread topics in them are indicated by a strong yellow colouring around the forum icon.
    Forums with no unread topics have the standard pale yellow colouring around the forum icon.
    Forums with a blue arrow icon will redirect you to a non-forum page.
    Locked forums have a little padlock by their icon. You won't be able to post in these forums.
Shinyshell Home | Contact | Staff List | Archive | Top 

Conventional Login

Don't have an account? You may want to create one.

OpenID Login
OpenID login and registration is usable, but not finished.
What is OpenID?
Search

(advanced search)
Site Stats
  Total members: 108
  Latest member: adamthephantump
  Members currently online: 0
  Most online: 5 - Aug 28, 2009 (21:49)
  Front page hits: 88119
Developer info
  Site version: 3.5 Alpha
  16 queries - 9 templates
Under the Spotlight
Collide Site
Collide make fabulously dreamy electronic-industrial music, they're one of my favourite bands! Give them a chance to take control of your life - myspace | youtube - "Euphoria".

Collide Site - Hits: 4926

5/5 (2) | Rate this site?