• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 17:11
CET 23:11
KST 07:11
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Winners10Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
StarCraft, SC2, HotS, WC3, Returning to Blizzcon!41$5,000+ WardiTV 2025 Championship6[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win10
StarCraft 2
General
StarCraft, SC2, HotS, WC3, Returning to Blizzcon! Mech is the composition that needs teleportation t TL.net Map Contest #21: Winners Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win RotterdaM "Serral is the GOAT, and it's not close"
Tourneys
Constellation Cup - Main Event - Stellar Fest $5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace
Brood War
General
BW General Discussion [ASL20] Ask the mapmakers — Drop your questions [BSL21] RO32 Group Stage BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review
Tourneys
[BSL21] RO32 Group A - Saturday 21:00 CET [ASL20] Grand Finals [Megathread] Daily Proleagues [BSL21] RO32 Group B - Sunday 21:00 CET
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Should offensive tower rushing be viable in RTS games? Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread Dating: How's your luck?
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
Formula 1 Discussion 2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Why we need SC3
Hildegard
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1049 users

Solutions! Forum Breaking (Mods Can Read 2)

Forum Index > Website Feedback
Post a Reply
Amarxist
Profile Blog Joined July 2008
United States371 Posts
January 16 2009 23:02 GMT
#1
Salutations, I didn't know how else to get this to accross to the appropiate parties so I just made a new thread in this here general forums's. I've been a lurker at Team Fluid for a while now and there's been one nagging issue that seems to strike me (as a Web Design & Developer) often. It is a innocent mishap, im sure, that occurs in the heat of the moment or just plain ignorance. To me, it's like a voice that continually makes noise over everyone elses conversa----shut up Henry i'm trying to read!

I imagine a forum chat progressing like this:

ForumBreakingThug: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Poster #-1: Please stop.
ForumBreakingThug: AAAAAAAAAAAAAAAAAAAAAAAAAAA
Poster: JAEDONG, BRO. THAT GUY IS THE BROEST BROCRAFT PLAYER, EVER, BRO.
ForumBreakingThug: AAAAAAAAAAAAAAAAAAA
Poster #2: YEAH BRO.
ForumBreakingThug: AAAAAAAAAAAAAAAAAAA
Poster #3: God damnit stop breaking the forum.
ForumBreakingThug: AAAAAAAAAAAAAAAAAAA

I have even seen moderators telling people to not break the forum before, even going to the length of editing their posts. It's outrageous, and i'm in full agreeance with them. It is damn annoying to see.

So i've come here to throw some lemons at the Administrators of Team Liquid and offer some quick and easy solutions to preventing this mishap from ever transpiring again. Note: I'm a web developer & designer so i've dealt with this issue a lot of times on websites that have very constrained designs being ruined by user generated content. The dreaded overly long text string. Take your finger off that key.

Solution Numero Uno - CSS Overflow: Auto;

I recommend this one so i'm putting it first. First means best. This has very simple application, the only thing you need to do is alter the template to include a div layer (with this CSS class) inside that table (inside the table of the tables table--table) where the content of the posts reside. You know, so it wraps the users posts. I'm attaching a screenshot to illustrate the results of before & after.

THE CSS CLASS INVOVLED
Some may notice that some of these overflow options are IE only, yeah that's cause the problem of the vertical scrollbar showing no matter what only exists in IE. Go IE!

+ Show Spoiler +
.overFat
{
overflow: auto; overflow-x:auto; overflow-y:hidden; width: 591px; padding-bottom: 10px;
}


Note: The width, including padding, inside the post frame is exactly 591 pixels wide. So I added that to the class.

Broken:

[image loading]


Fixed:

[image loading]


Pros:
* The forum won't turn into a visual train wreck.
* Only places a scroll bar in the posts that attempt to hurt our precious uniform layout.
* Vertically expands the table & div layer with the users content without adding a vertical scroll bar.
* Does not add a horizontal scroll bar if there is content that has a proper amount of spaces in between characters (words). This only deals with the issue of people holding down one key on the keyboard and creating a 100 character string that pushes out the table and thus the design of the site.

Cons: It's not as an elegant solution in terms of aesthetics, but it'll at least it'll make offenders visually obvious so we can stone them to death.+ Show Spoiler +
why did you click here?


Solution Two -- Server Side (PHP)

Also another very easy thing to apply. Run a function when you print out the users posts and BAM. Wrapping thems long strings of characters into social conformity with the rest of the posts.

PHP CODE

+ Show Spoiler +
function _wordWrap($text) {
$split = explode(" ", $text);
foreach($split as $key=>$value) {
if (strlen($value) > 10) {
$split[$key] = chunk_split($value, 5, "​");
}
}
return implode(" ", $split);
}


To summarize what this accomplishes, all it does is reads a users post for a word longer then 10 characters. If it exceeds 10 characters then it adds a UNICODE character called zero-width space every 5 characters. This unicode character is used to control line breaks most of the time--forcing the browser to recognize a row of 97 consecutive A's(hole) as a word with only 5 letters thus wrapping it properly. But all this without showing that there's spaces in between the string (hence the name zero-width space).

Pros:
* It's transparent, wrapping done on the server-side so the user never is aware of what's going on. The malicious jerks who hold down their keys will probably ban themselves after no longer being able to break the forums.
* Gets the job done.

Cons:
* It's server-side. It adds additional load to the server where it's probably unnecessary, unlike the first option where it's handled on the users end.
* The unicode carries over in copy & pastes. So if there's perhaps a very long link, copying and pasting the link would also carry the unicodes as well. That's not gonna work in a browser!

Last Solution -- I don't like this `1`.

By this point, there's a good chance that I don't like many of you and you don't like me, but i'm still looking out for you guys. This last one is basically a javascript solution. It breaks up the overly long string into smaller chunks and attemtps to wrap them into a defined size. It works aight, but it also lags when there's lots of text to apply this function too. Why the hell am I even posting this solution again? Ah right, I don't like many of you so maybe i'm hoping they'll use it. Pay with lag, you jerks.

JAVASCRIPT

+ Show Spoiler +
function wrapText(text,lengthInPixels,splitter){

try{
if(!text){throw('arg1');}

var result = '';
var line = '';
var parentDiv = document.createElement('div');
var contentDiv = document.createElement('div');

if(!lengthInPixels){lengthInPixels=100;}
if(!splitter){splitter=' ';}

parentDiv.style.width = '0px';
parentDiv.style.height = '0px';
parentDiv.style.overflow = 'hidden';
parentDiv.appendChild(contentDiv);
document.body.appendChild(parentDiv);

for(var i=0; i<text.length; i++){
contentDiv.innerHTML += text.charAt(i);
if(parentDiv.scrollWidth < lengthInPixels){
line += text.charAt(i);
}else{
result += line+splitter;
contentDiv.innerHTML = '';
line = '';
}
}

if(line.length>0){result += line;}
return result;

}
catch(ex){
if(ex=='arg1'){
alert('wrapText: Argument 1 is mandatory.');
return text;
}else{
throw('Unexpected error: '+ex.toString());
}
}
}


Pros: The forum don't break.

Cons: Did you imbeciles really make it this far down the post about this nonsensical crap? Go find another, more interesting, thread.

That concludes this whacky uninformative post. I don't know if it'll be used in any other way other then as a measuring stick of how much you may not like me. But if it is used, glad I could help. TAKE YOUR FINGER OFF THAT KEY. + Show Spoiler +
really did you click here again?
☺ ☻
IzzyCraft
Profile Blog Joined June 2007
United States4487 Posts
Last Edited: 2009-01-16 23:07:32
January 16 2009 23:06 GMT
#2
I had porblems with imanges and text streching the box but i just put it into quirks mode and it rezies and forces it into the box ionno why or really care. If i really cared i would have used IE8 dev tools to forcefully change parts of the website similar to a plug in only easier to do.
I have ass for brains so,
even when I shit I'm droping knowledge.
CDRdude
Profile Blog Joined May 2007
United States5625 Posts
January 16 2009 23:09 GMT
#3
This is a great post, but we have a website feedback section for this.
Force staff is the best item in the game.
Carnac
Profile Blog Joined December 2003
Germany / USA16648 Posts
Last Edited: 2009-01-16 23:11:02
January 16 2009 23:10 GMT
#4
moving to website feedback
ModeratorHi! I'm a .signature *virus*! Copy me into your ~/.signature to help me spread!
Amarxist
Profile Blog Joined July 2008
United States371 Posts
January 16 2009 23:15 GMT
#5
Thanks for the move.
☺ ☻
overpool
Profile Joined April 2008
United States191 Posts
January 16 2009 23:26 GMT
#6
Yes, I don't know why nobody is using CSS to hide the overflow when it breaks the layout. I made a thread about this a while ago.

In addition, you should probably post this in "Website Feedback" instead of general.
yay i love tl events
Badjas
Profile Blog Joined October 2008
Netherlands2038 Posts
January 16 2009 23:47 GMT
#7
Nice bundle of solutions, I learned from it as well. thanks. And I lol'd for real on those spoilers and not just because I got a tiredness high
I <3 the internet, I <3 you
SoMuchBetter
Profile Blog Joined April 2003
Australia10606 Posts
January 17 2009 00:29 GMT
#8
* The unicode carries over in copy & pastes. So if there's perhaps a very long link, copying and pasting the link would also carry the unicodes as well. That's not gonna work in a browser!

long links are truncated already so this is a nonissue.
AUSSIESCUM
TeamLiquid eSTROgeneral #1 • RIP
onepost
Profile Joined April 2008
Canada297 Posts
January 17 2009 03:13 GMT
#9
Even more simple: Make thread and posts part of the same table? This way if the thread overflows, the posts' own width will match...? In other words, instead of making the thread part shorter, we make the posts wider.
There are three types of lies: statistics, studies, and benchmarks.
Bockit
Profile Blog Joined November 2004
Sydney2287 Posts
Last Edited: 2009-01-17 03:44:05
January 17 2009 03:43 GMT
#10
On January 17 2009 12:13 onepost wrote:
Even more simple: Make thread and posts part of the same table? This way if the thread overflows, the posts' own width will match...? In other words, instead of making the thread part shorter, we make the posts wider.

The issue is that we don't want the posts to be wider at all.

I like the css option myself.
Their are four errors in this sentance.
onepost
Profile Joined April 2008
Canada297 Posts
January 17 2009 03:45 GMT
#11
On January 17 2009 12:43 Bockit wrote:
Show nested quote +
On January 17 2009 12:13 onepost wrote:
Even more simple: Make thread and posts part of the same table? This way if the thread overflows, the posts' own width will match...? In other words, instead of making the thread part shorter, we make the posts wider.

The issue is that we don't want the posts to be wider at all.

I like the css option myself.

Let it be css then.
There are three types of lies: statistics, studies, and benchmarks.
Bockit
Profile Blog Joined November 2004
Sydney2287 Posts
January 17 2009 03:53 GMT
#12
Heh it's not just up to me, but it's been passed on.
Their are four errors in this sentance.
Please log in or register to reply.
Live Events Refresh
BSL 21
20:00
ProLeague - RO32 Group A
Gosudark vs Kyrie
Gypsy vs OyAji
UltrA vs Radley
Dandy vs Ptak
ZZZero.O209
LiquipediaDiscussion
LAN Event
18:00
Stellar Fest: Day 2
Zoun vs ScarlettLIVE!
Clem vs TriGGeR
ComeBackTV 928
UrsaTVCanada801
IndyStarCraft 312
EnkiAlexander 60
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 312
White-Ra 222
Nathanias 105
Railgan 60
elazer 49
Nina 7
ForJumy 4
StarCraft: Brood War
Sea 1309
ZZZero.O 209
Dota 2
febbydoto12
LuMiX1
League of Legends
KnowMe77
Heroes of the Storm
Liquid`Hasu419
Khaldor213
Other Games
Grubby4410
Beastyqt743
FrodaN391
Mlord369
Pyrionflax250
Fuzer 198
ToD131
mouzStarbuck121
ArmadaUGS82
goatrope67
Organizations
Other Games
gamesdonequick875
Counter-Strike
PGL110
Other Games
angryscii17
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• musti20045 32
• Kozan
• LaughNgamezSOOP
• AfreecaTV YouTube
• sooper7s
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• 3DClanTV 26
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2769
• masondota2582
• Ler91
League of Legends
• imaqtpie3087
Other Games
• Scarra575
Upcoming Events
Replay Cast
49m
Sparkling Tuna Cup
11h 49m
WardiTV Korean Royale
13h 49m
LAN Event
16h 49m
IPSL
19h 49m
JDConan vs WIZARD
WolFix vs Cross
BSL 21
21h 49m
spx vs rasowy
HBO vs KameZerg
Cross vs Razz
dxtr13 vs ZZZero
Replay Cast
1d 10h
Wardi Open
1d 13h
WardiTV Korean Royale
2 days
Replay Cast
3 days
[ Show More ]
Kung Fu Cup
3 days
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
4 days
The PondCast
4 days
RSL Revival
4 days
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
4 days
WardiTV Korean Royale
4 days
RSL Revival
5 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
5 days
CranKy Ducklings
6 days
RSL Revival
6 days
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
6 days
BSL 21
6 days
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Liquipedia Results

Completed

BSL 21 Points
SC4ALL: StarCraft II
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
Stellar Fest: Constellation Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.