[4919] personal text bug on smf 2.0.2[help][moved]

Started by fullmoonya, January 02, 2012, 08:26:51 PM

Previous topic - Next topic

fullmoonya

hello to all. i dont know if this topic existed here but i cant find any thread related to my problem. as you can see, i have problem on personal text of forum profile of the smf i installed. it overlaps to the message i just post. i will put the image to the attachments.
do not mark my topic solve unless it is REALLY SOLVED.
my forum

Visit My Blog:
Google SEO Share

fullmoonya

does everyone know how to fix this? please respond to my question. how can i solve this problem.
do not mark my topic solve unless it is REALLY SOLVED.
my forum

Visit My Blog:
Google SEO Share

TheListener

Please do not bump topics within 24 hours.

The topic will be answered when and if the answer is known.


fullmoonya

#3
okay sir. sorry for the bump. here's another question of mine. where can i find the variable that specifies the string length of my personal text? may be thats the problem why the personal text of my forum profile overlaps to the message i post.
do not mark my topic solve unless it is REALLY SOLVED.
my forum

Visit My Blog:
Google SEO Share

Antechinus

For a quick and dirty fix, in index.css change this:

.poster
{
float: left;
width: 15em;
}


to this:

.poster
{
float: left;
width: 15em;
        overflow: hidden;
}


The problem is caused by the string of letters being without a break. If it was composed of shorter words (as it usually is) then it would stack to more than one line.

fullmoonya

#5
Quote from: Antechinus on January 03, 2012, 01:45:11 AM
For a quick and dirty fix, in index.css change this:

.poster
{
float: left;
width: 15em;
}


to this:

.poster
{
float: left;
width: 15em;
        overflow: hidden;
}


The problem is caused by the string of letters being without a break. If it was composed of shorter words (as it usually is) then it would stack to more than one line.

thank you so much for the help sir. i'll try it out. :)

edit:
it works! thank you very much for this code sir antechinus. :)
do not mark my topic solve unless it is REALLY SOLVED.
my forum

Visit My Blog:
Google SEO Share

Joker™

Ant do you recommend this as to be tracked as a bug?

P.S - This happens with the user name too, and in one topic I purposed a fix too.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

emanuele

#7
Another solution would be to break the lines like with the posts.
In Load.php:
Code (find) Select
// What a monstrous array...
$memberContext[$user] = array(
'username' => $profile['member_name'],
'name' => $profile['real_name'],
'id' => $profile['id_member'],
'is_buddy' => $profile['buddy'],
'is_reverse_buddy' => in_array($user_info['id'], $buddy_list),
'buddies' => $buddy_list,
'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '',
'href' => $scripturl . '?action=profile;u=' . $profile['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',


Code (replace with) Select
if ($context['browser']['is_gecko'] || $context['browser']['is_konqueror'])
$breaker = '<span style="margin: 0 -0.5ex 0 0;"> </span>';
// Opera...
elseif ($context['browser']['is_opera'])
$breaker = '<span style="margin: 0 -0.65ex 0 -1px;"> </span>';
// Internet Explorer...
else
$breaker = '<span style="width: 0; margin: 0 -0.6ex 0 -1px;"> </span>';
$fixLongWords = 16;

$profile['fix_real_name'] = $profile['real_name'];
foreach (array('member_name', 'fix_real_name', 'personal_text') as $text)
// The idea is, find words xx long, and then replace them with xx + space + more.
if ($smcFunc['strlen']($profile[$text]) > $fixLongWords)
{
// This is done in a roundabout way because $breaker has "long words" :P.
$profile[$text] = strtr($profile[$text], array($breaker => '< >', '&nbsp;' => $context['utf8'] ? "\xC2\xA0" : "\xA0"));
$profile[$text] = preg_replace(
'~(?<=[>;:!? ' . $non_breaking_space . '\]()]|^)([\w' . ($context['utf8'] ? '\pL' : '') . '\.]{' . $fixLongWords . ',})~e' . ($context['utf8'] ? 'u' : ''),
'preg_replace(\'/(.{' . ($fixLongWords - 1) . '})/' . ($context['utf8'] ? 'u' : '') . '\', \'\\$1< >\', \'$1\')',
$profile[$text]);
$profile[$text] = strtr($profile[$text], array('< >' => $breaker, $context['utf8'] ? "\xC2\xA0" : "\xA0" => '&nbsp;'));
}

// What a monstrous array...
$memberContext[$user] = array(
'username' => $profile['member_name'],
'name' => $profile['real_name'],
'id' => $profile['id_member'],
'is_buddy' => $profile['buddy'],
'is_reverse_buddy' => in_array($user_info['id'], $buddy_list),
'buddies' => $buddy_list,
'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '',
'href' => $scripturl . '?action=profile;u=' . $profile['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['fix_real_name'] . '</a>',


But I don't know if the problem is worth the code and the processor time... :P


ETA: fullmoonya would you shorten your personal text? ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Joker™

emanuele, take a look at this post too it might come handy.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

emanuele

Yep, reduce the size could be a solution, but if the display name is 60 chars long (limit of the input box in the profile page) you have to reduce *a lot* the size to let it fit in! :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Antechinus

Quote from: Joker™ on January 03, 2012, 05:14:40 AM
Ant do you recommend this as to be tracked as a bug?

P.S - This happens with the user name too, and in one topic I purposed a fix too.

Quote from: emanuele on January 03, 2012, 07:54:52 AM
Another solution would be to break the lines like with the posts.
In Load.php:

<lotsa code>

But I don't know if the problem is worth the code and the processor time... :P


ETA: fullmoonya would you shorten your personal text? ;)

Really, we probably should track it. I like the basic css fix myself (already use it anyway) and it's certainly quick and easy on teh pooters. We could go for the bells and whistles approach though. Bit of a swings and roundabouts thing. On the one hand we get partially hidden content. On the other, we get borked up words split at inconvenient points. Meh.

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

vainglory

I had the same problem when I updated from 1.1.18 to 2.0.5, but emanuele's php fix worked for me.

Thanks.

vainglory

Although, I am now getting an error in Load.php
8: Undefined variable: non_breaking_space
Line: 1146

I assume it is:
'~(?<=[>;:!? ' . $non_breaking_space . '\]()]|^)([\w' . ($context['utf8'] ? '\pL' : '') . '\.]{' . $fixLongWords . ',})~e' . ($context['utf8'] ? 'u' : ''),

Advertisement: