1. Previous and next news for DLE 9.7,9.8 and 10.0

Previous and next news for DLE 9.7,9.8 and 10.0

  |   8
Previous and next news for DLE 9.7,9.8 and 10.0Previous and next news for DLE 9.7,9.8 and 10.0

Hack - Previous and next news for DLE 9.7,9.8 and 10.0

This hack only display 2 articles one for previous article and next article. It will display the next and previous articles in fullstory page, this hack has been very helpful for many sites that use any kind of contents, especially in Movies and Musics websites will be very useful for users to watch or view next or previous contents.

Installation

1) Open file engine/modules/show.full.php

Find:
$disable_index = $row['disable_index'];

Add BEFORE:
$real_date = $row['date'];

Find:
if( $config['related_news'] AND $view_template != "print") {

Add BEFORE:
// The previous and next links
// Back Link
$backlink = $db->super_query( "SELECT * FROM " . PREFIX . "_post LEFT JOIN " . PREFIX . "_post_extras ON (" . PREFIX . "_post.id=" . PREFIX . "_post_extras.news_id) WHERE date <= '{$real_date}' AND id <> '{$row['id']}' AND category = '{$row['category']}' AND approve = '1' ORDER BY date DESC LIMIT 0,1" );
if( $backlink ) {

$backlink['date'] = strtotime( $backlink['date'] );
$backlink['category'] = intval( $backlink['category'] );

if( $config['allow_alt_url'] == "yes" ) {
if( $config['seo_type'] == 1 OR $config['seo_type'] == 2 ) {

if( $backlink['category'] AND $config['seo_type'] == 2 ) {

$c_url = get_url( $backlink['category'] );
$back_link = $config['http_home_url'] . $c_url . "/" . $backlink['id'] . "-" . $backlink['alt_name'] . ".html";
} else {
$back_link = $config['http_home_url'] . $backlink['id'] . "-" . $backlink['alt_name'] . ".html";
}
} else {
$back_link = $config['http_home_url'] . date( 'Y/m/d/', $backlink['date'] ) . $backlink['alt_name'] . ".html";
}
} else {
$back_link = $config['http_home_url'] . "index.php?newsid=" . $backlink['id'];
}

$tpl->set_block ( "'\\[back_link\\](.*?)\\[/back_link\\]'si", "\\1" );
$db->free();
} else {
$back_link = "";
$tpl->set_block ( "'\\[back_link\\].*?\\[/back_link\\]'si", "" );
}
// Next Link
$nextlink = $db->super_query( "SELECT * FROM " . PREFIX . "_post LEFT JOIN " . PREFIX . "_post_extras ON (" . PREFIX . "_post.id=" . PREFIX . "_post_extras.news_id) WHERE date >= '{$real_date}' AND id <> '{$row['id']}' AND category = '{$row['category']}' AND approve = '1' ORDER BY date ASC LIMIT 0,1" );

if ( $nextlink ) {
$nextlink['date'] = strtotime( $nextlink['date'] );
$nextlink['category'] = intval( $nextlink['category'] );

if( $config['allow_alt_url'] == "yes" ) {
if( $config['seo_type'] == 1 OR $config['seo_type'] == 2 ) {

if( $nextlink['category'] AND $config['seo_type'] == 2 ) {

$c_url = get_url( $nextlink['category'] );
$next_link = $config['http_home_url'] . $c_url . "/" . $nextlink['id'] . "-" . $nextlink['alt_name'] . ".html";

} else {
$next_link = $config['http_home_url'] . $nextlink['id'] . "-" . $nextlink['alt_name'] . ".html";
}
} else {
$next_link = $config['http_home_url'] . date( 'Y/m/d/', $nextlink['date'] ) . $nextlink['alt_name'] . ".html";
}
} else {

$next_link = $config['http_home_url'] . "index.php?newsid=" . $nextlink['id'];

}
$tpl->set_block ( "'\\[next_link\\](.*?)\\[/next_link\\]'si", "\\1" );
$db->free();
} else {
$next_link = "";
$tpl->set_block ( "'\\[next_link\\].*?\\[/next_link\\]'si", "" );
}
// Back and Next Link Template
$tpl->set( '{back-link}', $back_link );
$tpl->set( '{next-link}', $next_link );
// END Hack


2) Open the template fullstory.tpl add links to the right place (wherever you want the links to display) (I made 2 button color styles for you to choose, you can use green or blue or your choice)

