Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Пользователей онлайн, отключить показ (Полный список)

Опубликовано:

Пользователей онлайн: x (за последние 15 минут)

 

13 пользователей, 443 гостей, 0 анонимных (Полный список)

Как отключить функцию - полный список для пользователей?

Рекомендованные сообщения

Опубликовано:

В настройках групп могут просматривать кто в онлайн.

Опубликовано:
  • Автор

В настройках групп могут просматривать кто в онлайн.

если его выключаю, то не видно списка пользователей в онлайн вообще

Опубликовано:

Ну могу тогда подсказать только хардкодом.

Открыть /admin/applications/members/modules_public/online/online.php

 

   	if ( !$this->settings['allow_online_list'] )
   	{
   		$this->registry->output->showError( 'onlinelist_disabled', 10230 );
   	}

Ниже добавить

 

   	if ( IPSMember::isInGroup( $this->memberData, array( 3 ) ) )
   	{
   		$this->registry->output->showError( 'onlinelist_disabled', 10230.1 );
   	}

3 - ид нужной группы (несколько групп перечисляем через запятую).

Опубликовано:
  • Автор

Спасибо, то что надо в общем, помогло ) только вот эти циферки сбоку отображаються на страницу ошибки доступа 10230.1

Изменено пользователем siv1987

Опубликовано:

только вот эти циферки сбоку отображаються на страницу ошибки доступа 10230.1

Это код ошибки, он отображается на всех ошибках (у каждой естественно свой).

 

PS

Не цитируйте длинные сообщения или сообщения с кодом.

Опубликовано:
  • Автор

Это код ошибки, он отображается на всех ошибках (у каждой естественно свой).

 

PS

Не цитируйте длинные сообщения или сообщения с кодом.

 

ок, спасибо за помощь!

  • 1 год спустя...
Опубликовано:
если его выключаю, то не видно списка пользователей в онлайн вообще

Можно так еще закрыть список онлайн для гостей:

 

Ниже

 

