вопрос
MySQL error in file: /engine/modules/informer_article.php at line 16
Error Number: 1054
The Error returned was:
Unknown column 'news_read' in 'field list'
SQL query:
SELECT id, title, date, alt_name, xfields, news_read, short_story, category, flag FROM dle_post WHERE approve='1' AND category IN (1,2) ORDER BY date DESC, date DESC LIMIT 0,1
<?php
if(!defined('DATALIFEENGINE')){ die("Hacking attempt!"); }
$informer_view_news = dle_cache("informer_view_news", $config['skin']);
if (!$informer_view_news) {
$no_img = '{THEME}/images/'. $noimg;
$template = (!isset($template) ? $skin.'.tpl' : $template);
$tpl_result_name = 'skins';
$this_month = date( 'Y-m-d H:i:s', $_TIME );
if ($sort=='last')
$db->query( "SELECT id, title, date, alt_name, xfields, news_read, short_story, category, flag FROM " . PREFIX . "_post WHERE approve='1' AND category IN ($cat) ORDER BY date DESC, date DESC LIMIT 0,$nnumm" );
if ($sort=='topnews')
$db->query( "SELECT id, title, date, alt_name, xfields, news_read, short_story, category, flag FROM " . PREFIX . "_post WHERE approve='1' AND category IN ($cat) AND date >= '$this_month' - INTERVAL $interval AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,$nnumm" );
while ( $row = $db->get_row() ) {
$tpl->load_template($template);
if( strlen( $row['title'] ) > $title_drop ) $title = substr( $row['title'], 0, $title_drop ) . " ...";
else $title = $row['title'];
$short_story = $row['short_story'];
$date = $row['date'];
if (stripos ( $tpl->copy_template, "{image-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|\')[^"\'>]+/i', $row['short_story'], $media);
$data=preg_replace('/(img|src)("|\'|="|=\')(.*)/i',"$3",$media[0]);
foreach($data as $url) {
$info = pathinfo($url);
if (isset($info['extension'])) {
$info['extension'] = strtolower($info['extension']);
if (($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$tpl->copy_template = str_replace( '{image-'.$i.'}', $url, $tpl->copy_template );
}
} else {
$tpl->copy_template = str_replace( '{image-1}', $no_img, $tpl->copy_template );
};
$tpl->copy_template = preg_replace( "#\\{image-(.+?)\\}#i", "", $tpl->copy_template );
};
$short_story = strip_tags($short_story, '');
$short_story = str_replace(' ',' ', $short_story);
if( strlen( $short_story ) > $text_drop ) $short_story = substr( $short_story, 0, $text_drop ) . " ...";
$alt_title = $row['title'];
$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
$tpl->set( '[full-link]', "<a href=\"" . $full_link . "\">" );
$tpl->set( '[/full-link]', "</a>" );
$tpl->set( '[xfgiven_img]', "" );
$tpl->set( '[/xfgiven_img]', "" );
$tpl->set('{title}', $title);
$tpl->set('{poster}', $preview);
$tpl->set('[xfvalue_img]', $preview);
$tpl->set('{alt_title}', $alt_title);
$tpl->set('{short-story}', $short_story);
$tpl->set('{full_link}', $full_link);
$tpl->set('{date}', $date);
$tpl->compile($tpl_result_name);
$tpl->clear();
};
print $tpl->result[$tpl_result_name];
unset($tpl->result[$tpl_result_name]);
$db->free();
create_cache ("informer_view_news", $informer_view_news, $config['skin']);
}
?>