|
|
Регистрация Восстановить пароль |
Повторная активизация e-mail |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
|
Опции темы | Поиск в этой теме |
11.09.2010, 13:29 | #1 |
Пользователь
Регистрация: 29.04.2010
Сообщений: 31
|
дле последние новости
<?php
if(!defined('DATALIFEENGINE')) { die("Hacking attempt!"); } /*================================== ========= НАСТРОЙКИ =================================== ==========*/ $lastnewsconf['news'] = 400; // Длина новости $lastnewsconf['link'] = 300; // Обрезание титла новостей $lastnewsconf['limit'] = 15; // Количество новостей $lastnewsconf['hide_html'] = true;// Уберать все теги из текста новости (true - да, false - нет) $lastnewsconf['only_hide_main'] = false;// Показывать только новости не опубликованые на главной (true - да, false - нет) $lastnewsconf['category'] = ''; // Показывать категории, перечислите ID категорий через запятую без пробелов. Если нужно показвать все оставте поле пустым $lastnews = dle_cache("lastnews", $config['skin']); if (!$lastnews) { //include(ENGINE_DIR.'/inc/parse.class.php'); //$parse = new ParseFilter(Array(), Array()); if ($lastnewsconf['only_hide_main']) $ln_allow_main = 'and allow_main=0'; else $ln_allow_main = ''; if ($lastnewsconf['category']) $ln_category = 'and category = '. str_replace(',',' or ', $lastnewsconf['category']); else $ln_category = ''; $tpl->load_template('lastnews.tpl'); $db->query("SELECT id, title, category, short_story , date, alt_name FROM ". PREFIX . "_post WHERE approve='1' $ln_allow_main $ln_category ORDER BY date DESC LIMIT 0,{$lastnewsconf['limit']}"); while($row = $db->get_row()){ $row['date'] = strtotime($row['date']); if (strlen($row['title']) > $lastnewsconf['link']) $title = substr ($row['title'], 0, $lastnewsconf['link'])." .."; else $title = $row['title']; //$row['short_story'] = preg_replace("/\[attachment=[[igit:]]*\]/si","",stripslashes($parse->BB_Parse($parse->process($row['short_story'])))); $row['short_story'] = preg_replace("/\[attachment=[[igit:]]*\]/si","",stripslashes($row['short_story'])); $row['short_story'] = preg_replace("/<!--*-->/si","",$row['short_story']); if($lastnewsconf['hide_html'])$row['short_story'] = strip_tags($row['short_story']); if (strlen($row['short_story']) > $lastnewsconf['news']) $short_story = substr ($row['short_story'], 0, $lastnewsconf['news'])." ..."; else $short_story = $row['short_story']; $go_page = ($config['ajax']) ? "onclick=\"DlePage('newsid=".$r ow['id']."'); return false;\" " : ""; if ($config['allow_alt_url'] == "yes") $tpl->set_block("'\[full-link\](.*?)\[/full-link\]'si", "<a {$go_page}href=\"".$config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html\">\\1</a>"); else $tpl->set_block("'\[full-link\](.*?)\[/full-link\]'si", "<a {$go_page}href=\"$PHP_SELF?newsid=" .$row['id']."\">\\1</a>"); $tpl->set('{title}', stripslashes($title)); $tpl->set('{short_news}', $short_story); $tpl->compile('lastnews'); } $lastnews = $tpl->result['lastnews']; } ?> В некоторые новости выводяться не правильно с не корректным URL вот так http://sait.ru//2309-t-rhreh-rh-rthrthr-th.html а правильно так http://sait.ru/catihoria/2309-t-rhre...thrthr-th.html Что нужно исправить подскажите пожалуйста |
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Последние значение цикла | MAKEDON | Общие вопросы C/C++ | 1 | 02.03.2009 13:46 |
Последние прошение о помощи(Процедуры) | kempers | Помощь студентам | 1 | 12.12.2008 02:48 |
последНИЕ 3 символа... | PAVEL315 | Общие вопросы Delphi | 6 | 23.02.2007 11:20 |