Свой шаблон вывода "Популярные новости" DLE . Нужна помощь

nick889
На сайте с 28.04.2009
Offline
66
1940

Приветствую.

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

вот сам код:

<?php

/*
=====================================================
DataLife Engine - by SoftNews Media Group
Mod by Олег Одоевский a.k.a Sander
ICQ: 404-037-556
http://nfhelp.ru/
-----------------------------------------------------
http://dle-news.ru/
-----------------------------------------------------
Copyright (c) 2004,2010 SoftNews Media Group
=====================================================
Данный код защищен авторскими правами
=====================================================
Файл: topnews.php
-----------------------------------------------------
Назначение: вывод рейтинговых статей (улучшенная сортировка)
=====================================================
*/
if(!defined('DATALIFEENGINE')) die("Hacking attempt!");

################################# Настройки ############################################
$cut_titile= 0; // На сколько символов обрезать заголовок. Поставить ноль, чтобы заголовок не обрезало
$last_days= 31; // Выбирать новости не старше * дней
$count_news= 10; // Сколько новостей выводить в блоке.

############################## Дальше не трогать! #######################################
$topnews=dle_cache("topnews",$config['skin']);
if(!$topnews){$this_month=date('Y-m-d H:i:s',$_TIME);
$last_days=intval($last_days);$last_days=($last_days)?$last_days:31;
$count_news=intval($count_news);$count_news=($count_news)?$count_news:10;
$db->query( "SELECT id, title, date, alt_name, category, flag, autor, news_read, comm_num FROM " . PREFIX . "_post WHERE approve AND date>='$this_month' - INTERVAL ".$last_days." DAY AND date<'$this_month' ORDER BY (rating+1)*news_read DESC, comm_num DESC, date DESC LIMIT 0,".$count_news );
while($row=$db->get_row()){
$row['date']=strtotime($row['date']);$row['category']=intval($row['category']);
if($config['allow_alt_url']=="yes"){
if($row['flag'] and $config['seo_type']){
if($row['category'] and $config['seo_type']== 2) $full_link=$config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
else $full_link=$config['http_home_url'].$row['id']."-".$row['alt_name'].".html";
}else $full_link=$config['http_home_url'].date('Y/m/d/',$row['date']).$row['alt_name'].".html";
}else $full_link=$config['http_home_url']."index.php?newsid=".$row['id'];
if(date(Ymd,$row['date'])==date(Ymd,$_TIME)) $date=$lang['time_heute'].langdate(", H:i",$row['date']);
elseif(date(Ymd,$row['date'])==date(Ymd,($_TIME-86400))) $date=$lang['time_gestern'].langdate(",H:i",$row['date']);
else $date=langdate($config['timestamp_active'],$row['date']); $cut_titile=intval($cut_titile);
if($cut_titile AND strlen($row['title'])>$cut_titile) $title=stripslashes(substr($row['title'],0,$cut_titile)." ...");
else $title=stripslashes($row['title']);
$go_page=($config['ajax'])?"onclick=\"DlePage('newsid=".$row['id']."');return false;\"":"";
if($config['allow_comments_wysiwyg']=="yes") $go_page='';

$tpl->load_template('topnews.tpl');$tpl->set('{title}',$title);$tpl->set('{author}',$row[autor]);
$tpl->set('{date}',$date);$tpl->set('{views}',intval($row['news_read']));
$tpl->set('{comments-num}',intval($row['comm_num']));
$tpl->set('[full-link]',"<a ".$go_page." href=\"" . $full_link . "\" title=\"".$title."\">");$tpl->set('[/full-link]',"</a>");
$tpl->compile('topnews');}$topnews = $tpl->result['topnews'];
$db->free();$tpl->clear();create_cache( "topnews", $topnews, $config['skin'] );}
?>

как я понимаю, копаться нужно в этих строчках:

$tpl->load_template('topnews.tpl');$tpl->set('{title}',$title);$tpl->set('{author}',$row[autor]);

$tpl->set('{date}',$date);$tpl->set('{views}',intval($row['news_read']));
$tpl->set('{comments-num}',intval($row['comm_num']));
$tpl->set('[full-link]',"<a ".$go_page." href=\"" . $full_link . "\" title=\"".$title."\">");$tpl->set('[/full-link]',"</a>");
$tpl->compile('topnews');}$topnews = $tpl->result['topnews'];
$db->free();$tpl->clear();create_cache( "topnews", $topnews, $config['skin'] );}

но не знаю какой код нужно добавить чтоб была выборка из определенного доп. поля?

Буду благодарен если поможете разобраться.

Создаю баннеры! :: Иногда даже Дизайн!

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий