Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
alcatras

Скрыть любой виджет от определенной группы

Recommended Posts

Как скрыть любой виджет на форуме от определенной группы? 

Share this post


Link to post
17 часов назад, alcatras сказал:

Как скрыть любой виджет

В глобальном и локальном понимании?

Share this post


Link to post
5 часов назад, newbie сказал:

В глобальном и локальном понимании?

Ну думаю в локальном) Виджет со статистикой пользователей на главной странице хотел скрыть для некоторых групп) 

Share this post


Link to post

Я тут подумал.

Можно добавить настройку в виджет.

applications\core\widgets\stats.php

Выше 

		return $form;

Добавляете

		$form->add( new \IPS\Helpers\Form\Select(
			'stats_member_groups',
			( isset( $this->configuration['stats_member_groups'] ) ) ? ( $this->configuration['stats_member_groups'] === '*' ? '*' : $this->configuration['stats_member_groups'] ) : '*',
			FALSE,
			array( 'options' => \IPS\Member\Group::groups(), 'multiple' => TRUE, 'parse' => 'normal', 'unlimited' => '*', 'unlimitedLang' => 'all' )
		) );
		\IPS\Member::loggedIn()->language()->words['stats_member_groups'] = 'Show to';

Выше 

		$stats = array();

добавляете

		if ( isset( $this->configuration['stats_member_groups'] ) AND $this->configuration['stats_member_groups'] !== '*' )
		{
			if ( !\IPS\Member::loggedIn()->inGroup( $this->configuration['stats_member_groups'] ) )
			{
				return '';
			}
		}

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...