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

Скрытие разделов с поиска

Recommended Posts

Последние темы, это встроенный хук в форумный движок.

Открыть файл admin/applications/forums/sources/classes/forums/class_forums.php

В методе hooks_recentTopics найти

		foreach( $this->forum_by_id as $forumID => $forumData )

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

			if (in_array($forumID, explode(',', $this->memberData['ri_sforums'])))
		{
			continue;
		}

 

А вот хук последние сообщения
			$exclude = $this->settings['sos_latestdiscussions_forumsexclude'];

заменить на

			$exclude = IPSText::cleanPermString($this->settings['sos_latestdiscussions_forumsexclude'] . ',' . $this->memberData['ri_sforums']);

  • Upvote 1

Share this post


Link to post
Share on other sites

В методе hooks_recentTopics найти

Только со скобкой:

foreach( $this->forum_by_id as $forumID => $forumData )

{

После скобки добавлять.

Работает.

 

заменить на

Работает. Вот только слегка увеличилась нагрузка на главную страницу, можно ли как то оптимизировать мускул запрос?

 

 

if ( $this->settings['sos_latestdiscussions_distinct'] == 1 )

{

ipsRegistry::DB()->allow_sub_select=1;

$query = $this->DB->query( "SELECT t.tid, t.title, t.posts, t.views, t.forum_id, p.topic_id, p.author_id, p.pid, p.author_id, p.post_date, p.topic_id, m.member_group_id, members_seo_name, m.members_display_name FROM ".$this->settings['sql_tbl_prefix']."topics t LEFT JOIN ".$this->settings['sql_tbl_prefix']."posts p ON ( t.tid=p.topic_id ) inner JOIN (select topic_id, max(post_date) as datapost from ".$this->settings['sql_tbl_prefix']."posts group by topic_id) as ultimopost on ultimopost.datapost = p.post_date LEFT JOIN ".$this->settings['sql_tbl_prefix']."members m ON ( m.member_id=p.author_id ) WHERE p.queued = 0 and t.approved = 1 and t.posts > 0 and t.forum_id in(".$ids.")".$excludeforums." ORDER BY p.post_date desc LIMIT ".$this->settings['sos_latestdiscussions_number'] );

 

$outer = $this->DB->execute( $query );

}

else

{

$this->DB->build( array (

'select' => 'p.author_id, p.topic_id, p.pid, p.author_id, p.post_date, p.topic_id',

'from' => array('posts' => 'p'),

'add_join' => array(

0 => array('select' => 't.tid, t.title, t.posts, t.views, t.forum_id, title_seo',

'from' => array('topics' => 't'),

'where' => 't.tid=p.topic_id',

'type' => 'left'),

1 => array('select' => 'm.member_group_id, members_seo_name, m.members_display_name',

'from' => array( 'members' => 'm' ),

'where' => 'm.member_id=p.author_id',

'type' => 'left')

),

'where' => 'p.queued = 0 and t.approved = 1 and t.posts > 0 and t.forum_id in('.$ids.')'.$excludeforums,

'order' => 'p.post_date desc',

'limit' => array( 0, $this->settings['sos_latestdiscussions_number'] )

) );

 

 

Например выборка на кол-во просмотров (t.views) и кол-во ответов (t.posts) мне не нужна, можно ли их удалить?

Share this post


Link to post
Share on other sites

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...