Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Commit

Permalink
v.3.3.5.0
Browse files Browse the repository at this point in the history
- Добавлена фильтрация по тегам новости, работает так же как и фильтрация по категориям или авторам.
  • Loading branch information
pafnuty committed Jul 7, 2013
1 parent 0a9834d commit a51239b
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions upload/engine/modules/blockpro/block.pro.3.php
@@ -1,7 +1,7 @@
<?php
/*
=============================================================================
BlockPro 3 - Модуль для вывода блоков с новостями на страницах сайта DLE (тестировался на 9.6 и 10.0)
BlockPro 3 - Модуль для вывода блоков с новостями на страницах сайта DLE (тестировался на 9.6-10.0)
=============================================================================
Автор модуля: ПафНутиЙ
URL: http://blockpro.ru/
Expand All @@ -20,7 +20,7 @@
=============================================================================
Файл: block.pro.3.php
-----------------------------------------------------------------------------
Версия: 3.3.4.0 (01.07.2013)
Версия: 3.3.5.0 (08.07.2013)
=============================================================================
*/

Expand Down Expand Up @@ -117,6 +117,8 @@ public function runBlockPro($BlockProConfig)
if ($this->config['notPostId'] == 'this') $cache_suffix .= $_REQUEST["newsid"].'nPId_';
if ($this->config['author'] == 'this') $cache_suffix .= $_REQUEST["user"].'a_';
if ($this->config['notAuthor'] == 'this') $cache_suffix .= $_REQUEST["user"].'nA_';
if ($this->config['tags'] == 'this') $cache_suffix .= $_REQUEST["tag"].'t_';
if ($this->config['notTags'] == 'this') $cache_suffix .= $_REQUEST["tag"].'nT_';
if ($this->config['related'] == 'this') $cache_suffix .= $_REQUEST["newsid"].'r_';


Expand Down Expand Up @@ -205,6 +207,17 @@ public function runBlockPro($BlockProConfig)
$wheres[] = $ignoreXfilters.'xfields regexp "[[:<:]]('.str_replace(',', '|', $xfiltersArr).')[[:>:]]"';
}

// Фильтрация новостей по ТЕГАМ
if ($this->config['tags'] == 'this') $this->config['tags'] = $_REQUEST["tag"];
if ($this->config['notTags'] == 'this') $this->config['notTags'] = $_REQUEST["tag"];

if ($this->config['tags'] || $this->config['notTags'])
{
$ignoreTags = ($this->config['notTags']) ? 'NOT ' : '';
$tagsArr = ($this->config['notTags']) ? $this->config['notTags'] : $this->config['tags'];
$wheres[] = $ignoreTags.'tags regexp "[[:<:]]('.str_replace(',', '|', $tagsArr).')[[:>:]]"';
}

// Если включен режим вывода похожих новостей:
if ($this->config['related'] != '')
{
Expand Down Expand Up @@ -928,6 +941,9 @@ public function showOutput($output)

'catId' => !empty($catId)?$catId:'', // Категории для показа (через запятую)
'notCatId' => !empty($notCatId)?$notCatId:'', // Игнорируемые категории (через запятую)

'tags' => !empty($tags)?$tags:'', // Теги для показа (через запятую)
'notTags' => !empty($notTags)?$notTags:'', // Игнорируемые теги (через запятую)

'noicon' => !empty($noicon)?$noicon:'noicon.png', // Заглушка для иконок категорий

Expand Down

0 comments on commit a51239b

Please sign in to comment.