PHP Classes

weekly - calFormat

Recommend this page to a friend!

      Multi-format calendar class  >  All threads  >  weekly - calFormat  >  (Un) Subscribe thread alerts  
Subject:weekly - calFormat
Summary:Looks like this is incomplete also??
Messages:6
Author:Trent DeCamp
Date:2006-07-27 21:20:46
Update:2006-08-03 14:20:24
 

  1. weekly - calFormat   Reply   Report abuse  
Picture of Trent DeCamp Trent DeCamp - 2006-07-27 21:20:46
Get an error message if try to set calFormat to weekly.

Nothing is in the case statement in the code of calendar.inc.php either.

  2. Re: weekly - calFormat   Reply   Report abuse  
Picture of Trent DeCamp Trent DeCamp - 2006-07-27 21:31:37 - In reply to message 1 from Trent DeCamp
function display() {
//Check which format to display
switch ($this->calFormat) {
case "smallMonth":
$displayCal = $this->showSmallMonth($this->calMonth, $this->calYear, $this->displayPrevNextLinks);
break;
case "largeMonth":
$displayCal = $this->showLargeMonth($this->calMonth, $this->calYear, $this->displayPrevNextLinks);
break;
case "fullYear":
$displayCal = $this->showFullYear($this->calYear, $this->displayPrevNextLinks);
break;
default:
$error = "Invalid definition of the calFormat variable in display function.";
$this->displayError($error);
}

  3. Re: weekly - calFormat   Reply   Report abuse  
Picture of Trent DeCamp Trent DeCamp - 2006-07-27 22:07:54 - In reply to message 1 from Trent DeCamp
This will at least get you some output so you can see what the weekly view looks like...

Add this to the display function (which begins on line 913)in the first switch statement in calendar.inc.php, right before the default clause

case "weekly":
$displayCal = $this->showWeekVIew(date());
break;

  4. Re: weekly - calFormat   Reply   Report abuse  
Picture of Dan Bemowski Dan Bemowski - 2006-07-29 00:01:35 - In reply to message 3 from Trent DeCamp
Yes, I realized yesterday that part of the weekly calendar format was incomplete. I updated the code and re-uploaded it to the PHP Classes site today. To see a sample output of the updated class, go to http://www.phpwebscripting.com/classes/calendar/calendartest.php.

  5. Re: weekly - calFormat   Reply   Report abuse  
Picture of Chris Grigor Chris Grigor - 2006-08-03 13:34:08 - In reply to message 4 from Dan Bemowski
Hey there

Downloaded and played with your class yesterday.
Works well, however just have a question.

I have a page which in the headers has the following:

include
#<!--Start calendar-->
include 'calendar.inc.php';
//Define a new calendar
$cal = new calendar;

/*
Show links to access the previous and next months for month calendar formats, and
links to access the previous and next years for full year calendars.
*/
$cal->displayPrevNextLinks = true;
/*
This section is used when $cal->displayPrevNextLinks is set to true. The month
section is only needed when displaying month calendars.
*/
if (!empty($_GET['mon'])) {
$cal->calMonth = $_GET['mon'];
}
if (!empty($_GET['yr'])) {
$cal->calYear = $_GET['yr'];
}

//Set the calendar format to large month.

$cal->calFormat = "weekly";

$cal->addEvent(strtotime("2006-07-28 21:00:00"), "Fireworks show in Hatley");
In the body of the page I have:

<body>
<?php
$cal->display();
?>


When the page loads the very first time, if you try and scroll through the calendar the page expands into one big table which is about 2 pages long.... refresh the page and the table displays correctly with the weekly calendar.

Have you had any problems with IE 6?

Note: works 100% with firefox.

Regards
Chris

PS - just incase I double checked with your page calendartest.php and the $cal->calFormat = "weekly"; and it does the same....

Just thought you should know.

  6. Re: weekly - calFormat   Reply   Report abuse  
Picture of Chris Grigor Chris Grigor - 2006-08-03 14:20:24 - In reply to message 4 from Dan Bemowski
Dan ignore my last message - I have a problem with IE6 on the machine I am working from. Dont know what it is yet but will keep you posted...

Chris