Jump to content

How do I set a default theme for a specific group?


SJ77

Recommended Posts

Posted

I do have one question though. 

Since this is essentially setting all members in the group to use new theme instead of making a specific theme default for the respective group... Does this mean every single time I add a new member to a given group I will have to hit this setting?

Posted

Yes, you will have to set it as their theme unless they already have it set.

I found where it excutes when you Set As Members Theme

/**
* Set Members
*
* @return	void
*/
public function setMembers()
{
	$form = new \IPS\Helpers\Form;
	$form->hiddenvalues['id'] = \IPS\Request::i()->id;
	$form->add( new \IPS\Helpers\Form\Select( 'member_reset_where', '*', TRUE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'multiple' => TRUE, 'parse' => 'normal', 'unlimited' => '*', 'unlimitedLang' => 'all' ) ) );

	if ( $values = $form->values() )
	{
		if ( $values['member_reset_where'] === '*' )
		{
			$where = NULL;
		}
		else
		{
			$where = \IPS\Db::i()->in( 'member_group_id', $values['member_reset_where'] );
		}
		
		\IPS\Db::i()->update( 'core_members', array( 'skin' => \IPS\Request::i()->id ), $where );
			
		\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes' ), 'reset' );
	}

	\IPS\Output::i()->output = $form;
}

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...