Wheatblog PHP Cross Reference Blogging Systems

Source: /list_category.php - 45 lines - 1135 bytes - Summary - Text - Print

   1  <?php
   2  //
   3  // File:    list_category.php
   4  // License: GNU GPL
   5  // Purpose: Lists all categories as clickable links which will retreive posts
   6  //    that fit under that category
   7  //
   8  require_once ('./settings.php');
   9  $page_title = '';
  10  include_once("$wb_inc_dir/header.php");
  11  
  12  
  13      $db = DB_connect($site, $user, $pass);
  14      DB_select_db($database, $db);
  15  
  16      // select recent posts in the database
  17      $result = DB_query("select * 
  18          from $tblCategories
  19          order by category", $db);
  20  
  21  
  22      // open output div
  23      echo "\n\n<div class=\"indent\">\n" . "<span class=\"cnt-subhead\">\n";
  24    
  25      // loop through results and list each category
  26      //
  27      while( $row = DB_fetch_array($result) )
  28      {
  29          $the_category      = $row['id'];
  30          $the_category_name = $row['category'];
  31   
  32          echo "<a href=\"view_by_category.php?the_category=$the_category\">" .
  33              "$the_category_name</a><br />\n";
  34      }
  35  
  36      // Close the output div
  37      echo("</span>\n</div>\n\n");
  38      
  39      echo "<br />\n<div class='description'>powered by <a " .
  40          "href='http://wheatblog.sourceforge.net' title='blogware for the rest " .
  41          "of us'>wheatblog</a></div>");
  42  
  43  
  44  include_once("$wb_inc_dir/footer.php");
  45  ?>

title

Description

title

Description

title

Description

title

title

Body