XF 2.1 How can I set secondary user group via XF options?

XDinc

Well-known member
Hello there,
I used PHP callback to get user groups with XF\Option\UserGroup::renderSelect.

205472

As you can see below, there is no problem at this stage.

205473

I've Templater.php file, base class name: XF\Template\Templater
How can I set in this php file if secondary user group is xUserGroup via PHP Could you please anyone let me learn or see sample?

Code:
namespace Validator\XF\Template;

class Templater extends XFCP_Templater
{
    public function fnUsernameLink($templater, &$escape, $user, $rich = false, $attributes = [])
    {
        
        $isAddonEnabledGlobally =! \XF::options()->offsetGet('enableXAddon');

        if(!$isAddonEnabledGlobally)
        {
        
/**if secondary group_id == xUserGroup*/
               { My codes......
               }
        }
        return $response;
    }
}

I 've not reached to success result yet with the my codes but I have to try, and I think I need to learn that.
Thank you for your help.
 
Hello,

Maybe this thread can help :

Regards, SyTry
 
Hello,

Maybe this thread can help :

Regards, SyTry

Thanks @SyTry ,
But it is about add-secondary-user group I found the solution (y) fixed.
 
Top Bottom