Green Button Style
[back_link]<a href="{back-link}" class="pre-button greenBTN"><span class="btntext"></span> Previous Article</a>[/back_link]
[next_link]<a href="{next-link}" class="next-button greenBTN">Next Article <span class="btntext"></span></a>[/next_link]

Blue Button Style
[back_link]<a href="{back-link}" class="pre-button blueBTN"><span class="btntext"></span> Previous Article</a>[/back_link]
[next_link]<a href="{next-link}" class="next-button blueBTN">Next Article <span class="btntext"></span></a>[/next_link]


3) CSS: (Add to one of your CSS file)
/* previous button */
.pre-button {
position:relative;
display:inline-block;
font-weight:bold;
font-size:16px;
font-family:Arial,sans-serif;
height:40px;
line-height:40px;
-moz-border-radius: 20px;
border-radius: 20px;
color:#FFF;
text-shadow: 0px 1px 2px #000000;
text-shadow: 0px 1px 2px rgba(0,0,0,0.3);
filter: dropshadow(color=#000000, offx=0, offy=1);
text-decoration:none;
padding:0 20px 0 40px;
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2),inset 0px 1px 0px rgba(255,255,255,0.25);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2),inset 0px 1px 0px rgba(255,255,255,0.25);
box-shadow: 0px 3px 3px rgba(0,0,0,0.2),inset 0px 1px 0px rgba(255,255,255,0.25);
opacity:.90
}

.pre-button span.btntext {
font-weight:normal;
background:none;
display:inline;
}

.pre-button span.btntext::after {
content: "";
position:absolute;
background:url('../images/arrow-left.png') 0 0 no-repeat;
display:block;
width:13px;
height:19px;
top:50%;
left:15px;
margin-top:-9px;
}

.pre-button:active {
-webkit-box-shadow:inset 0 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow:inset 0 3px 3px rgba(0,0,0,0.2);
box-shadow:inset 0 3px 3px rgba(0,0,0,0.2);
position:relative;
top:1px;
}


/* next button */
.next-button {
position:relative;
display:inline-block;
font-weight:bold;
font-size:16px;
font-family:Arial,sans-serif;
height:40px;
line-height:40px;
-moz-border-radius: 20px;
border-radius: 20px;
color:#FFF;
text-shadow: 0px 1px 2px #000000;
text-shadow: 0px 1px 2px rgba(0,0,0,0.3);
filter: dropshadow(color=#000000, offx=0, offy=1);
text-decoration:none;
padding:0 40px 0 20px;
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2),inset 0px 1px 0px rgba(255,255,255,0.25);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2),inset 0px 1px 0px rgba(255,255,255,0.25);
box-shadow: 0px 3px 3px rgba(0,0,0,0.2),inset 0px 1px 0px rgba(255,255,255,0.25);
opacity:.90
}

.next-button span.btntext {
font-weight:normal;
background:none;
display:inline;
}

.next-button span.btntext::after {
content: "";
position:absolute;
background:url('../images/arrow-right.png') 0 0 no-repeat;
display:block;
width:13px;
height:19px;
top:50%;
right:15px;
margin-top:-9px;
}

.next-button:active {
-webkit-box-shadow:inset 0 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow:inset 0 3px 3px rgba(0,0,0,0.2);
box-shadow:inset 0 3px 3px rgba(0,0,0,0.2);
position:relative;
top:1px;
}

