Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. <?php
  2. include 'bd/blocks/bd.php';
  3. $result = mysqli_query($db,"SELECT keywords,description,author FROM page WHERE page='blog'");
  4. $myrow = mysqli_fetch_array($result);
  5. if(isset($_GET['date']) && !empty($_GET['date'])){
  6. $date = $_GET['date'];
  7. }
  8. elseif (!isset($_GET['date']) && empty($_GET['date'])) {
  9. header("Location: index.php");
  10. exit;
  11. }
  12. else{
  13. header("Location: index.php");
  14. exit;
  15. }
  16. $date= "$date";
  17. $dates=substr($date,0,7);
  18. $result2 = mysqli_query($db,"SELECT date FROM blog WHERE date='$dates' ");
  19. $myrow2=mysqli_fetch_array($result2);
  20. echo mysqli_num_rows($result2);
  21. if(mysqli_num_rows($result2)){
  22. header("Location: index.php");
  23. exit;
  24. }
  25. $date_title=$date;
  26. $date_begin =$date;
  27. $date++;
  28. $date_end=$date;
  29. $date_begin=$date_begin.'-00';
  30. $date_end=$date_end.'-00';
  31. ?>
  32. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  33. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  34. <head>
  35. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  36. <meta http-equiv="Content-Language" content="en" />
  37. <meta name="description" content="<?php echo $myrow['description']; ?>" />
  38. <meta name="keywords" content="<?php echo $myrow['keywords']; ?>" />
  39. <meta name="author" content="<?php echo $myrow['author']; ?>" />
  40. <title><?php echo 'archive for '. $date_title .'';?></title>
  41. <!-- HEADER -->
  42. <?php include 'bd/blocks/head.php'; ?>
  43. <!--ENDS HEADER -->
  44. </head>
  45. <body>
  46. <!-- WRAPPER -->
  47. <div id="wrapper">
  48.  
  49.  
  50.  
  51. <!-- navigation & HEADER -->
  52. <?php include 'bd/blocks/header.php'; ?>
  53. <!-- ENDS navigation & HEADER-->
  54. <!-- MAIN -->
  55. <div id="main">
  56.  
  57.  
  58. <!-- posts -->
  59. <div id="posts">
  60.  
  61. <!-- single-post -->
  62. <?php
  63. $result = mysqli_query($db,"SELECT id,text,author,view,img,choose,title,date FROM blog WHERE date>'$date_begin' AND date<'$date_end' ORDER BY id DESC");
  64. while($myrow = mysqli_fetch_array($result)){
  65. $let55=explode(" ",$myrow["text"]);
  66. $me=0;
  67. $newtxt="";
  68. while($me<55){
  69. $newtxt.="".$let55[$me]." ";
  70. $me+=1;
  71. }
  72. printf('
  73. <div class="post">
  74. <p class="post-title custom">%s</p>
  75. <p class="post-meta">%s <span>by %s</span></p>
  76. <p class="post-comments custom">%s</p><br><br>
  77. <div class="%s-img"><a href="single.php?id=%s"><img src="%s" alt="" widht="610" height="230"/></a><span></span></div>
  78. <p class="brief">%s...</p>
  79. <p><a href="single.php?id=%s" class="more">More</a></p>
  80. </div>',$myrow["title"] , $myrow["date"] , $myrow["author"] ,$myrow["view"] ,$myrow["choose"] , $myrow["id"] , $myrow["img"] , $newtxt , $myrow["id"]);}
  81. ?>
  82. <!-- ENDS single-post -->
  83.  
  84. <!-- blog-pager -->
  85. <ul class="blog-pager">
  86. <li><a href="#">NEWER</a></li>
  87. <li><a href="#">OLDER</a></li>
  88. </ul>
  89. <!-- ENDS blog-pager -->
  90.  
  91.  
  92.  
  93. </div>
  94. <!-- ENDS posts -->
  95.  
  96. <!-- sidebar -->
  97. <?php include 'bd/blocks/side-block.php'; ?>
  98. <!-- ENDS sidebar -->
  99.  
  100.  
  101. </div>
  102. <!-- ENDS sidebar -->
  103.  
  104.  
  105.  
  106. </div>
  107. <!-- ENDS MAIN -->
  108.  
  109. </div>
  110. <!-- ENDS WRAPPER -->
  111.  
  112.  
  113.  
  114. <!-- FOOTER -->
  115. <?php include 'bd/blocks/footer.php'; ?>
  116. <!-- ENDS FOOTER -->
  117. </body>
  118. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement