Warning: fopen(/var/www/admin/data/www/artsss-web.ru/engine/cache/system/category.php): failed to open stream: No such file or directory in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 316 Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 317 Warning: fclose(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 318 Warning: fopen(/var/www/admin/data/www/artsss-web.ru/engine/cache/system/usergroup.php): failed to open stream: No such file or directory in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 316 Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 317 Warning: fclose(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 318 Warning: fopen(/var/www/admin/data/www/artsss-web.ru/engine/cache/system/informers.php): failed to open stream: No such file or directory in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 316 Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 317 Warning: fclose(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 318 Warning: fopen(/var/www/admin/data/www/artsss-web.ru/engine/cache/related_5fd0b37cd7dbbb00f97ba6ce92bf5add.tmp): failed to open stream: Permission denied in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 374 Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 375 Warning: fclose(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 376 Warning: fopen(/var/www/admin/data/www/artsss-web.ru/engine/cache/system/banners.php): failed to open stream: No such file or directory in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 316 Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 317 Warning: fclose(): supplied argument is not a valid stream resource in /var/www/admin/data/www/artsss-web.ru/engine/modules/functions.php on line 318
DataLife Engine > Хаки DLE > Похожие новости с описанием
Похожие новости с описанием1-08-2010, 19:19. Разместил: Пряник |
Представляю Вашему вниманию хак для DLE Похожие новости с описанием, он изменяет показ похожих новостей {related-news} так, что начинают показываться не просто заголовоки похожих новостей, но еще и краткое описание к ним. Установка хака Похожие новости с описанием: 1. Открываем show.full.php if( $config['related_news'] ) { if( $config['allow_cache'] != "yes" ) { $config['allow_cache'] = "yes"; $revert_cache = true; } else $revert_cache = false; $buffer = dle_cache( "related", $row['id'] ); if( $buffer === FALSE ) { if( strlen( $row['full_story'] ) < strlen( $row['short_story'] ) ) $body = $row['short_story']; else $body = $row['full_story']; $body = $db->safesql( strip_tags( stripslashes( $metatags['title'] . " " . $body ) ) ); $config['related_number'] = intval( $config['related_number'] ); if( $config['related_number'] < 1 ) $config['related_number'] = 5; $db->query( "SELECT id, title, date, category, alt_name, flag FROM " . PREFIX . "_post WHERE MATCH (title, short_story, full_story, xfields) AGAINST ('$body') AND id != " . $row['id'] . " AND approve='1'" . $where_date . " LIMIT " . $config['related_number'] ); while ( $related = $db->get_row() ) { $related['date'] = strtotime( $related['date'] ); $related['category'] = intval( $related['category'] ); if( strlen( $related['title'] ) > 75 ) $related['title'] = substr( $related['title'], 0, 75 ) . " ..."; if( $config['allow_alt_url'] == "yes" ) { if( $related['flag'] and $config['seo_type'] ) { if( $related['category'] and $config['seo_type'] == 2 ) { $full_link = $config['http_home_url'] . get_url( $related['category'] ) . "/" . $related['id'] . "-" . $related['alt_name'] . ".html"; } else { $full_link = $config['http_home_url'] . $related['id'] . "-" . $related['alt_name'] . ".html"; } } else { $full_link = $config['http_home_url'] . date( 'Y/m/d/', $related['date'] ) . $related['alt_name'] . ".html"; } } else { $full_link = $config['http_home_url'] . "index.php?newsid=" . $related['id']; } $buffer .= "<li><a href=\"" . $full_link . "\">" . stripslashes( $related['title'] ) . "</a></li>"; } $db->free(); create_cache( "related", $buffer, $row['id'] ); } $tpl->set( '{related-news}', $buffer ); if( $revert_cache ) $config['allow_cache'] = "no"; } Заменяем на if( $config['related_news'] ) { if( $config['allow_cache'] != "yes" ) { $config['allow_cache'] = "yes"; $revert_cache = true; } else $revert_cache = false; $buffer = dle_cache( "related", $row['id'] ); if( $buffer === FALSE ) { if( strlen( $row['full_story'] ) < strlen( $row['short_story'] ) ) $body = $row['short_story']; else $body = $row['full_story']; $body = $db->safesql( strip_tags( stripslashes( $metatags['title'] . " " . $body ) ) ); $config['related_number'] = intval( $config['related_number'] ); if( $config['related_number'] < 1 ) $config['related_number'] = 5; $db->query( "SELECT id, title, short_story, date, category, alt_name, flag FROM " . PREFIX . "_post WHERE MATCH (title, short_story, full_story, xfields) AGAINST ('$body') AND id != " . $row['id'] . " AND approve='1'" . $where_date . " LIMIT " . $config['related_number'] ); while ( $related = $db->get_row() ) { $related['date'] = strtotime( $related['date'] ); $related['category'] = intval( $related['category'] ); if( strlen( $related['title'] ) > 75 ) $related['title'] = substr( $related['title'], 0, 75 ) . " ..."; if( $config['allow_alt_url'] == "yes" ) { if( $related['flag'] and $config['seo_type'] ) { if( $related['category'] and $config['seo_type'] == 2 ) { $full_link = $config['http_home_url'] . get_url( $related['category'] ) . "/" . $related['id'] . "-" . $related['alt_name'] . ".html"; } else { $full_link = $config['http_home_url'] . $related['id'] . "-" . $related['alt_name'] . ".html"; } } else { $full_link = $config['http_home_url'] . date( 'Y/m/d/', $related['date'] ) . $related['alt_name'] . ".html"; } } else { $full_link = $config['http_home_url'] . "index.php?newsid=" . $related['id']; } $go_page = ($config['ajax']) ? "onclick=\"DlePage('newsid=" . $related['id'] . "'); return false;\" " : ""; $related['short_story'] = preg_replace( "#<(.+?)>(.+?)</(.+?)>#", "\\2", $related['short_story'] ); $related['short_story'] = preg_replace( "#<(.+?)>#", "", $related['short_story'] ); $buffer .= "<li><a {$go_page} href=\"" . $full_link . "\">" . stripslashes( $related['title'] ) . "</a><br/>" . $related['short_story'] = ( strlen( $related['short_story'] ) > 200 ) ? substr( $related['short_story'], 0, 200 ) . " ..." : stripslashes( $related['short_story'] ) . "</li>"; } $db->free(); create_cache( "related", $buffer, $row['id'] ); } $tpl->set( '{related-news}', $buffer ); if( $revert_cache ) $config['allow_cache'] = "no"; } Заходим в админку,чистим кеш и вуаля! Все работает. Вернуться назад |