YaRGuCi
Üye
-
- Katılım
- Mart 23, 2019
-
- Mesajlar
- 62
-
- Tepkime puanı
- 80
-
- Puanları
- 268
-
- Yaş
- 38
-
- Konum
- İSTANBUL - BAŞAKŞEHİR
Bu eklenti sayesinde gerek ana sayfanızda konularınız için önceki ve sonraki konuları resimli olarak, gerek ise konu içinde önceki ve sonraki konuları resimli olarak gösterebilirsiniz.
fullstory.tpl ye ekleyebileceğiniz taglar :
Önceki Konu için ön ekimiz prev
Sonraki Konu için next kodlarında bu şekilde değişiklik yaparak kullanabilirsiniz.
temanızın fullstory.tpl dosyasından {full-story} yi bulun ve daha sonra aşağıda vermiş olduğum kodu yapıştırın.
yukarda vermiş olduğum CSS kodlarını kendinize göre düzenleyebilirsiniz.Bu işlemi yaptıktan sonra;
FTP yardımıyla engine/modules/show.full.php dosyasını buluyoruz.
satırının üstüne;
yukarda vermiş olduğum kodu yapıştırıp kaydediyoruz.İşlem bu kadar kolay gelsin şimdiden.
fullstory.tpl ye ekleyebileceğiniz taglar :
Kod:
[B][COLOR="Red"][prev-news][/COLOR][/B] yazı[COLOR="red"][B] [/prev-news][/B][/COLOR] - Eğer önceki makale varsa yazı gözükecektir. İlk eklenen makalede önceki konu olmayacaktır.
[B][COLOR="red"]{prev-link}[/COLOR][/B] - Önceki makalenin linki ( URL )
[B][COLOR="red"]{prev-title}[/COLOR][/B] - Önceki makalenin başlığı, limit tagı ile kullanılabilir. ( {prev-title limit="20"} gibi )
[B][COLOR="red"]{prev-img} [/COLOR][/B]- Önceki makaledeki ilk resim. ( Sadece short story alanı okunarak resim bulunur )
[B][COLOR="red"]{prev-text limit="100"} [/COLOR][/B]- Önceki makalenin shortstory içeriği limit tagı olmadan da kullanılabilir.
[B][COLOR="red"]{prev-cat}[/COLOR][/B] - Önceki makalenin kategorisi, link olarak gözükecektir.
[B][COLOR="red"]{prev-date}[/COLOR][/B] - Önceki makalenin eklenme tarihi, Sistemde tanımlı olan format ile uyumludur. ( {next-date=Y.m.d} gibi )
Önceki Konu için ön ekimiz prev
Sonraki Konu için next kodlarında bu şekilde değişiklik yaparak kullanabilirsiniz.
temanızın fullstory.tpl dosyasından {full-story} yi bulun ve daha sonra aşağıda vermiş olduğum kodu yapıştırın.
Kod:
<div class="next-prev-news">
<style>
.next-prev-news { }
.prev-news { float: left; width: 320px; border: 1px solid #ccc; border-radius: 4px; padding: 5px; }
.prev-news img { width: 300px; height: 90px; }
.next-news { float: right; width: 320px; border: 1px solid #ccc; border-radius: 4px; padding: 5px; }
.next-news img { width: 300px; height: 90px; }
</style>
[prev-news]
<div class="prev-news">
<a href="{prev-link}"><h3>{prev-title}</h3></a>
<img src="{prev-img}" alt="" />
<p>{prev-text limit="100"}</p>
<p>{prev-cat}</p>
<i>{prev-date}</i>
</div>
[/prev-news]
[next-news]
<div class="next-news">
<a href="{next-link}"><h3>{next-title}</h3></a>
<img src="{next-img}" alt="" />
<p>{next-text limit="50"}</p>
<p>{next-cat}</p>
<i>{next-date}</i>
</div>
[/next-news]
<div style="clear: both;"></div>
</div>
yukarda vermiş olduğum CSS kodlarını kendinize göre düzenleyebilirsiniz.Bu işlemi yaptıktan sonra;
FTP yardımıyla engine/modules/show.full.php dosyasını buluyoruz.
Kod:
$tpl->set( '{login}', $row['autor'] );
satırının üstüne;
Kod:
// Önceki sonraki konu eklentisi
function get_full_link( $id, $category, $alt_name, $date ) {
global $config;
if ( $config['allow_alt_url'] ) {
if ( $config['seo_type'] == 1 OR $config['seo_type'] == 2 ) {
if ( $category and $config['seo_type'] == 2 ) {
$full_link = $config['http_home_url'] . get_url( $category ) . "/" . $id . "-" . $alt_name . ".html";
} else {
$full_link = $config['http_home_url'] . $id . "-" . $alt_name . ".html";
}
} else {
$full_link = $config['http_home_url'] . date( 'Y/m/d/', $date ) . $alt_name . ".html";
}
} else {
$full_link = $config['http_home_url'] . "index.php?newsid=" . $id;
}
return $full_link;
}
function get_story( $count, $story ) {
global $config;
$story = str_replace( "</p><p>", " ", $story );
$story = strip_tags( $story, "<br>" );
$story = trim(str_replace( "<br>", " ", str_replace( "<br />", " ", str_replace( "\n", " ", str_replace( "\r", "", $story ) ) ) ));
if ( $count AND dle_strlen( $story, $config['charset'] ) > $count ) {
$story = dle_substr( $story, 0, $count, $config['charset'] );
if ( ($temp_dmax = dle_strrpos( $story, ' ', $config['charset'] )) ) $story = dle_substr( $story, 0, $temp_dmax, $config['charset'] );
}
return $story;
}
function get_title( $count, $title ) {
global $config;
if ( $count AND dle_strlen( $title, $config['charset'] ) > $count ) {
$title = dle_substr( $title, 0, $count, $config['charset'] );
if ( ($temp_dmax = dle_strrpos( $title, ' ', $config['charset'] )) ) $title = dle_substr( $title, 0, $temp_dmax, $config['charset'] );
}
return $title;
}
$prev_news = $db->super_query("SELECT title, category, id, alt_name, autor, date, xfields, short_story FROM " . PREFIX . "_post WHERE id < " . NEWS_ID . " ORDER BY id DESC LIMIT 0,1");
$next_news = $db->super_query("SELECT title, category, id, alt_name, autor, date, xfields, short_story FROM " . PREFIX . "_post WHERE id > " . NEWS_ID . " ORDER BY id ASC LIMIT 0,1");
if ( $prev_news ) {
$tpl->set( '{prev-link}', get_full_link( $prev_news['id'], $prev_news['category'], $prev_news['alt_name'], $prev_news['date'] ) );
$tpl->set( '{prev-cat}', get_categories( $prev_news['category'] ) );
if ( preg_match( "#\\{prev-text limit=['\"](.+?)['\"]\\}#i", $tpl->copy_template, $matches ) ) { $count = intval($matches[1]); $tpl->set( $matches[0], get_story( $count, $prev_news['short_story'] ) ); }
else $tpl->set( '{prev-text}', $prev_news['short_story'] );
if ( preg_match( "#\\{prev-title limit=['\"](.+?)['\"]\\}#i", $tpl->copy_template, $matches ) ) { $count = intval( $matches[1] ); $tpl->set( $matches[0], get_title( $count, $prev_news['title'] ) ); }
else $tpl->set( '{prev-title}', strip_tags( stripslashes( $prev_news['title'] ) ) );
if ( preg_match( "#<img src=\"(.+?)\"\s#", $prev_news['short_story'], $m ) ) { $tpl->set( '{prev-img}', $m[1] ); }
else { $tpl->set( '{prev-img}', "{THEME}/dleimages/no_image.jpg" ); }
$tpl->set( '{prev-date}', langdate( $config['timestamp_active'], strtotime( $prev_news['date'] ) ) );
$news_date = $prev_news['date'];
$tpl->copy_template = preg_replace_callback ( "#\{prev-date=(.+?)\}#i", "formdate", $tpl->copy_template );
$tpl->set_block( "'\\[prev-news\\](.*?)\\[/prev-news\\]'si", "\\1" );
} else $tpl->set_block( "'\\[prev-news\\].*?\\[/prev-news\\]'si", "" );
if ( $next_news ) {
$tpl->set( '{next-link}', get_full_link( $next_news['id'], $next_news['category'], $next_news['alt_name'], $next_news['date'] ) );
$tpl->set( '{next-cat}', get_categories( $next_news['category'] ) );
if ( preg_match( "#\\{next-text limit=['\"](.+?)['\"]\\}#i", $tpl->copy_template, $matches ) ) { $count = intval($matches[1]); $tpl->set( $matches[0], get_story( $count, $next_news['short_story'] ) ); }
else $tpl->set( '{next-text}', $next_news['short_story'] );
if ( preg_match( "#\\{next-title limit=['\"](.+?)['\"]\\}#i", $tpl->copy_template, $matches ) ) { $count = intval( $matches[1] ); $tpl->set( $matches[0], get_title( $count, $next_news['title'] ) ); }
else $tpl->set( '{next-title}', strip_tags( stripslashes( $next_news['title'] ) ) );
if ( preg_match( "#<img src=\"(.+?)\"\s#", $next_news['short_story'], $m ) ) { $tpl->set( '{next-img}', $m[1] ); }
else { $tpl->set( '{next-img}', "{THEME}/dleimages/no_image.jpg" ); }
$tpl->set( '{next-date}', langdate( $config['timestamp_active'], strtotime( $next_news['date'] ) ) );
$news_date = $next_news['date'];
$tpl->copy_template = preg_replace_callback ( "#\{next-date=(.+?)\}#i", "formdate", $tpl->copy_template );
$tpl->set_block( "'\\[next-news\\](.*?)\\[/next-news\\]'si", "\\1" );
} else $tpl->set_block( "'\\[next-news\\].*?\\[/next-news\\]'si", "" );
// Önceki sonraki konu eklentisi
yukarda vermiş olduğum kodu yapıştırıp kaydediyoruz.İşlem bu kadar kolay gelsin şimdiden.