MyBB Community Forums

Full Version: moderated by guest???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello my introduction section moderated by our Moderator 'Riya'.
but in forum index it says, it moderated by guest!!!
what is the problem???

[Image: 112964155f8aaf1968d7566819c5b1abb5365b1e.jpg]
Are you using Username style plugin ?
In ACP > Forums & Postings > Forum management. First check the Introduction category and look at the Moderators tab and see if the Guest usergroup was added there.
You might need to check the other forums as well the same way.
(2011-06-07, 12:01 PM)Yaldaram Wrote: [ -> ]Are you using Username style plugin ?

yes, I'm Using that plugin
Since many users are facing the issue that when they Install this plugin, then their Moderated By: "Some Username" becomes Moderated By: Guests

So here is how to resolve this issue;
Alright, Open plugin file and find;
function usernamestyle_build_forumbits_forum(&$forum)
{
    global $db, $mybb, $lang, $templates, $moderatorcache, $modlistsetting;
    
    // Moderator column is not off
    $mybb->settings['modlist'] = $modlistsetting;
    
    if($mybb->settings['modlist'] != 0)
    {
        $moderators = "";
        $donemoderators = array();
        $parentlist = explode(",", $forum['parentlist']);
        
        foreach($parentlist as $fid)
        {
            if(is_array($moderatorcache[$fid]))
            {
                foreach($moderatorcache[$fid] as $moderator)
                {
                    if(in_array($moderator['uid'], $donemoderators))
                    {
                        continue;
                    }
                    
                    $moderator['username'] = format_name($moderator['username'], $moderator['usergroup'], $moderator['displaygroup']);
                    $moderator['profilelink'] = build_profile_link($moderator['username'], $moderator['uid']);
                    
                    $moderators .= $comma;
                    $moderators .= $moderator['profilelink'];
                    
                    $comma = ", ";
                    
                    $donemoderators[] = $moderator['uid'];
                }
            }
        }
        
        $comma = "";
        
        if($moderators)
        {
            eval("\$forum['modlist'] = \"".$templates->get("forumbit_moderators")."\";");
        }
        else
        {
            $forum['modlist'] = "";
        }
    }
    
    // To avoid overwriting by original code segment
    $mybb->settings['modlist'] = 0;
    
    // Format lastposter name
    $query = $db->simple_select("users", "usergroup, displaygroup", "uid = '".$forum['lastposteruid']."'");
    $user = $db->fetch_array($query);
    
    $forum['lastposter'] = format_name($forum['lastposter'], $user['usergroup'], $user['displaygroup']);
} 

and Change it into the following;
function usernamestyle_build_forumbits_forum(&$forum)
{
    global $db, $mybb, $lang, $templates, $moderatorcache, $modlistsetting;
    
    // Moderator column is not off
    $mybb->settings['modlist'] = $modlistsetting;
    
    if($mybb->settings['modlist'] != 0)
    {
        $moderators = "";
        $done_moderators = array(
                    "users" => array(),
                    "groups" => array()
                );
        $parentlistexploded = explode(',', $forum['parentlist']);
        foreach($parentlistexploded as $mfid)
        {
            if(is_array($moderatorcache[$mfid]))
            {
                foreach($moderatorcache[$mfid] as $modtype)
                {
                    foreach($modtype as $moderator)
                    {
                        if($moderator['isgroup'])
                        {
                            if(in_array($moderator['id'], $done_moderators['groups']))
                            {
                                continue;
                            }
                            $moderators .= $comma.htmlspecialchars_uni($moderator['title']);
                            $done_moderators['groups'][] = $moderator['id'];
                        }
                        else
                        {
                            if(in_array($moderator['id'], $done_moderators['users']))
                            {
                                continue;
                            }
                            $moderators .= "{$comma}<a href=\"".get_profile_link($moderator['id'])."\">".format_name(htmlspecialchars_uni($moderator['username']),$moderator['usergroup'],$moderator['displaygroup'])."</a>";
                            $done_moderators['users'][] = $moderator['id'];
                        }
                        $comma = ", ";
                    }
                }
            }
        }
        $comma = "";
        
        if($moderators)
        {
            eval("\$forum['modlist'] = \"".$templates->get("forumbit_moderators")."\";");
        }
        else
        {
            $forum['modlist'] = "";
        }
    }
    
    // To avoid overwriting by original code segment
    $mybb->settings['modlist'] = 0;
    
    // Format lastposter name
    $query = $db->simple_select("users", "usergroup, displaygroup", "uid = '".$forum['lastposteruid']."'");
    $user = $db->fetch_array($query);
    
    $forum['lastposter'] = format_name($forum['lastposter'], $user['usergroup'], $user['displaygroup']);
} 

This should resolve the issue Wink
(2011-06-07, 12:02 PM)Aries-Belgium Wrote: [ -> ]In ACP > Forums & Postings > Forum management. First check the Introduction category and look at the Moderators tab and see if the Guest usergroup was added there.
You might need to check the other forums as well the same way.

No, that issue is coming from a plugin.
(2011-06-07, 12:02 PM)Aries-Belgium Wrote: [ -> ]In ACP > Forums & Postings > Forum management. First check the Introduction category and look at the Moderators tab and see if the Guest usergroup was added there.
You might need to check the other forums as well the same way.

nope,no guest user group added there!!! look:

[Image: 1129666416e0c11833f9cdd8ff83aec16ff16e8a.jpg]

Just make the edits which I've given above Wink
Thanks,
Rep You
No problem, glad your that error has been resolved using my modifications Smile
yes you are the best. Smile