Mini Shell
<?php $page = 'blog'; include "includes/header.php"; ?>
<?php
$refsor2=$db->prepare("SELECT * FROM news where id=:id");
$refsor2->execute(array('id' => $_GET['id']));
$refcek2=$refsor2->fetch(PDO::FETCH_ASSOC);
?>
<!--Page Title-->
<section class="page-title" style="background-image:url(images/background/22.png);">
<div id='stars'></div>
<div id='stars2'></div>
<div id='stars3'></div>
<div class="auto-container">
<div class="inner-container clearfix">
<div class="title-box">
<h1><?php echo $refcek2['title']; ?></h1>
<ul class="bread-crumb clearfix">
<li><a href="<?=$site?>">Anasayfa</a></li>
<li><a href="<?=$site?>/blog">Blog</a></li>
<li><?php echo $refcek2['title']; ?></li>
</ul>
</div>
</div>
</div>
</section>
<!--End Page Title-->
<!-- Sidebar Page Container -->
<div class="sidebar-page-container">
<div class="auto-container">
<div class="row clearfix">
<!--Content Side-->
<div class="content-side col-lg-8 col-md-12 col-sm-12">
<div class="blog-detail">
<!-- News Block -->
<div class="news-block style-three">
<div class="inner-box">
<div class="image-box">
<figure class="image"><img src="<?php echo $site; ?>/panel/uploads/news_v/730x411/<?php echo $refcek2['img_url']; ?>" alt="<?php echo $refcek2['title']; ?>"></figure>
<div class="overlay-box">
<span class="share-button"><i class="fas fa-share-alt"></i></span>
<ul class="social-links">
<li><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $site;?>/blog-icerik/<?=seo($refcek2['title']).'-'.$refcek2['id'].''?>"><i class="fab fa-facebook-f"></i></a></li>
<li><a target="_blank" href="https://twitter.com/intent/tweet?url=<?php echo $site;?>/blog-icerik/<?=seo($refcek2['title']).'-'.$refcek2['id'].''?>"><i class="fab fa-twitter"></i></a></li>
<li><a target="_blank" href="https://plus.google.com/share?url=<?php echo $site;?>/blog-icerik/<?=seo($refcek2['title']).'-'.$refcek2['id'].''?>"><i class="fab fa-google-plus"></i></a></li>
<li><a target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo $site;?>/blog-icerik/<?=seo($refcek2['title']).'-'.$refcek2['id'].''?>"><i class="fab fa-linkedin"></i></a></li>
</ul>
</div>
</div>
<div class="caption-box">
<ul class="info">
<li><i class="fas fa-calendar-alt"></i><?php echo date('d.m.Y H:i', strtotime($refcek2['createdAt']));?></li>
</ul>
<h4><a><?php echo $refcek2['title']; ?></a></h4>
<?php echo $refcek2['description']; ?>
</div>
</div>
</div>
</div>
</div>
<!--Sidebar Side-->
<div class="sidebar-side col-lg-4 col-md-12 col-sm-12">
<aside class="sidebar default-sidebar">
<!-- Latest News -->
<div class="sidebar-widget latest-news">
<div class="sidebar-title">
<h3>Son Yazılar</h3>
</div>
<div class="widget-content">
<?php
$sayfada = 5; // sayfada gösterilecek içerik miktarını belirtiyoruz.
$sorgu=$db->prepare("select * from news");
$sorgu->execute();
$toplam_icerik=$sorgu->rowCount();
$toplam_sayfa = ceil($toplam_icerik / $sayfada);
// eğer sayfa girilmemişse 1 varsayalım.
$sayfa = isset($_GET['sayfa']) ? (int) $_GET['sayfa'] : 1;
// eğer 1'den küçük bir sayfa sayısı girildiyse 1 yapalım.
if($sayfa < 1) $sayfa = 1;
// toplam sayfa sayımızdan fazla yazılırsa en son sayfayı varsayalım.
if($sayfa > $toplam_sayfa) $sayfa = $toplam_sayfa;
$limit = ($sayfa - 1) * $sayfada;
$refsor=$db->prepare("select * from news order by id DESC limit $limit,$sayfada");
$refsor->execute();
while ($refcek=$refsor->fetch(PDO::FETCH_ASSOC)) {
?>
<article class="post" style="margin-bottom: 8px">
<div class="post-thumb"><a href="blog-icerik/<?=seo($refcek['title'])."-".$refcek['id']?>"><img style="width: 100%;height: 70px;object-fit: cover;" src="<?php echo $site; ?>/panel/uploads/news_v/730x411/<?php echo $refcek['img_url']; ?>" alt=""></a></div>
<h3><a href="blog-icerik/<?=seo($refcek['title'])."-".$refcek['id']?>"><?php echo $refcek['title'];?></a></h3>
<div class="post-info"><?php echo date('d.m.Y H:i', strtotime($refcek['createdAt']));?></div>
</article>
<?php } ?>
</div>
</div>
</aside>
</div>
</div>
</div>
</div>
<!-- End Sidebar Container -->
<?php include "includes/footer.php"; ?>