/* color */
.greenBTN {
background: #669765;
background: -moz-linear-gradient(top, #669765 0%, #669765 50%, #5D895C 50%, #5D895C 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#669765), color-stop(50%,#669765), color-stop(50%,#5D895C), color-stop(100%,#5D895C));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#669765', endColorstr='#5D895C',GradientType=0 );
background: -o-linear-gradient(top, #669765 0%,#669765 50%,#5D895C 50%,#5D895C 100%);
}

.greenBTN:hover {
background: #77AF75;
background: -moz-linear-gradient(top, #77AF75 0%, #77AF75 50%, #6EA06D 50%, #6EA06D 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#77AF75), color-stop(50%,#77AF75), color-stop(50%,#6EA06D), color-stop(100%,#6EA06D));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#77AF75', endColorstr='#6EA06D',GradientType=0 );
background: -o-linear-gradient(top, #77AF75 0%,#77AF75 50%,#6EA06D 50%,#6EA06D 100%);
}

.blueBTN {
background: #618398;
background: -moz-linear-gradient(top, #618398 0%, #618398 50%, #587789 50%, #587789 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#618398), color-stop(50%,#618398), color-stop(50%,#587789), color-stop(100%,#587789));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#618398', endColorstr='#587789',GradientType=0 );
background: -o-linear-gradient(top, #618398 0%,#618398 50%,#618398 50%,#587789 100%);
}

.blueBTN:hover {
background: #7098AF;
background: -moz-linear-gradient(top, #7098AF 0%, #7098AF 50%, #688CA0 50%, #688CA0 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7098AF), color-stop(50%,#7098AF), color-stop(50%,#688CA0), color-stop(100%,#688CA0));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7098AF', endColorstr='#688CA0',GradientType=0 );
background: -o-linear-gradient(top, #7098AF 0%,#7098AF 50%,#688CA0 50%,#688CA0 100%);
}


4) Copy images to your template image folder (/templates/YOUR-THEME/images/) (right click and save images) (image must be renamed as "arrow-left.png" and "arrow-right.png" and upload to your theme image folder)
Previous and next news for DLE 9.7,9.8 and 10.0     Previous and next news for DLE 9.7,9.8 and 10.0
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+16

Comments 8

vishwas
vishwas
Members
Commented By vishwas on May 24, 2013 (6:06 am)
not workin in my 9.7
N/A 2Forum topics : 34Forum replies : 76Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on May 25, 2013 (12:23 am)
Quote: vishwas
not workin in my 9.7

it was fully tested with 9.7 and 9.8..and yes it works on 9.7
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
spamhater
spamhater
DLE TEAM
Commented By spamhater on August 22, 2013 (9:46 pm)
Reviewed and modified the instruction...tested with 9.6,9.7,9.8 and 10.0
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
test007
test007
Members
Commented By test007 on October 18, 2013 (9:36 pm)
i want inserte rel=next in Meta !!!!
N/A 1Forum topics : 6Forum replies : 10Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on October 18, 2013 (11:13 pm)
Why don't you tell me the tag in regular it supposed to use? because if I don't know the standard tag then I have no idea how to apply the tag in DLE, another word in English, there is tag like this
<meta name="description" content="Title name" />
then I can help apply the DLE tag
like
$metatags['description'] = "{$row['title']}";

So what are the actual tags for your question? If question is assuming everyone can make the guess in your mind then we will not response to any of those messages, like in forum example. if you need helps then ask the right questions and make it clear for anyone to understand otherwise no one will reply to any of your messages...
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
wizardbg
wizardbg
Members
Commented By wizardbg on December 31, 2013 (3:18 am)
tested and working with 10.1 beer
N/A 17Forum topics : 2Forum replies : 6Forum likes : 0
Ricky78
Ricky78
Members
Commented By Ricky78 on February 2, 2014 (7:46 pm)
Thanks works great.
N/A 2Forum topics : 0Forum replies : 0Forum likes : 0
Jimmy
Jimmy
Members
Commented By Jimmy on February 12, 2014 (12:08 pm)
I wonder if it's possible to add titles for those links.
for example:

Read prev. news: How I bla, bla, bla... |seperator| Read next. new: Next article name..
N/A 1Forum topics : 0Forum replies : 0Forum likes : 0
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.