+2.20
Рейтинг
2.96
Сила

Роман

Пишу полностью что и как.
Открываем файл /classes/hooks/HookStatisticsPerformance.class.php
После
class HookStatisticsPerformance extends Hook {
	public function RegisterHook() {
		$this->AddHook('template_body_end','Statistics',__CLASS__,-1000);


Добавляем
$this->AddHook('topic_show','TopicShow');


Далее, после
public function Statistics() {
		$oEngine=Engine::getInstance();
		
		$iTimeInit=$oEngine->GetTimeInit();
		$iTimeFull=round(microtime(true)-$iTimeInit,3);
		$this->Viewer_Assign('iTimeFullPerformance',$iTimeFull);
		
		$aStats=$oEngine->getStats();
		$aStats['cache']['time']=round($aStats['cache']['time'],5);
		$this->Viewer_Assign('aStatsPerformance',$aStats);
		
		$this->Viewer_Assign('bIsShowStatsPerformance',Router::GetIsShowStats());
		return $this->Viewer_Fetch('statistics_performance.tpl');
	}


Добавляем
public function TopicShow($aParams) {
        $oTopic=$aParams['oTopic'];
        $oTopic->setCountRead($oTopic->getCountRead()+1);
        $this->Topic_UpdateTopic($oTopic);
    }


В шаблоне добавляем в topic.tpl или в topic_list.tpl
{$oTopic->getCountRead()}
Нашлось решение проблемы.
Router.class.php
protected function __construct() {
		$this->LoadConfig();		
		
		if (get_magic_quotes_gpc()) {
			func_stripslashes($_REQUEST);
		}
		
		$sReq=preg_replace("/\/+/",'/',$_SERVER['REQUEST_URI']);		
		$sReq=preg_replace("/^\/(.*)\/?$/U",'\\1',$sReq);		
		$sReq=preg_replace("/^(.*)\/\?.*$/U",'\\1',$sReq);
		
		self::$sPathWebCurrent = DIR_WEB_ROOT."/".$sReq;
			
		$aRequestUrl = ($sReq=='') ? array() : explode('/',$sReq);		

if (@$aRequestUrl[1])
		{
			$aRequestUrl[1] = urldecode($aRequestUrl[1]);	
		}
		for ($i=0;$i<SYS_OFFSET_REQUEST_URL;$i++) {
			array_shift($aRequestUrl);
		}		
		self::$sAction=array_shift($aRequestUrl);
		self::$sActionEvent=array_shift($aRequestUrl);
		self::$aParams=$aRequestUrl;
	}

ActionProfile.class.php
protected function RegisterEvent() {			
		$this->AddEventPreg('/^[^\/]+$/i','/^(whois)?$/i','EventWhois'); 
		$this->AddEventPreg('/^[^\/]+$/i','/^favourites$/i','/^(page(\d+))?$/i','EventFavourite');
	}