WildcardSearch / Advanced-Sidebox

A plugin for MyBB forums that displays custom boxes on various forum pages.
GNU General Public License v3.0
20 stars 10 forks source link

Random quote linebreak #62

Closed Destroy666x closed 11 years ago

Destroy666x commented 11 years ago

There is a possibility that the query will get a post like:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa

It stretches the whole sidebar then. What about checking for xx amount of chars (depending on width) and breaking the line if a word is longer than that?

WildcardSearch commented 11 years ago

Yes that seems to happen from time to time. As I am getting the post as a string, I am not certain the best way of fixing this (short of some kind of word-by-word break-down) . . .

Thanks for the report. I will look into it.

Destroy666x commented 11 years ago

While trying to do function with explode and so on an easier non-PHP solution came to my mind.

In adv_sidebox_classes: Change:

<table style="word-wrap:break-word;" border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder ' . $this->box_type . '_main_' . $this->id . '">

To:

<table style="table-layout:fixed; word-wrap:break-word;" border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder ' . $this->box_type . '_main_' . $this->id . '">

It will keep the sidebar always the width specified in settings, also cells in it if they have width/height attribute. Without fixed table layout word-wrap is kinda useless there.

WildcardSearch commented 11 years ago

Okay I will give that a try.

Thanks so much for your help :smile:

WildcardSearch commented 11 years ago

Done thanks.