From 5fd9fa480f302902328b81f912dd67ce378284f8 Mon Sep 17 00:00:00 2001 From: citizenz7 Date: Thu, 20 Apr 2017 18:50:55 +0200 Subject: V.1.4.6 --- Html/archives.php | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Html/archives.php (limited to 'Html/archives.php') diff --git a/Html/archives.php b/Html/archives.php new file mode 100644 index 0000000..0347087 --- /dev/null +++ b/Html/archives.php @@ -0,0 +1,96 @@ + + +
+ + + +
+
+ + + +
+ + prepare('SELECT postID FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to'); + $stmt->execute(array( + ':from' => $from, + ':to' => $to + )); + + //pass number of records to + $pages->set_total($stmt->rowCount()); + + $stmt = $db->prepare('SELECT postID, postTitle, postSlug, postAuthor, postDesc, postDate FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to ORDER BY postID DESC '.$pages->get_limit()); + $stmt->execute(array( + ':from' => $from, + ':to' => $to + )); + + echo '

Archives : '.$month.'-'.$year.'


'; + + while($row = $stmt->fetch()){ + echo '
'; + echo ''.html($row['postTitle']).''; + echo '
Posté le '.date_fr('l j F Y à H:i:s', strtotime(html($row['postDate']))).' par '; + echo html($row['postAuthor']).' dans '; + + $stmt2 = $db->prepare('SELECT catTitle, catSlug FROM blog_cats, blog_post_cats WHERE blog_cats.catID = blog_post_cats.catID AND blog_post_cats.postID = :postID'); + $stmt2->bindValue(':postID', $row['postID'], PDO::PARAM_INT); + $stmt2->execute(); + $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC); + + $links = array(); + foreach ($catRow as $cat) + { + $links[] = "".html($cat['catTitle']).""; + } + echo implode(", ", $links); + echo '
'; + } + echo '

'; + + echo $pages->page_links("a-$month-$year&"); + + } catch(PDOException $e) { + echo $e->getMessage(); + } + ?> +
+ + + +
+
+
+ + + + + -- cgit v1.2.1