MyBB Community Forums

Full Version: Last Post Max Displayed Characters in Title
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
A simple setting is my second suggestion.

This option is from a rival sw, but is so needed as an option in settings.

I remember once editing some file to achieve it, but upgrading from 1.6.7 to 1.6.8 replaced the file I had edited.



Wow, I found out the question was posed 4 years ago: Big Grin

Last post - increase/decrease subject length (default: 25 char)
Hah, back in my days of being a support team member!

I'm not sure what the best method is of going about this. I'd rather leave new settings to be able to manipulate multiple areas and not just a one area of the forum. I wonder if we can use the config file for more than it is? For example, if you wanted to manually set this option longer (or shorter), you would add the following to ./inc/config.php:

$config['settings']['lastpost_cutoff'] = 50;

The forumlist generator would then check for this setting and use it if it exists. This would of course stay the same during an upgrade as the config file doesn't change.

The alternative is of course using the same system without settings; you just need to manually add the setting itself instead of coming with the software.

Hmm. Ideas.
(2012-06-22, 08:01 AM)Tomm M Wrote: [ -> ]Hah, back in my days of being a support team member!

I'm not sure what the best method is of going about this. I'd rather leave new settings to be able to manipulate multiple areas and not just a one area of the forum. I wonder if we can use the config file for more than it is? For example, if you wanted to manually set this option longer (or shorter), you would add the following to ./inc/config.php:

$config['settings']['lastpost_cutoff'] = 50;

You mean, if we add this line as of now, it will do the trick? It will save some hassle!

BTW, what's the method they use in vb, in other words how do they make it a setting in the Admin CP panel? does it make the software heavier to load?
I have absolutely no idea how vB works. It doesn't work now but we can make it so that if people want it they just need to make a setting (with the correct name). This would prevent clogging up the ACP settings (which I already think need splitting up a bit more) with something that does so little.
I see. Is it easy for a "commoner" to add his own customized ACP settings? Or does it involve too many modifications?
ACP - Configuration - Add Setting.

Easy. I'm sure if we have a list if instructions or settings users can add it will be simple to follow. We could do this for other areas too.
Magnificent! This has potential.

As an example, how can we link these:

if(my_strlen($lastpost_subject) > 25)

$lastpost_subject = my_substr($lastpost_subject, 0, 25)."...";

from the said ./inc/functions_forumlist.php file directly into a new setting?
$cutoff = 25;
if(isset($mybb->settings['lastpostcutoff']))
{
     $cutoff = intval($mybb->settings['lastpostcutoff']);
}

if(my_strlen($lastpost_subject) > $cutoff)
{
     $lastpost_subject = my_substr($lastpost_subject, 0, $cutoff).'...';
}

Or something to that effect. As there wouldn't be a lastpostcutoff setting forums would use the already used 25 characters. If a user were to add their own setting with this name, it would use that. I guess we would need a list of these somewhere if we were to use this system.
I'm trying to make head and tail of that.

What would exactly be needed for that code to work?

And where is it inserted?
All you need to do (which is what Tom's done) is replace 25 with '$cutoff' and then then define the cutoff by using this anywhere before the other code: '$cutoff = 25;'
Pages: 1 2