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/catpost.php | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 Html/catpost.php (limited to 'Html/catpost.php') diff --git a/Html/catpost.php b/Html/catpost.php new file mode 100644 index 0000000..3e5c8e3 --- /dev/null +++ b/Html/catpost.php @@ -0,0 +1,137 @@ +prepare('SELECT catID,catTitle FROM blog_cats WHERE catSlug = :catSlug'); +$stmt->bindValue(':catSlug', $_GET['id'], PDO::PARAM_INT); +$stmt->execute(); +$row = $stmt->fetch(); + + +if (!isset($row['catID']) || empty($row['catID'])) { + header('Location: ./'); + exit(); +} + +elseif (!filter_var($row['catID'], FILTER_VALIDATE_INT)) { + header('Location: ./'); + exit(); +} + + +$pagetitle = 'Catégorie : '.html($row['catTitle']); + +include_once('includes/header.php'); + +define("_BBC_PAGE_NAME", $pagetitle); +define("_BBCLONE_DIR", "bbclone/"); +define("COUNTER", _BBCLONE_DIR."mark_page.php"); +if (is_readable(COUNTER)) include_once(COUNTER); +?> + + +
+ + + +
+
+ + + +
+ +

+ + + prepare('SELECT blog_posts_seo.postID FROM blog_posts_seo, blog_post_cats WHERE blog_posts_seo.postID = blog_post_cats.postID AND blog_post_cats.catID = :catID'); + $stmt->bindValue(':catID', $row['catID'], PDO::PARAM_INT); + $stmt->execute(); + + $count = $stmt->rowCount(); + + if (empty($count)) { + echo '

Aucun torrent dans cette catégorie.

'; + } + + + //pass number of records to + $pages->set_total($stmt->rowCount()); + + $stmt = $db->prepare(' + SELECT + blog_posts_seo.postID, blog_posts_seo.postHash, blog_posts_seo.postTitle, blog_posts_seo.postAuthor, blog_posts_seo.postSlug, blog_posts_seo.postLink, blog_posts_seo.postDesc, blog_posts_seo.postTaille, blog_posts_seo.postDate, blog_posts_seo.postViews, blog_posts_seo.postImage + FROM + blog_posts_seo, + blog_post_cats + WHERE + blog_posts_seo.postID = blog_post_cats.postID + AND blog_post_cats.catID = :catID + ORDER BY + postID DESC + '.$pages->get_limit()); + $stmt->bindValue(':catID', $row['catID'], PDO::PARAM_INT); + $stmt->execute(); + + while($row = $stmt->fetch()){ + + echo '
'; + echo ''.html($row['postTitle']).''; + echo '
Posté le '.date_fr('l j F Y à H:i:s', strtotime($row['postDate'])).' par '; + + $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); + + echo html($row['postAuthor']).' dans '; + + $links = array(); + foreach ($catRow as $cat) + { + $links[] = "".html($cat['catTitle']).""; + } + echo implode(", ", $links); + + echo ''; + + echo '

'; + echo ''.$row['postTitle'].''; + echo bbcode($row['postDesc']); + echo '

'; + + echo '
'; + + } + + echo '

'; + echo $pages->page_links('c-'.html($_GET['id']).'&'); + + } catch(PDOException $e) { + echo $e->getMessage(); + } + + ?> +
+ + + +
+
+
+ + + + + -- cgit v1.2.1