Wheatblog PHP Cross Reference Blogging Systems

Source: /view_by_archive.php - 67 lines - 1783 bytes - Summary - Text - Print

   1  <?php
   2  //
   3  // File:    view_by_archive.php
   4  // License: GNU GPL
   5  //
   6  require_once ('./settings.php');
   7  $page_title = ':: archive view';
   8  include_once("$wb_inc_dir/header.php");
   9  
  10      $the_month = $_GET['the_month'];
  11      $the_year  = $_GET['the_year'];
  12      $The_month = $db->quote($the_month);
  13      $The_year  = $db->quote($the_year);
  14  
  15  
  16      // select recent posts in the database
  17      $db->query("select * from $tblPosts
  18          where year=$The_year and month=$The_month
  19          order by year DESC, month DESC, date DESC, id DESC");
  20  
  21      // output the current entries
  22  
  23      echo ("
  24          <div class=\"indent2\">
  25          <span class='cnt-subhead'>Filter: View by Archive</span><br>
  26          [archived entires for : $the_month.$the_year] 
  27          [<a href=\"$blog_index_page_name\"]>remove</a>]
  28          </div>
  29      ");
  30  
  31  
  32      $db2 = new DatabaseClass;
  33  
  34      while( $row = $db->fetchArray() )
  35      {
  36          $the_id       = $row['id'];
  37          $the_day      = $row['day'];
  38          $the_month    = $row['month'];
  39          $the_date     = $row['date'];
  40          $the_year     = $row['year'];
  41          $The_category = $db->quote($row['category']);
  42          
  43          // parse out the category id into its string value
  44          $db2->query("select * from $tblCategories where id=$The_category");
  45  
  46          while( $row2 = $db2->fetchArray() )
  47              $the_category_name = $row2['category'];
  48          
  49          $the_showpref = $row['showpref'];
  50          $the_title    = $row['title'];
  51          $the_body     = $row['body'];
  52          $comments     = $row['comments'];
  53  
  54          // post
  55          echo ("
  56              <div class=\"indent\">
  57              <span class=\"cnt-subhead\">$the_day, $the_month.$the_date.$the_year :: $the_title</span><br>
  58              $the_body<br>
  59              [<a href=\"view_by_category.php?the_category=$the_category\">$the_category_name</a>] 
  60              [<a href=\"view_by_permalink.php?the_id=$the_id\">comments ($comments)</a>]
  61              </div>
  62          ");
  63      }
  64  
  65  
  66  include_once("$wb_inc_dir/footer.php");
  67  ?>

title

Description

title

Description

title

Description

title

title

Body