PinoStudio 1
MyBB 1.8.x Mod {$mybb->user['usertitle']} on Index Page - Printable Version

+- PinoStudio 1 (https://pinostudio1.com)
+-- Forum: Foros Varios Temas (https://pinostudio1.com/forum-10.html)
+--- Forum: MyBB 1.8.x Mods (https://pinostudio1.com/forum-11.html)
+--- Thread: MyBB 1.8.x Mod {$mybb->user['usertitle']} on Index Page (/thread-2155.html)



{$mybb->user['usertitle']} on Index Page - DiegoPino - 12-08-2020

Mod Page to test.


It would either need a plugin or a core file edit to do it. As a core edit:

In ./inc/class_session.php, line 317:

PHP Code:
if(!$mybb->user['usertitle'])
{
    
$mybb->user['usertitle'] = $mybb->usergroup['usertitle'];


After this, add:

PHP Code:
if(!$mybb->user['usertitle'])
{
    
$usertitles $cache->read('usertitles');

    if(
is_array($usertitles))
    {
        foreach(
$usertitles as $title)
        {
            if(
$mybb->user['postnum'] >= $title['posts'])
            {
                
$mybb->user['usertitle'] = $title['title'];

                break;
            }
        }
    }


Not tested but that should work. If you like, I can wrap that up in a small plugin for you.



Referencia:
https://community.mybb.com/thread-230506.html