File size: 3,930 Bytes
bdb1674
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php 
include 'include/menu.php'; 
$metakey=$db->prepare("SELECT * from meta where meta_id=4");
$metakey->execute(array(0));
$metakeyprint=$metakey->fetch(PDO::FETCH_ASSOC);
?>
<title><?php echo $metakeyprint['meta_title'] ?></title>
<meta name="description" content="<?php echo $metakeyprint['meta_descr'] ?>">
<meta name="keywords" content="<?php echo $metakeyprint['meta_keyword'] ?>">
</head>
<?php 
$sayfada = 6; // sayfada gösterilecek içerik miktarını belirtiyoruz.
$sorgu=$db->prepare("SELECT * from blog");
$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;
$blogsor1=$db->prepare("SELECT * from blog order by blog_tarih DESC limit $limit,$sayfada");
$blogsor1->execute();

?>

<!-- Page title -->
<section class="p-t-100 p-b-50 text-light" id="page-title" data-parallax-image="admin/assets/img/genel/data.jpg">
  <div id="particles-js" class="particles text-light"></div>
  <div class="container text-light">
    <div class="breadcrumb text-light">
      <ul>
        <li><a href="<?php echo $settingsprint['ayar_siteurl']; ?>">AnaSayfa</a> </li>
        <li class="active"><?php echo $widgetprint['widget_bblog']; ?></li>
      </ul>
    </div>
    <div class="page-title">
      <h1><?php echo $widgetprint['widget_bblog']; ?></h1>
    </div>
  </div>
</section>
<!-- end: Page title -->
<!-- Content -->
<section id="page-content">
  <div class="container">
    <!-- post content -->

    <!-- Blog -->
    <div id="blog" class="grid-layout post-3-columns m-b-30" data-item="post-item">

      <?php 
      while($blogcek=$blogsor1->fetch(PDO::FETCH_ASSOC)) { ?>
      <!-- Post item-->
      <div class="post-item border">
        <div class="post-item-wrap">
          <div class="post-image">
            <a href="<?=seo('blog-'.$blogcek["blog_baslik"]).'-'.$blogcek["blog_id"]?>">
              <img alt="<?php echo $blogcek['blog_baslik']; ?>" src="admin/<?php echo $blogcek['blog_resim']; ?>">
            </a>
          </div>
          <div class="post-item-description">
            <span class="post-meta-date"><i class="fa fa-calendar-o"></i><?php echo substr($blogcek['blog_tarih'], 0,10); ?></span>
            <h2><a href="<?=seo('blog-'.$blogcek["blog_baslik"]).'-'.$blogcek["blog_id"]?>"><?php 
            $karakter = strlen( $blogcek['blog_baslik'] );
            if ( $karakter > 35 )
            {
              echo mb_substr( $blogcek['blog_baslik'], 0, 35, 'UTF-8' ) . '...';
            }
            else
            {
              echo $blogcek['blog_baslik'];
            }
            ?>
          </a></h2>
          <p><?php echo substr($blogcek['blog_detay'], 0,100).'...'; ?></p>

          <a href="<?=seo('blog-'.$blogcek["blog_baslik"]).'-'.$blogcek["blog_id"]?>" class="item-link">Devamını Oku <i class="fa fa-arrow-right"></i></a>

        </div>
      </div>
    </div>
    <!-- end: Post item-->
    <?php } ?>

  </div>

  <!-- Pagination -->
  <div class="pagination pagination-simple">
    <ul>
     <?php
     $s=0;
     while ($s < $toplam_sayfa) {
      $s++; ?>
      <?php 
      if ($s==$sayfa) {?>
      <li class="active">
        <a href="blog?sayfa=<?php echo $s; ?>"><?php echo $s; ?></a>
      </li>
      <?php } else {?>
      <li>
        <a href="blog?sayfa=<?php echo $s; ?>"><?php echo $s; ?></a>
      </li>
      <?php   }
    }
    ?>

  </ul>
</div>
<!-- end: Pagination -->

</div>
<!-- end: post content -->

</section>
<!-- end: Content -->

<?php include 'include/footer.php'; ?>