Jump to content
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.

(IPB 3.3) Проблема репутации в showtopic

Столкнулся со следующей проблемой в репутации.

 

В index.php?showtopic репутация (отображаемая под аватарами юзеров) отображается (у половины отписавшихся в теме) такой же, в смысле, с таким же колличеством баллов , как и у ТопикСтартера. С чем это связано понять не не могу и почему именно только у некоторых юзеров, а не у всех...

 

 

P.S. Репутация в showuser отображается правильно.

 

Где копать?

Featured Replies

Вот тут что-то говорится о репутации и об исправлении другой проблемы с репутацией в версии 3.3.1. Возможно, нужно обновить версию движка.

Edited by Zero108

  • Author

Версия движка 3.3.3

Edited by BeHz

В index.php?showtopic репутация (отображаемая под аватарами юзеров) отображается

В скрипте нет такой репутации. Следовательно, вы используете какой-то мод. Следовательно, мод нужно регулярно обновлять, да и вообще он может быть с ошибками. Чтобы искать ошибки, или хотя бы представлять, как это работает, нужно знать название мода. Но вы его не называете. Следовательно, ждем экстрасенсов.

  • Author

Только что говорил с медиумом - он сказал , что используется сторонний хук - Show Reputation in User Info v3.1.0. Версия актуальная 3.3 вроде как написано.

 

Раньше проблема может не замечалась, может с чем-то другим связана... Просто непонятно даже где что смотреть :(

  • Author

ADD:

 

Замечено, что бывает репутация (в UserInfoPane, т.е. в showtopic когда заходишь) отображается кол-вом баллов, которое у предыдущего отписавшегося , а у самого предыдущего 0 показывает...

  • Author

Что было обнаружено, что почему-то репутация последнего отписавшегося приписывается от предыдущего, но что странно это было только замечено в showtopic - и не всегда - именно из-за каких факторов не ясно.

 

Вот код хука, вроде ошибок нет, но хз

 

 

 

<?php
/**
* (TB) Show Reputation in User Info
* @file		tbShowRepInUserInfo.php 	Template Hook (userInfoPane)
*
* @copyright	(c) 2006 - 2012 Invision Byte
* @link		http://www.invisionbyte.net/
* @author		Terabyte
* @since		10/07/2009
* @updated		12/05/2012
* @version		3.1.0 (31000)
*/
class tbShowRepInUserInfo
{
public $registry;
public $settings;

public function __construct()
{
	/* Make registry objects */
	$this->registry   =  ipsRegistry::instance();
	$this->settings   =& $this->registry->fetchSettings();
}

public function getOutput()
{
	return '';
}

public function replaceOutput( $output, $key )
{
	/* Do we have it enabled? =O */
	if( $this->registry->member()->getProperty('g_mem_info') > 0 && $this->settings['reputation_enabled'] && $this->settings['reputation_show_profile'] && is_array($this->registry->output->getTemplate('global')->functionData['userInfoPane']) AND count($this->registry->output->getTemplate('global')->functionData['userInfoPane']) )
	{
		/* Cleanup our variable */
		$this->settings['reputation_protected_groups'] = IPSText::cleanPermString($this->settings['reputation_protected_groups']);

		/* Init some vars */
		$tag	= '<!--hook.' . $key . '-->';
		$tagStr	= strlen( $tag );
		$last	= 0;
		$notSee = empty($this->settings['reputation_protected_groups']) ? array() : explode(',', $this->settings['reputation_protected_groups']);

		foreach( $this->registry->output->getTemplate('global')->functionData['userInfoPane'] as $_id => $_data )
		{
			$pos = strpos( $output, $tag, $last );

			if( $pos !== FALSE )
			{
				$string	= ( !isset($_data['author']['pp_reputation_points']) || IPSMember::isInGroup($_data['author'], $notSee) ) ? '' : $this->registry->getClass('output')->getTemplate('global')->tbSruiHook( $_data['author'] );
				$output	= substr_replace( $output, $string . $tag, $pos, $tagStr );
				$last	= $pos + strlen( $string . $tag );
			}
			else
			{
				/* Not found, useless to go on... */
				break;
			}
		}
	}

	return $output;
}
}

 

 

Edited by BeHz

Зачем нужны какие-то хуки, если можно в шаблоне userInfoPane прекрасно все вывести? Например:

<li class='reputation <if test="$author['pp_reputation_points'] > 0">positive</if><if test="$author['pp_reputation_points'] < 0">negative</if><if test="$author['pp_reputation_points'] == 0">zero</if>'>
{parse format_number="$author['pp_reputation_points']"}
</li>

@siv1987, это версия хука, поддерживает 3.2 и 3.3.

Тут на форуме было замечено подобное, когда в теме отвечал бот.

  • Author

Тут на форуме было замечено подобное, когда в теме отвечал бот.

 

Да, тоже замечено было с темах, где поставлен AutoPostReply. Видимо какие-то глюки случаются из-за некорректного добавления поста им....

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.