JPLGC Meeting Minutes


Table of Contents
Introduction
meeting_minutes.txt PHP Code
Miscellaneous

Introduction

JPLGC meeting minutes are made available on the club web site. They are provided by club secretary as Microsoft Word files and uploaded to the web site. After a file has been uploaded it is immediately availabe the next time the meeting minute web page is accessed.

SFTP is used to upload meeting minute files to the sub folder "./meeting-minutes". No other files should be placed in this folder.

It is recommended that meeting minute file names be the date the meeting was held (yyyy-mm-dd). For example, 2010-02-04.docx. This will result in the files being displayed in proper date order.

The PHP code in the content file "meeting_minutes.txt" automatically creates a table of the files found on the "./meeting-minutes" folder.

meeting_minutes.txt PHP Code

The following PHP code in meeting_minutes.txt reads the names of files found in the "./meeting-minutes" folder and creates a HTML table containing the names. Each row in the table contains ROWMAX columns. If there are not enough file names to fill the last row, breaks are used to fill out the last row.

The code does not check for an empty folder. It assumes there will always be at least one file.


<center>
<table border="0" cellpadding="4" cellspacing="0" width="100%">

<?php

  $rowmax = 3;
  $count = 0;

  $dirname = "./meeting-minutes";

  if ($dir = opendir($dirname))
  {
    // read each file name in the folder
    // put the name in a table row (ROWMAX columns per row)

    while(false != ($file = readdir($dir)))
    {
      if(($file != ".") and ($file != ".."))
      {
        if ($count == 0) { echo "<tr>\n"; }
        $count += 1;
        echo "<td><a href=\"$dirname/$file\">$file</a></td>\n";
        if ($count >= $rowmax)
        {
          $count = 0;
          echo "</tr>\n";  
        }
      }
    }

    // does the last row contain ROWMAX columns
    // If not, fill out the last row

    if (($count > 0) and ($count < $rowmax))
    {
      while ($count < $rowmax)
      {
        $count += 1;
        echo "<td><br/></td>\n";
      }
      echo "</tr>\n"; 
    } 
  }

?>

</table>
</center>

Miscellaneous

This HTML File

This HTML file is "hard coded" and not created dynamically. This makes printing the file easier. (No extra "stuff" printed, missing files not a problem, etc.)