protected function _listAll()
{

Добавить:

 

if( ! $this->memberData['member_id'] )
       {
           $this->registry->output->showError('no_permission', 10230.1, false, false, 403);
       }

Опубликовано:

Ниже добавить

А можно такое же, но что бы закрыть доступ к определённым разделам форума?

Дело в том что есть один неплохой хук статистики, но в нём почему то нет функции протекции, то есть пользователь может видеть заголовки как тем и разделов, несмотря на маски доступа.

Опубликовано:
А можно такое же, но что бы закрыть доступ к определённым разделам форума?

if ( in_array( $forumID, array(1,2,3) ) )
       {
           $this->registry->output->showError('no_permission', 10230.1, false, false, 403);
       }

Изменено пользователем Strategius

Опубликовано:

Чёто не получается у меня. Не понимаю где там указаны параметры протекции?

 

<?php

class TopXStats
{
/**#@+
 * Registry Object Shortcuts
 *
 * @access	protected
 * @var		object
 */
protected $registry;
protected $DB;
protected $settings;
protected $lang;
protected $member;
protected $memberData;
protected $statistics;
/**#@-*/

public function __construct()
{
	/* Make registry objects */
	$this->registry	= ipsRegistry::instance();
	$this->DB		= $this->registry->DB();
	$this->settings =& $this->registry->fetchSettings();
	$this->lang		= $this->registry->getClass('class_localization');
	$this->member	= $this->registry->member();
	$this->memberData =& $this->registry->member()->fetchMemberData();

	$blocks = 0;

	for ( $i = 1; $i <= 6; $i ++ )
	{
		$setting = $this->settings[ "en30_statblock{$i}" ];

		if ( $setting != 0 )
		{
			$blocks++;
		}
	}

	if ( $blocks > 3 )
	{
		$latestPosts = 11;
	}
	else
	{
		$latestPosts = 5;
	}

	$this->statistics = array(
										1	=> array(
															'key'		=> 'latest_forum_news',
															'select'	=> array(	'select' => 'tid as id, title, start_date as statistic',
																						'from' => 'topics',
																						'where' => 'forum_id IN(' . $this->settings['en30_latestnewsforums'] . ')',
																						'order' => 'start_date DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Date',
															'icon'		=> 'member.png',
															'act'		=> 'showtopic'
															),

										2	=> array(
															'key'		=> 'most_popular_forums',
															'select'	=> array(	'select' => 'id, name as title, posts as statistic',
																						'from' => 'forums',
																						'where' => 'parent_id != -1',
																						'order' => 'posts DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Replies',
															'icon'		=> 'forum.png',
															'act'		=> 'showforum'
															),

										3	=> array(
															'key'		=> 'top_posters',
															'select'	=> array(	'select' => 'member_id as id, posts as statistic, members_display_name as title, member_group_id',
																						'from' => 'members',
																						'order' => 'posts DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Posts',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										4	=> array(
															'key'		=> 'top_sheriffs',
															'select'	=> array(	'select' => 'wl.wlog_addedby as id, COUNT(wlog_id) as statistic',
																						'from' => array( 'warn_logs' => 'wl' ),
																						'group' => 'wl.wlog_addedby',
																						'order' => 'COUNT(wlog_id) DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 'm.member_group_id, m.members_display_name as title',
																																'from'	 => array( 'members' => 'm' ),
																																'where'	 => 'm.member_id  = wl.wlog_addedby',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Warnings Issued',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										5	=> array(
															'key'		=> 'most_wanted',
															'select'	=> array(	'select' => 'wl.wlog_mid as id, COUNT(wlog_id) as statistic',
																						'from' => array( 'warn_logs' => 'wl' ),
																						'where' => "wl.wlog_type = 'neg'",
																						'group' => 'wl.wlog_mid',
																						'order' => 'COUNT(wlog_id) DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 'm.member_group_id, m.members_display_name as title',
																																'from'	 => array( 'members' => 'm' ),
																																'where'	 => 'm.member_id  = wl.wlog_mid',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Warnings',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										6	=> array(
															'key'		=> 'new_members',
															'select'	=> array(	'select' => 'member_id as id, joined as statistic, members_display_name as title, member_group_id',
																						'from' => 'members',
																						'order' => 'joined DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Date',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										7	=> array(
															'key'		=> 'recent_visitors',
															'select'	=> array(	'select' => 'member_id as id, last_visit as statistic, members_display_name as title, member_group_id',
																						'from' => 'members',
																						'order' => 'last_visit DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Last Visit',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										8	=> array(
															'key'		=> 'top_thread_starters',
															'select'	=> array(	'select' => 't.starter_id as id, COUNT(tid) as statistic',
																						'from' => array( 'topics' => 't' ),
																						'group' => 't.starter_id',
																						'order' => 'COUNT(tid) DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 'm.member_group_id, m.members_display_name as title',
																																'from'	 => array( 'members' => 'm' ),
																																'where'	 => 'm.member_id  = t.starter_id',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Topics',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										9	=> array(
															'key'		=> 'recent_name_changes',
															'select'	=> array(	'select' => 'dc.dname_member_id as id, dc.dname_date as statistic, dc.dname_previous, dc.dname_current',
																						'from' => array( 'dnames_change' => 'dc' ),
																						'order' => 'dc.dname_date DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 'm.member_group_id',
																																'from'	 => array( 'members' => 'm' ),
																																'where'	 => 'm.member_id  = dc.dname_member_id',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Date',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										10	=> array(
															'key'		=> 'most_popular_members',
															'select'	=> array(	'select' => 'member_id as id, members_profile_views as statistic, members_display_name as title, member_group_id',
																						'from' => 'members',
																						'order' => 'members_profile_views DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Profile Views',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										11	=> array(
															'key'		=> 'latest_profile_comments',
															'select'	=> array(	'select' => 'pc.comment_for_member_id as id, pc.comment_by_member_id, pc.comment_date, pc.comment_content as title',
																						'from' => array( 'profile_comments' => 'pc' ),
																						'order' => 'pc.comment_date DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 'm.member_group_id, m.members_display_name as statistic',
																																'from'	 => array( 'members' => 'm' ),
																																'where'	 => 'm.member_id = pc.comment_by_member_id',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Commenter',
															'icon'		=> 'post.png',
															'act'		=> 'showuser'
															),

										12	=> array(
															'key'		=> 'top_member_reputation',
															'select'	=> array(	'select' => 'pp.pp_member_id as id, pp.pp_reputation_points as statistic',
																						'from' => array( 'profile_portal' => 'pp' ),
																						'order' => 'pp.pp_reputation_points DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 'm.member_group_id, m.members_display_name as title',
																																'from'	 => array( 'members' => 'm' ),
																																'where'	 => 'm.member_id  = pp.pp_member_id',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Reputation',
															'icon'		=> 'member.png',
															'act'		=> 'showuser'
															),

										13 => array(
															'key'		=> 'most_views',
															'select'	=> array(	'select' => 'tid as id, title, views as statistic',
																						'from' => 'topics',
																						'order' => 'views DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Topic Views',
															'icon'		=> 'post.png',
															'act'		=> 'showtopic'
															),

										14 => array(
															'key'		=> 'latest_polls',
															'select'	=> array(	'select' => 'p.tid as id, p.start_date as statistic, p.poll_question as title',
																						'from' => array( 'polls' => 'p' ),
																						'order' => 'p.start_date DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 't.title as title2',
																																'from'	 => array( 'topics' => 't' ),
																																'where'	 => 't.tid = p.tid',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Date',
															'icon'		=> 'poll.png',
															'act'		=> 'showtopic'
															),

										15 => array(
															'key'		=> 'most_replies',
															'select'	=> array(	'select' => 'tid as id, title, posts as statistic',
																						'from' => 'topics',
																						'order' => 'posts DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] )
																					 ),
															'hover'	=> 'Replies',
															'icon'		=> 'post.png',
															'act'		=> 'showtopic'
															),

										16	=> array(
															'key'		=> 'recent_attachments',
															'select'	=> array(	'select' => 'a.attach_file as title, a.attach_rel_id as pid, a.attach_date as statistic',
																						'from' => array( 'attachments' => 'a' ),
																						'order' => 'attach_date DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 'p.topic_id as id',
																																'from'	 => array( 'posts' => 'p' ),
																																'where'	 => 'p.pid = a.attach_rel_id',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Date',
															'icon'		=> 'attachment.png',
															'act'		=> 'showtopic={tid}&pid={pid}#entry{pid}'
															),

										17	=> array(
															'key'		=> 'top_thread_reputation',
															'select'	=> array(	'select' => 'rc.type_id, rc.rep_points as statistic',
																						'from' => array( 'reputation_cache' => 'rc' ),
																						'where' => 'rc.type_id = t.topic_firstpost',
																						'order' => 'rep_points DESC',
																						'limit' => array( 0, $this->settings['en30_xstats'] ),
																						'add_join'	=> array(
																														array(
																																'select' => 't.title, t.tid as id',
																																'from'	 => array( 'topics' => 't' ),
																																'where'	 => 'rc.type_id = t.topic_firstpost',
																																'type'	 => 'left',
																																)
																													 )
																					 ),
															'hover'	=> 'Reputation',
															'icon'		=> 'post.png',
															'act'		=> 'showtopic'
															),

										18	=> array(
															'key'		=> 'latest_posts',
															'select'	=> array(	'select' => 't.tid as id, t.title, t.last_poster_id as id2',
																						'from' => array( 'topics' => 't' ),
																						'where'	 => "t.forum_id NOT IN({$this->settings['en30_topxexcludeforums']}) and (pi.perm_type='forum' and " . $this->DB->buildRegexp( "pi.perm_2", $this->member->perm_id_array ) . ") and t.approved=1 and (t.moved_to='' or t.moved_to" . $this->DB->buildIsNull( true ) . ")",
																						'order' => 't.last_post DESC',
																						'limit' => array( 0, $latestPosts ),
																						'add_join'	=> array(
																														array(
																																'select' => 'm.member_group_id, m.members_display_name as statistic',
																																'from'	 => array( 'members' => 'm' ),
																																'where'	 => 'm.member_id  = t.last_poster_id',
																																'type'	 => 'left',
																																),
																													array(
																															'select'	=> 'pi.perm_2',
																															'from'		=> array( 'permission_index' => 'pi' ),
																															'where'		=> "pi.app='forums' AND pi.perm_type='forum' AND pi.perm_type_id=t.forum_id",
																															'type'		=> 'left',
																														),
																													 )
																					 ),
															'hover'	=> 'Poster',
															'icon'		=> 'post.png',
															'act'		=> 'showtopic'
															),
										);
}

public function getOutput()
{
	if ( !$this->settings['en30_topxstats'] )
	{
		return;
	}

	if ( in_array( $this->memberData['member_group_id'], explode( ",", $this->settings['en30_topxexclude'] ) ) )
	{
		return;
	}

	$blockCount = 0;

	for ( $i = 1; $i <= 6; $i ++ )
	{
		$setting = $this->settings[ "en30_statblock{$i}" ];

		if ( $setting != 0 )
		{
			$blockCount++;
		}
	}

	$blocks = array();

	for ( $i = 1; $i <= 6; $i ++ )
	{
		$setting = $this->settings[ "en30_statblock{$i}" ];
		$blockRow = ( $i <= 3 ) ? 1 : 2;

		if ( $setting != 0 )
		{
			if ( ! is_numeric( $setting ) )
			{
				return "<br /><h3 style='color: red'>[EN30] Top X Stats v1.0.1 ERROR</h3><span style='font-weight: bold'>You must not select a statistic group heading (e.g. -----MEMBER STATISTICS-----) as a statistic. Please fix this in Admin CP -> Tools & Settings -> Hooks -> [EN30] Top X Stats v1.0.1 -> Block #{$i}.</span>";
			}

			if ( $setting == 1 && empty( $this->settings['en30_latestnewsforums'] ) )
			{
				return "<br /><h3 style='color: red'>[EN30] Top X Stats v1.0.1 ERROR</h3><span style='font-weight: bold'>If you have selected
				Latest Forum News as a statistic block, you must select at least
				1 news forum in Admin CP -> Tools & Settings -> Hooks -> [EN30] Top X Stats v1.0.1 -> News Forums.</span>";
			}

			$statistics = array();
			$class = 'row1';

			$this->DB->build( $this->statistics[ $setting ]['select'] );
			$this->DB->execute();

			while( $row = $this->DB->fetch() )
			{
				$row['act']									= $this->statistics[ $setting ]['act'];
				$row['link']									= "{$row['act']}={$row['id']}";
				$row['icon']								= $this->statistics[ $setting ]['icon'];	
				$row['hover']								= $this->statistics[ $setting ]['hover'];
				$row['makeTitleFormatted'] 		= false;
				$row['makeStatisticFormatted']	= false;

				if ( $setting == 9 )
				{						
					$row['title'] = "{$row['dname_previous']} - {$row['dname_current']}"; 
					$row['seoTitle']	= IPSText::makeSeoTitle( $row['dname_current'] );
				}
				else
				{
					$row['seoTitle']	= IPSText::makeSeoTitle( $row['title'] );
				}

				if ( $setting == 14 )
				{
					$row['title'] = ( ! empty( $row['title'] ) ) ? $row['title'] : $row['title2'];
				}

				if ( $setting == 16 )
				{
					$row['link'] = str_replace( array( "{tid}", "{pid}" ), array( $row['id'], $row['pid'] ), $row['act'] );	
				}

				if ( $setting == 11 )
				{
					$row['id2'] = $row['comment_by_member_id'];
					$row['seoTitle2'] = IPSText::makeSeoTitle( $row['statistic'] );
				}

				if ( $row['hover'] == 'Reputation' )
				{
					$row['statistic'] = "<span class='reputation positive rep_show' style='margin: 0; padding: 0 8px; font-size: 0.8em;' title='Репутация'>{$row['statistic']}</span>";
				}
				else if ( $row['hover'] == 'Date' )
				{
					$row['statistic'] = date( $this->settings['en30_statdateformat'], $row['statistic'] );
				}
				else if ( $row['hover'] == 'Last Visit' )
				{
					if ( date( 'd' ) != date( 'd', $row['statistic'] )  )
					{
						$row['statistic'] = date( $this->settings['en30_statdateformat'], $row['statistic'] );
					}
					else
					{
						$row['statistic'] = date( 'h:i A', $row['statistic'] );
					}
				}
				else
				{
					if ( in_array( $row['hover'], array( 'Replies', 'Topic Views', 'Profile Views', 'Topics', 'Warnings', 'Warnings Issued', 'Posts' ) ) )
					{
						$row['statistic'] = $this->registry->getClass('class_localization')->formatNumber( $row['statistic'] );
					}
				}

				$row['class'] = $class;

				if ( $class == 'row1' )
				{
					$class = 'row2';
				}
				else
				{
					$class = 'row1';
				}

				if ( $this->settings['en30_formatnames'] )
				{
					if ( in_array( $this->statistics[ $setting ]['key'], array( 'top_posters', 'top_sheriffs', 'most_wanted', 'new_members', 'recent_visitors', 'top_thread_starters', 'most_popular_members', 'top_member_reputation' ) ) )
					{
						$row['makeTitleFormatted'] = true;
					}

					if ( $row['hover'] == 'Commenter' )
					{
						$row['makeStatisticFormatted'] = true;
					}
				}

				$statistics[] = $row;
			}

			$blocks[] = array(	'lang'				=> "en30_{$this->statistics[ $setting ]['key']}",
										'img'				=> "{$this->statistics[ $setting ]['key']}.png",
										'row'				=> $blockRow,
										'stats'			=> $statistics,
									);
		}
		else
		{
			if ( $blockCount > 3 )
			{
				$blocks[] = array(	'lang'				=> "en30_spacer",
											'img'				=> "spacer.gif",
											'row'				=> $blockRow,
											'stats'			=> array(),
										);
			}
		}
	}

	$rowSpan = 0;

	if ( count( $blocks ) > 3 )
	{
		$rowSpan = 3;
	}

	$latestPosts = array();
	$class = 'row1';

	$this->DB->build( $this->statistics[18]['select'] );
	$this->DB->execute();

	while( $row = $this->DB->fetch() )
	{
		$row['act']									= $this->statistics[ 18 ]['act'];
		$row['link']									= "{$row['act']}={$row['id']}";
		$row['icon']								= $this->statistics[ 18 ]['icon'];
		$row['class'] 								= $class;
		$row['hover']								= $this->statistics[ 18 ]['hover'];
		$row['seoTitle']							= IPSText::makeSeoTitle( $row['title'] );
		$row['seoTitle2']							= IPSText::makeSeoTitle( $row['statistic'] );
		$row['makeTitleFormatted'] 		= false;
		$row['makeStatisticFormatted']	= false;

		if ( $class == 'row1' )
		{
			$class = 'row2';
		}
		else
		{
			$class = 'row1';
		}

		if ( $this->settings['en30_formatnames'] )
		{
			$row['makeStatisticFormatted'] = true;
		}

		$latestPosts[] = $row;
	}

	$this->html = $this->registry->getClass('output')->getTemplate('topxstats')->output( $blocks, $latestPosts, $rowSpan );

	return $this->html;
}
}

 

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.