MyBB Central
Avatar dim for each usergroup 1.6 > 1.8 (Plugin) - Printable Version

+- MyBB Central (http://www.mybbcentral.com)
+-- Forum: Mybb Central General Discussions (http://www.mybbcentral.com/forum-1.html)
+--- Forum: Mybb General Support Help (http://www.mybbcentral.com/forum-6.html)
+--- Thread: Avatar dim for each usergroup 1.6 > 1.8 (Plugin) (/thread-12434.html)



Avatar dim for each usergroup 1.6 > 1.8 (Plugin) - X-Shadow - May 01, 2015

So I have this plugin that makes different avatar dimensions for each usergroup. It works on 1.6 but not properly on 1.8

Can someone help me make it work on 1.8?

The code is below:

PHP Code:
<?php

if(!defined("IN_MYBB"))
    die(
"This file cannot be accessed directly.");

$plugins->add_hook("usercp_avatar_start""diffavatardim_run");
$plugins->add_hook("usercp_do_avatar_start""diffavatardim_run");

function 
diffavatardim_info()
{
    return array(
        
'name'            => 'Different Avatar Dimensions',
        
'description'    => 'Allow different usergroups to have different avatar max dimensions.',
        
'version'        => '1.0'
    
);
}

function 
diffavatardim_run()
{
    global 
$mybb;
    switch(
$mybb->user['usergroup'])
    {
        case 
'4'// admins
            
$mybb->settings['maxavatardims'] = '100x100'// no limit
            
break;
        case 
'3'// Super Moderators
            
$mybb->settings['maxavatardims'] = '90x80';
            break;
        case 
'6'// Sectional Moderators
            
$mybb->settings['maxavatardims'] = '90x90';
            break;
           case 
'2'// Regular Members
            
$mybb->settings['maxavatardims'] = '90x70';
            break;
        case 
'9'// Upgraded Members
            
$mybb->settings['maxavatardims'] = '90x70';
            break;

    }
}
?>



RE: Avatar dim for each usergroup 1.6 > 1.8 (Plugin) - Nasyr - Jun 18, 2015

Did you upgrade it's compatibility?