9 апр
Добавляем теги:
[torrent] Есть торрент-файл [/torrent]
[not-torrent] Нет торрент-файла [/not-torrent]

в шаблон новостей ДЛЕ.

1. Файл: /engine/modules/functions.php
Найти:
function check_newscount( $matches=array() ) {

Добавить выше:
#****** Tracker by MSW *** start ******#
function check_torrent( $matches=array() ) {
	global $db, $config, $news_id;
	$block = $matches[2];
	$rowz = $db->super_query( "SELECT id FROM " . PREFIX . "_files WHERE news_id='{$news_id}' AND onserver LIKE '%.torrent'" );
	if( $matches[1] == "torrent" ) {
		if( !$rowz['id'] ) return "";
	} else {
		if( $rowz['id'] ) return "";
	}
	return $block;
}
#****** Tracker by MSW *** stop  ******#


2. Файлы:
- /engine/modules/show.full.php
- /engine/modules/show.short.php
- /engine/modules/show.custom.php
Найти:
if( strpos( $tpl->copy_template, "[catlist=" ) !== false ) {

Добавить выше:
#****** Tracker by MSW *** start ******#
		$news_id = $row['id'];
		if (strpos ( $tpl->copy_template, "[torrent]" ) !== false) {
			$tpl->copy_template = preg_replace_callback ( "#\\[(torrent)\\](.*?)\\[/torrent\\]#is", "check_torrent", $tpl->copy_template );
		}
		if (strpos ( $tpl->copy_template, "[not-torrent]" ) !== false) {
			$tpl->copy_template = preg_replace_callback ( "#\\[(not-torrent)\\](.*?)\\[/not-torrent\\]#is", "check_torrent", $tpl->copy_template );
		}
#****** Tracker by MSW *** stop  ******#


Применение:
В шаблонах:
- fullstory.tpl
- shortstory.tpl
- а также для шаблонах пользовательского вывода новостей при помощи тега {custom ....}
добавляем теги:
[torrent] Есть торрент-файл [/torrent]
[not-torrent] Нет торрент-файла [/not-torrent]
Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь.
Мы рекомендуем Вам зарегистрироваться либо войти на сайт под своим именем.