<commit_before><?php
require_once('includes/config.php');
?>

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>
        <?php echo SITENAME; ?>
    </title>
    <meta name="description" content="Website Development and Design blog written by <NAME>, includes game
                    reviews and book reviews" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

    <link rel="stylesheet" href="css/normalize.css" />
    <link rel="stylesheet" href="css/main.css">
    <link rel="alternate" href="rss.php" title="My RSS feed" type="application/rss+xml" />
    <script src="js/vendor/modernizr-2.6.2.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<div id="wrapper">


    <h1><?php echo SITENAME; ?></h1>
    <div id="nav">
        <ul>
            <?php require_once('nav.php'); ?>
    </div>

    <div id='main'>

        <?php
        if(isset($_GET['month']) || isset($_GET['year'])) {
            try {
                //collect month and year data
                $month = $_GET['month'];
                $year = $_GET['year'];
                //set from and to dates
                $from = date('Y-m-01 00:00:00', strtotime("$year-$month"));
                $to = date('Y-m-31 23:59:59', strtotime("$year-$month"));
                $pages = new Paginator('1', 'p');
                $stmt = $db->prepare('SELECT postID FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to AND published = 1');
                $stmt->execute(array(
                    ':from' => $from,
                    ':to' => $to
                ));
                //pass number of records to
                $pages->set_total($stmt->rowCount());
                $stmt = $db->prepare('SELECT p.postID, m.username, p.postTitle,
                        p.postDesc, p.postDate FROM blog_posts_seo p,
                        blog_members m WHERE p.poster = m.memberID AND postDate
                        >= :from AND postDate <= :to  AND published = 1 ORDER BY postID DESC ' .
                    $pages->get_limit());
                $stmt->execute(array(
                    ':from' => $from,
                    ':to' => $to
                ));
                while ($row = $stmt->fetch()) {
                    echo '<h1><a href="viewpost.php?id=' . $row['postID'] . '">' . $row['postTitle'] . '</a></h1>';
                    echo '<p>Posted on ' . date('jS M Y H:i:s', strtotime($row['postDate'])) . ' by <b>' . $row['username'] . '</b> in ';
                    $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' => $row['postID']));
                    $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC);
                    $links = array();
                    foreach ($catRow as $cat) {
                        $links[] = "<a href='c-" . $cat['catSlug'] . "'>" . $cat['catTitle'] . "</a>";
                    }
                    echo implode(", ", $links);
                    echo '</p>';
                    echo '<p>' . $row['postDesc'] . '</p>';
                    echo '<p><a href="viewpost.php?id=' . $row['postID'] . '">Read More</a></p>';
                }
                echo $pages->page_links("a-$month-$year&");
            } catch (PDOException $e) {
                echo $e->getMessage();
            }
        } else {
            echo('<p>Please choose a Month to view</p><ul>');

            $stmt = $db->query("SELECT count(postDate) as Count, Month(postDate) as Month, Year(postDate) as Year FROM blog_posts_seo GROUP BY Month(postDate), Year(postDate) ORDER BY postDate DESC");
            while($row = $stmt->fetch()){
                $monthName = date("F", mktime(0, 0, 0, $row['Month'], 10));
                $slug = 'a-'.$row['Month'].'-'.$row['Year'];
                echo "<li><a href='$slug'>$monthName " . $row['Year'] . ' ' . $row['Count'] . " posts</a></li>";
            }
            echo('</ul>');
        }
        ?>

    </div>
    <div id='clear'></div>

</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>

<!-- Piwik -->
<script type="text/javascript"><commit_msg>blog-43 adding seperation<commit_after><?php
require_once('includes/config.php');
?>

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>
        <?php echo SITENAME; ?>
    </title>
    <meta name="description" content="Website Development and Design blog written by <NAME>, includes game
                    reviews and book reviews" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

    <link rel="stylesheet" href="css/normalize.css" />
    <link rel="stylesheet" href="css/main.css">
    <link rel="alternate" href="rss.php" title="My RSS feed" type="application/rss+xml" />
    <script src="js/vendor/modernizr-2.6.2.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<div id="wrapper">


    <h1><?php echo SITENAME; ?></h1>
    <div id="nav">
        <ul>
            <?php require_once('nav.php'); ?>
    </div>

    <div id='main'>

        <?php
        if(isset($_GET['month']) || isset($_GET['year'])) {
            try {
                //collect month and year data
                $month = $_GET['month'];
                $year = $_GET['year'];
                //set from and to dates
                $from = date('Y-m-01 00:00:00', strtotime("$year-$month"));
                $to = date('Y-m-31 23:59:59', strtotime("$year-$month"));
                $pages = new Paginator('1', 'p');
                $stmt = $db->prepare('SELECT postID FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to AND published = 1');
                $stmt->execute(array(
                    ':from' => $from,
                    ':to' => $to
                ));
                //pass number of records to
                $pages->set_total($stmt->rowCount());
                $stmt = $db->prepare('SELECT p.postID, m.username, p.postTitle,
                        p.postDesc, p.postDate FROM blog_posts_seo p,
                        blog_members m WHERE p.poster = m.memberID AND postDate
                        >= :from AND postDate <= :to  AND published = 1 ORDER BY postID DESC ' .
                    $pages->get_limit());
                $stmt->execute(array(
                    ':from' => $from,
                    ':to' => $to
                ));
                while ($row = $stmt->fetch()) {
                    echo '<h1><a href="viewpost.php?id=' . $row['postID'] . '">' . $row['postTitle'] . '</a></h1>';
                    echo '<p>Posted on ' . date('jS M Y H:i:s', strtotime($row['postDate'])) . ' by <b>' . $row['username'] . '</b> in ';
                    $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' => $row['postID']));
                    $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC);
                    $links = array();
                    foreach ($catRow as $cat) {
                        $links[] = "<a href='c-" . $cat['catSlug'] . "'>" . $cat['catTitle'] . "</a>";
                    }
                    echo implode(", ", $links);
                    echo '</p>';
                    echo '<p>' . $row['postDesc'] . '</p>';
                    echo '<p><a href="viewpost.php?id=' . $row['postID'] . '">Read More</a></p>';
                }
                echo $pages->page_links("a-$month-$year&");
            } catch (PDOException $e) {
                echo $e->getMessage();
            }
        } else {
            echo('<p>Please choose a Month to view</p><ul>');

            $stmt = $db->query("SELECT count(postDate) as Count, Month(postDate) as Month, Year(postDate) as Year FROM blog_posts_seo GROUP BY Month(postDate), Year(postDate) ORDER BY postDate DESC");
            while($row = $stmt->fetch()){
                $monthName = date("F", mktime(0, 0, 0, $row['Month'], 10));
                $slug = 'a-'.$row['Month'].'-'.$row['Year'];
                echo "<li><a href='$slug'>$monthName " . $row['Year'] . '    (' . $row['Count'] . " posts)</a></li>";
            }
            echo('</ul>');
        }
        ?>

    </div>
    <div id='clear'></div>

</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>

<!-- Piwik -->
<script type="text/javascript">
{'fraction_non_alphanumeric': 0.20107026062828262, 'fraction_numerical': 0.011098999108116143, 'mean_word_length': 1.927763272410792, 'pattern_counts': {'":': 0, '<': 189, '<?xml version=': 0, '>': 227, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1243362', 'n_tokens_mistral': 3330, 'n_tokens_neox': 3114, 'n_words': 703}