Изменяем внутреннюю навигацию в новости для 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качиваний: 26)
Ниже представлен пример работы этого хака.
Добавить комментарий

Внимание! Все сообщения касающиеся техподдержки будут удалены или проигнорированы

Attention! All messages asking for technical support will be removed or ignored

  • Логин
  • E-mail (не обязательно)
Повторите рисунок:
antibot
© Sander-Development. 2009-2024.
При копировании, ссылка на источник обязательна.