MyBB Community Forums

Full Version: Is this bug or what?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

the more someone types the wider the screen goes. i saw it in my forum and i see it can happen here too
And another thing with the signature. i set my signature as disabled but then it didnt turn to disable, so they only way to remove the signature was to delete the text
There is no feasible way to stop this from happening? I don't think setting worwrap or fixed to a table/div stops this?? You'd have to use iframes for something like this?
You could use JS to detect how big your scren size is and then get it to insert a space in the middle to make it split lines?
It could be a simple modification in the showthread.php. Whenever a post is displayed, a snippet can be made to detect any words more than 50 letters long, for example, and put a space between them.
That would be alot of coding for something small... I think Wink

Why not go in and edit it urself so you don't have the problem?
Toungue easy fix.
This is a quick fix to prevent

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

this from happening.

Go to your admin panel and under modify/delete templates expand the Post Bit Templates and open postbit. Place this at the top of the file

<script language="javascript" type="text/javascript">
<!--
var mxw_max = [b]100[/b];

function mxw(id)
{
 if (!document.getElementById) return;
 var n = document.getElementById(id);
 if (!n || !n.nodeType) return;
 mxw2(n);
}

function mxw2(n)
{
 if (n.nodeType == 3 /*Node.TEXT_NODE*/)
 {
   var flag = 0;
     var words = n.data.split(" ");
   for (var i = 0; i < words.length; i++)
   {
     if (words[i].length > mxw_max)
     {
       flag++;
       words[i] = words[i].substr(0, mxw_max-2) + "... "; 
     }
   }
   if (flag > 0) n.data = words.join(" ");
 }
 var children = n.childNodes;
 for (var i = 0; i < children.length; i++) mxw2(children[i]); 
}
//-->
</script>

then in the same file find

<p>$post[message]</p>

and change it to

<div id="shorten">
<p>$post[message]</p>
</div><script language="javascript" type="text/javascript">mxw("shorten");</script>

you can change the 100 to any number you like. What happens is when a word with 100 or more characters is entered without a space or break, the line is cut off and ... is added to the end.
we implemented this on this one chat I was moderating and it worked fine...expect when people posted URLs....these are frequently over 50 or even over 100 characters...this will mean they will get castrated as well and therefore will be rendered useless....

just something to keep in mind...
Works good. But is there any way instead of the ... to make the post to continue to the under line and so on ?
Konstantinos Wrote:Works good. But is there any way instead of the ... to make the post to continue to the under line and so on ?

Actually I noticed this doesn't work Sad It only works for the first post, then if someone replies and does the same thing, it stretches the forum Sad There is a way that does what you want though. It will force the text to wrap after a certain number of characters. The only problem I can think of is that it may be possible for a [ tag] to be cut off. Just go in your admin panel and open up New Thread, New Reply, Edit Post and showthread_quickreply. Find

wrap="virtual"

and change it to

wrap="hard"

[attachment=749]
[attachment=750]
Pages: 1 2