Изменяем внутреннюю навигацию в новости для DLE

Изменяем внутреннюю навигацию в новости

Данный хак позволяет заменить внутреннюю навигацию в новостях.
По умолчанию в DLE установлен следующий вид навигации:
Страница 1 из 2 | Следующая страница

С помощью хака можно настроить такой cтиль:
< 1 2 >
< 3 4 5 >
< 6 7 >
1. Открыть файл /engine/modules/show.full.php
Найти код:
            if( $anzahl_seiten > 1 ) {
                
                if( $news_page < $anzahl_seiten ) {
                    $pages = $news_page + 1;
                    
                    if( $config['allow_alt_url'] == "yes" ) {
                        $nextpage = " | <a href=\"" . $short_link . "page," . $pages . "," . $row['alt_name'] . ".html\">" . $lang['news_next'] . "</a>";
                    } else {
                        $nextpage = " | <a href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=" . $pages . "\">" . $lang['news_next'] . "</a>";
                    }
                }
                
                if( $news_page > 1 ) {
                    $pages = $news_page - 1;
                    
                    if( $config['allow_alt_url'] == "yes" ) {
                        $prevpage = "<a href=\"" . $short_link . "page," . $pages . "," . $row['alt_name'] . ".html\">" . $lang['news_prev'] . "</a> | ";
                    } else {
                        $prevpage = "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=" . $pages . "\">" . $lang['news_prev'] . "</a> | ";
                    }
                }
                
                $tpl->set( '{pages}', $prevpage . $lang['news_site'] . " " . $news_page . $lang['news_iz'] . $anzahl_seiten . $nextpage );
                
                if( $config['allow_alt_url'] == "yes" ) {
                    
                    $replacepage = "<a href=\"" . $short_link . "page," . "\\1" . "," . $row['alt_name'] . ".html\">\\2</a>";
                
                } else {
                    
                    $replacepage = "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=\\1\">\\2</a>";
                }
                
                $row['full_story'] = preg_replace( "'\[PAGE=(.*?)\](.*?)\[/PAGE\]'si", $replacepage, $row['full_story'] );
            
            } else {
                
                $tpl->set( '{pages}', '' );
                $row['full_story'] = preg_replace( "'\[PAGE=(.*?)\](.*?)\[/PAGE\]'si", "", $row['full_story'] );
            }

ВМЕСТО него вставить:
            if( $anzahl_seiten > 1 ) {
                
                if( $news_page < $anzahl_seiten ) {
                    $pages = $news_page + 1;
                    
                    if( $config['allow_alt_url'] == "yes" ) {
                        $nextpage = " <a href=\"" . $short_link . "page," . $pages . "," . $row['alt_name'] . ".html\">" . $pages . "</a>";
                    } else {
                        $nextpage = " <a href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=" . $pages . "\">" . $pages . "</a>";
                    }

                }

                if( $news_page < $anzahl_seiten-1 ) {
                    $pages = $news_page + 1;
                    
                     if( $config['allow_alt_url'] == "yes" ) {
                        $nextpage .= " <a class=\"arr_nav\" href=\"" . $short_link . "page," . ($pages+1) . "," . $row['alt_name'] . ".html\">></a>";
                    } else {
                        $nextpage .= " <a class=\"arr_nav\" href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=" . ($pages+1) . "\">></a>";
                    }
                } else {
                    $nextpage .=" <span class=\"arr_nav\">></span>";
                }
                
                if( $news_page > 2 ) {
                    $pages = $news_page - 1;
                    
                    if( $config['allow_alt_url'] == "yes" ) {
                        $prevpage = "<a class=\"arr_nav\" href=\"" . $short_link . "page," . ($pages-1) . "," . $row['alt_name'] . ".html\"><</a> ";
                    } else {
                        $prevpage = "<a class=\"arr_nav\" href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=" . ($pages-1) . "\"><</a> ";
                    }
                } else {
                    $prevpage = "<span class=\"arr_nav\"><</span> ";
                }

                if( $news_page > 1 ) {
                    $pages = $news_page - 1;
                    
                    if( $config['allow_alt_url'] == "yes" ) {
                        $prevpage .= "<a href=\"" . $short_link . "page," . $pages . "," . $row['alt_name'] . ".html\">" . $pages . "</a> ";
                    } else {
                        $prevpage .= "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=" . $pages . "\">" . $pages . "</a> ";
                    }
                }

                $tpl->set( '{pages}', $prevpage . "<span>" . $news_page . "</span>" . $nextpage );
                
                if( $config['allow_alt_url'] == "yes" ) {
                    
                    $replacepage = "<a href=\"" . $short_link . "page," . "\\1" . "," . $row['alt_name'] . ".html\">\\2</a>";
                
                } else {
                    
                    $replacepage = "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&amp;news_page=\\1\">\\2</a>";
                }
                
                $row['full_story'] = preg_replace( "'\[PAGE=(.*?)\](.*?)\[/PAGE\]'si", $replacepage, $row['full_story'] );
            
            } else {
                
                $tpl->set( '{pages}', '' );
                $row['full_story'] = preg_replace( "'\[PAGE=(.*?)\](.*?)\[/PAGE\]'si", "", $row['full_story'] );
            }


2. В файле шаблона fullstory.tpl код:
<div align="center" class="navigation">{pages}</div>


На вский случай прикрепляю инструкцию:
Инструкция [3,92 Kb] (cкачиваний: 18)
Ниже представлен пример работы этого хака.
Добавить комментарий
  • Логин
  • E-mail
Повторите рисунок:
antibot
© Sander-Development. 2009-2018.
При копировании, ссылка на источник обязательна.