პირველ რიგში ვაკეთებთ შემდეგ ჩასწორებებს: /engine/modules/topnews.php, ში ვპოულობთif ($category_id) {
if ($config['show_sub_cats']) $get_cats = get_sub_cats($category_id);
else $get_cats = $category_id;
if ($config['allow_multi_category']) $where_category = "category regexp '[[::]]'";
else {
if ($config['show_sub_cats']) {
$get_cats = str_replace ( "|", "','", $get_cats );
$where_category = "category IN ('" . $get_cats . "')";
} else $where_category = "category = '{$get_cats}'";
}
}
და მის მერე ვნახულობთ ამ მოთხოვნას:
$db->query( "SELECT id, title, date, alt_name,short_story, category, flag FROM " . PREFIX . "_post WHERE approve='1' AND date >= '$this_month' - INTERVAL 12 MONTH AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,9" );
რომელსაც ვცვლით ამით:if ($where_category !='') $where_category ='AND '.$where_category;
$db->query( "SELECT id, title, date, alt_name,short_story, category, flag FROM " . PREFIX . "_post WHERE approve='1' {$where_category} AND date >= '$this_month' - INTERVAL 12 MONTH AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,9" );
და ბოლოს დარჩა შემდეგი მოქმედებები: ვპოულობთ$topnews = dle_cache( "topnews", $config['skin'] );
ვცვლით ამით:$topnews = dle_cache( "topnews-".$category_id, $config['skin'] );
ვპოულობთ:
create_cache( "topnews", $topnews, $config['skin'] );
ვცვლით:
create_cache( "topnews-".$category_id, $topnews, $config['skin'] );
+9
ავტორი:
admin ნანახია: 2252 | კომენტარი: 5 | Hacks | 23-08-2011, 15:13