Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - inverted commas shown as &quote in last post column

Reply to topic
Author Message
  • Joined: 01 Feb 2004
  • Posts: 1464
  • Location: Sunny ol Tamworth, New England NSW AU
Reply with quote
inverted commas shown as &quote in last post column
Post Posted: Tue Apr 01, 2008 1:23 pm
Hey Maxim and/or Bock,

I was looking at the main page of the forum and noticed that when a topic has "inverted" commas it appears as &quote on the link in the Latest Post column, yet in the hover text on the link it appears correctly..

I don't know if this is a bug or the way in which the forum works. I have a screenshot attached so you can see what I mean.

Thanks
Scott
&quote prblem.png (3.85 KB)
&quote instead of "
&quote prblem.png

  View user's profile Send private message Visit poster's website
  • Joined: 12 Apr 2005
  • Posts: 391
  • Location: London, United Kingdom
Reply with quote
Post Posted: Tue Apr 01, 2008 1:33 pm
Interestingly, IE8, Opera 9 and Safari 3 all render &quot (without the semicolon) as ".
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14685
  • Location: London
Reply with quote
Post Posted: Tue Apr 01, 2008 2:34 pm
Strings are stored in the DB with certain characters stored as "HTML entities" like &quote; for various reasons. For display there we have to trim titles because long titles can have bad effects on the page layout. Thus you can get the title trimmed in the middle of an entity and it looks odd. There's not much we can do about it without substantially affecting the forum layout. I do have a prototype forum template where it's better (and a lot of other things are improved) but it's not ready for use yet.
  View user's profile Send private message Visit poster's website
  • Joined: 12 Apr 2005
  • Posts: 391
  • Location: London, United Kingdom
Reply with quote
Post Posted: Tue Apr 01, 2008 2:47 pm
Is the trimming done on the DB or in PHP?

If in PHP, you could replace substr($string, 0, $length) (or equivalent) with:

htmlspecialchars(substr(html_entity_decode($string, ENT_QUOTES), 0, $length), ENT_QUOTES);
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14685
  • Location: London
Reply with quote
Post Posted: Tue Apr 01, 2008 3:27 pm
Done. Thanks, benryves!
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!