Simple Calendar Script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I need one.  It should have a simple admin area, in which to enter events
and a basic calendar viewing area.   Its for our gaming that we
can put up a calendar of events for the month, on our website.  All of the
calendar programs I've seen are overkill.   A php solution would be


Re: Simple Calendar Script

You said basic!  All you do is keep the   *month*.txt
file updated with a text editor.  One line per day.

------------- August.txt --------------
15 test
22 <center><img src='button.gif' width=20></center>
28 <a href=' '>click</a> for info

----------- testpage.php --------------
<table><tr><td width=350 height=400>

<?php include("calander.php"); ?>


----------- calander.php ------------


$strFile1 = date("F") . ".txt";

// open for read
$objFH = fopen( $strFile1, "r" );
$strBuffer1 = fread( $objFH, filesize( $strFile1 ) );
fclose( $objFH );
$tosay = $strBuffer1;

function nextdate() {
  global $tosay, $myday, $myevent;
  $nextret = strpos($tosay, "\n");
  $say = substr($tosay, 0, $nextret);
  $tosay = substr($tosay, $nextret+1);
  $myday = substr($say, 0, strpos($say, " "));
  $myevent = substr($say, strpos($say, " ")+1);

echo date("F");

<table width=100% height=95% border=1 cellpadding=0 cellspacing=0><tr>
<td width=15% align="center">SUN</td>
<td width=14% align="center">MON</td>
<td width=14% align="center">TUE</td>
<td width=14% align="center">WED</td>
<td width=14% align="center">THUR</td>
<td width=14% align="center">FRI</td>
<td width=15% align="center">SAT</td></tr><tr height=20%>

$today = date("j");
$weekd = ($today%7 - date("w") + 5)%7 - 5;
$inmonth = date("t");
for ($dday=$weekd;$dday<$inmonth;$dday++) {
  if ($dday>0) echo "<td bgcolor='lightyellow' valign='top'>";
  else echo "<td valign='top'>";
  if ($dday==$today) echo "<b>";
  if ($dday > 0) echo $dday . "<br>";
  if ($dday==$myday) {
    echo ($myevent);
  if ($dday==$today) echo "</b>";
  echo "</td>";
  if (($dday+$weekd)%7 == 6) echo "</tr><tr height=20%>";


Re: Simple Calendar Script

On Tue, 09 Aug 2005 20:28:22 -0400, Tina - AxisHOST, Inc. wrote:

Quoted text here. Click to load it

A decent solution would be to use something like PHP iCal. You can edit
the iCal files using Sunbird/Apple iCal/KDE Organizer, etc and upload them
to the server.

If you ever need industrial strength, look over our product. At the bottom
end it's not a lot more expensive than other products, but it's pretty

George Sexton
MH Software, Inc. - Home of Connect Daily Web Calendar

Site Timeline