source view: blog.archive.php


<?php



  require 'db.connect.php';
  require '_pagewrapper.php';
  wrapPageTop( 'current.php', 'blog archive' );
  
  
  
?>
    <style type="text/css">
      ul
      {
        list-style:    none;
        margin-bottom: 2em;
        margin-top:    0em;
      }

      ul li
      {
        margin-left: -2.5em;
      }
    </style>
<?php
        $blog_history_query_string = <<<EOQ
SELECT
  LOWER(DATE_FORMAT(bp.postDateTime,'%M %Y')),
  DATE_FORMAT(bp.postDateTime,'%M %D'),
  CONCAT( 'current/', bp.postURL ),
  bp.blogPostTitle,
  (
    SELECT COUNT(*)
    FROM tblBlogPostComments
    WHERE blogPostID = bp.blogPostID
  )
FROM
  tblBlogPosts bp
WHERE
  bp.isVisible = 1
ORDER BY
  bp.postDateTime DESC
EOQ;
        $blog_history_query = mysql_query($blog_history_query_string);

        $last_month_header = '';
        while ( $blog_history_row = mysql_fetch_row($blog_history_query) ) {
          if ( $last_month_header != $blog_history_row[0] ) {
            if ( strlen($last_month_header) > 0 ) {
?>
          </ul>
<?php
            }

            $last_month_header = $blog_history_row[0];
?>
<h3><?php print $last_month_header; ?></h3>
          <ul>
<?php
        
          }
?>
          <li><?php print $blog_history_row[1];?>: <a href="http://1.618034.com/<?php print $blog_history_row[2];?>" target="_top"><?php print $blog_history_row[3];?></a><!-- (<?php print $blog_history_row[4];?> comment<?php print $blog_history_row[4] == 1 ? '' : 's';?>)--></li>
<?php
        }
?>
          </ul>
<?php



  wrapPageBottom();
  
  
  
?>