MyBB Community Forums

Full Version: Max characters in last post thread title/last post info?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello! A friend and I are attempting to use the code listed here to lower the character amount in the last post information - only, it isn't working, and we can't figure it out. We're both running the latest version of mybb. Is there any way possible to do a core edit (or anything, really!) to lower the amount of characters in the last post information? The forum I'm trying to do this on is http://ashen-rpg.com. I imagine that's all the information I need to give, but if anyone needs anymore, let me know.
I don't think that will work - it's for the entirety of the forum, and we're just needing it to affect the "lastpost" on the forum index. :c Basically I need it to shorten the number of max characters to a certain number, rather than make it a minimum amount.
Hmm can you post an example? I'm kind of lost.

Do you mean like:

The quick Lazy brown fox was slow?

Into: The Quick Lazy... ?
if (($script == 'editpost.php' && $lastpost) || $script == 'newreply.php' && $lastpost) {
if ($msgcount => 200) {
            $post->set_error('Your message must not contain more than "200" characters');
        }
}
(2014-05-26, 04:34 PM)Ace700 Wrote: [ -> ]Hmm can you post an example? I'm kind of lost.

Do you mean like:

The quick Lazy brown fox was slow?

Into: The Quick Lazy... ?

Exactly! I don't want to limit the actual thread title characters at all, just how they show up on the index ONLY.
You want to show less characters in this column????
(2014-05-26, 06:16 PM)marcus123 Wrote: [ -> ]You want to show less characters in this column????

Yes! I'm wanting to just cut off the number of characters in that particular area, like from "this is a testing thread" to something like "this is a tes..." or something like that. Basically I'm wanting to shorten it up without actually limiting the number of characters you can enter in the title field.
Well I need to know stuff like is that last user post message? If so then use this code:

if(strlen($posts['message']) > "120")
		{
			$postmessage = htmlspecialchars_uni(my_substr($posts['message'],0,120)."...");
		}
		else
		{
			$postmessage = htmlspecialchars_uni($posts['message']);
		}

Add this to your query: p.message AS postmessage
Find in your code similar code: while($posts = $db->fetch_array($query)) and then replace $posts in the code above with yours Smile
Marcus code will work Smile just fine then.

It checks the string if its longer then: 120 it will add ...

if(strlen($posts['message']) > "Your size here in number")
        {
            $postmessage = htmlspecialchars_uni(my_substr($posts['message'],0,Same thing as Your size here in number same value.)."...");
        }
Pages: 1 2