Looking for a php calendar script...

Want to be able to:

Allow certain people to add events (I guess this requires a login)
Change the colors of the calendar.
Select Month to view
Maybe be able to click on date/event to get more information on event....

Any suggestions?

Ed

    I searched several script sites and did find a few, but was hoping for some comments from someone who has actually used a calendar script and get their opinions etc.
    Thanks anyway....

      I made a calendar script recently because i couldn't find one that did what I wanted.

      It wasn't as bad as I thought it would be going in.

      Here's the approach I took.

      One set up arrays of days, months, years with both numbers (e.g 1, 2, 3 etc) and names (January,...) for teh different features I thought I'd want (so I also made a Jan, Feb, Mar array). Now maybe I didn't need to do of these but I had them available.

      Then I set up my date variables
      e.g current data, year, month etc using php date functions:

      //Get the date
      if(!$currYear) { $currYear = date("Y"); }
      if(!$currMonth) { $currMonth = date("m"); }
      if(!$currDay) { $currDay = date("d"); }

      // previous month
      $previousMonth = $currMonth-1;
      $previousYear = $currYear -1;

      $nextYear = $currYear +1;

      // if January, set month to December
      if ($previousMonth < 1)
      {
      $previousMonth=12;
      $previousYear--;
      }

      $currentMonthName = date("F");

      So now I had the date and arrays from which I could list out a yearsworth of months and days.

      Like so.

      //loop through the months
      //Month and month_value array in config/functions.php
      $w = 1;
      for ($m=1; $m<sizeof($month_num); $m++) {

      print "<td align='center'";
      	//loop to select current month
      	if (($m == $currMonth)) {
      	print " bgcolor='#6666FF'> ";
      	} else {
      	print " bgcolor='#333399'> ";
      	}
       print "<a href='date_search.php?reqYear=$currYear&reqMonth=$month_num[$m]&action=request' class='Yellow'>$short_months[$w]</td>\n";
      
      $w++;

      }

      Basically loop through my arrays and get a list of the months with number values that can be used for SQL calls as variables.

      Then is was matter of building on this with data out of a database to list the events that where available for a particular month using SQL statements.

      and bit by bit it was finished.

      Hope this helps give you an idea of how to approach it. It may not be the best coding in the world but I did pretty much start from scratch and then keep adding as I figured out each step.

      Good luck

      rinjani

      🙂

        Write a Reply...