prepare('SELECT licenceID, licenceTitle FROM blog_licences WHERE licenceSlug = :licenceSlug'); $stmt->bindValue(':licenceSlug', $_GET['id'], PDO::PARAM_INT); $stmt->execute(); $row = $stmt->fetch(); /* //if post does not exists redirect user. if($row['licenceID'] == ''){ header('Location: ./'); exit; } */ if (!isset($row['licenceID']) || empty($row['licenceID'])) { header('Location: ./'); exit(); } elseif (!filter_var($row['licenceID'], FILTER_VALIDATE_INT)) { header('Location: ./'); exit(); } $pagetitle = 'Licence : '.html($row['licenceTitle']); 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_licences WHERE blog_posts_seo.postID = blog_post_licences.postID_BPL AND blog_post_licences.licenceID_BPL = :licenceID'); $stmt->execute(array(':licenceID' => $row['licenceID'])); $count = $stmt->rowCount(); //pass number of records to $pages->set_total($stmt->rowCount()); $stmt = $db->prepare(' SELECT blog_posts_seo.postID, blog_posts_seo.postTitle, blog_posts_seo.postAuthor, blog_posts_seo.postSlug, blog_posts_seo.postDesc, blog_posts_seo.postDate FROM blog_posts_seo, blog_post_licences WHERE blog_posts_seo.postID = blog_post_licences.postID_BPL AND blog_post_licences.licenceID_BPL = :licenceID ORDER BY postID DESC '.$pages->get_limit()); $stmt->execute(array(':licenceID' => $row['licenceID'])); echo '

'.$row['licenceTitle'].'

'; if (empty($count)) { echo '

Aucun torrent pour cette licence.

'; } while($row1 = $stmt->fetch()){ echo '
'; echo ''.html($row1['postTitle']).''; echo '
Posté le '.date_fr('l j F Y à H:i:s', strtotime($row1['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->execute(array(':postID' => $row1['postID'])); $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC); echo html($row1['postAuthor']).' dans '; $links = array(); foreach ($catRow as $cat) { $links[] = "".$cat['catTitle'].""; } echo implode(", ", $links); echo '
'; } echo '

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