HOME SHELL

NULLCOMMUNITY
 LiteSpeed
 Linux server2.poyrazhosting.com 3.10.0-962.3.2.lve1.5.77.el7.x86_64 #1 SMP Mon Dec 12 07:06:14 EST 2022 x86_64
 safemode : OFF
 MySQL: OFF | Perl: OFF | cURL: ON | WGet: OFF
  >  / home / cuneytsener53 / restoran2.snrsoft.com.tr /

Server Ip : 104.21.78.54




Filename/home/cuneytsener53/restoran2.snrsoft.com.tr/blog.php
Size4.16 kb
Permissionrw-r--r--
Owner
Create time02-Mar-2025 05:46
Last modified06-Apr-2022 11:52
Last accessed05-Apr-2025 00:54
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php $page = 'blog'; include "includes/header.php"; ?>

<section class="page-title page-title-inner">
<div class="overlay-pagetitle"></div>
<div class="container-fluid">
<div class="row">
<div class="page-title-heading">
<h2 class="heading">Haberler</h2>
</div>
<div class="breadcrumbs">
<ul>
<li><a href="index.html">Anasayfa</a></li>
<li>Haberler</li>
</ul>
</div>
</div>
</div>
</section>

<section class="tf-section tf-blog">
<div class="container-fluid">
<div class="row">

<?php
$sayfada = 9; // 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)) {

?>
<div class="col-md-4" style="margin-bottom: 50px">
<div class="post wow fadeIn animated" data-wow-delay="0.3ms" data-wow-duration="1500ms">
<div class="featured-post">
<img style="width: 100%;height: 280px;object-fit: cover;" src="<?php echo $site; ?>/panel/uploads/news_v/730x411/<?php echo $refcek['img_url']; ?>" alt="<?php echo $refcek['title'];?>">
</div>
<div class="content-post bg-blog">
<ul class="meta-post">
<li class="date"><a href="blog-icerik/<?=seo($refcek['title'])."-".$refcek['id']?>"><?php echo date('d.m.Y H:i', strtotime($refcek['createdAt']));?></a></li>
</ul>
<h6 class="title">
<a href="blog-icerik/<?=seo($refcek['title'])."-".$refcek['id']?>">
<?php echo $refcek['title'];?>
</a>
</h6>
<p style="font-size: 0.6em;line-height: 1.2em" ><?php echo substr(strip_tags($refcek['description']),0,150); ?>...</p>
<div class="btn-blog">
<a href="blog-icerik/<?=seo($refcek['title'])."-".$refcek['id']?>" class="tf-button color-style color-style4">Devamını Oku</a>
</div>
</div>
</div>
</div>
<?php } ?>

</div>

<div class="themesflat-pagination clearfix">
<ul class="text-center">
<?php
$s=0;
while ($s < $toplam_sayfa) {
$s++; ?>
<?php
if ($s==$sayfa) {?>
<li>
<a class="page-numbers current active"><?php echo $s; ?></a>
</li>
<?php } else {?>
<li>
<a href="blog?k=<?php echo $katid; ?>&sayfa=<?php echo $s ?>" class="page-numbers"><?php echo $s; ?></a>
</li>
<?php } } ?>

</ul>
</div>

</div>
</section>

<?php include "includes/footer.php"; ?>