|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Different views of calendar possible?
Is it possible to display the calendar in formats other than "month"?
The code alludes that this is possible as filenames are ltwdisplaylist.php, ltwdisplayday.php, ltwdisplayevent.php. If so, how does one invoke these other views? |
|
#2
|
|||
|
|||
|
RE: Different views of calendar possible?
Day display:
calendar.php?display=day&day={1-31}×tamp={stamp} Args: &day the day of the month ×tamp output of mktime() for the month & year to be displayed Event display: calendar.php?display=event&id={id}×tamp={stamp} Args: &id numeric event id from db ×tamp output of mktime for the month & year to be displayed List display: calendar.php?display=list&start_date=yyyy-mm-dd&end_date=yyyy-mm-dd&cat_ids=n,n,n Args: start_date day to start the list end_date day to end the list cat_ids limit to these category numbers One of the other things I want to do in the next release is get rid of the 'timestamp' and go strictly with "yyyy-mm-dd" on the URL. If you need some code examples, let me know |
|
#3
|
|||
|
|||
|
RE: Different views of calendar possible?
Being a "Codefoetus" really, you're going to have to help me here a bit. Is the code to derive the timestamp already in one of the calendar modules or does it need to be added? A small sample piece of code would help enormously.
Just out of interest and in an effort to learn, why did you use the timestamp feature anyway? Thanks |
|
#4
|
|||
|
|||
|
RE: Different views of calendar possible?
For the month display, you can look at calendar.php (the month: case) to see how to construct a timestamp. The $_REQUEST array holds the arguments of the GET request (everything after the ?in the URL). So, if you look starting at ~line 128, you can see that if the month or year are not set (or month not valid), then the time() function is used to return the current date & time in a "timestamp" format and the current month will be displayed.
If a particular month & year are requested, then the mktime() function is used to create a timestamp for <month>/1/<year> at 12:12:12 (not that the time really matters). To construct a link for a particular month's events, you simply pass the month and year as URL arguments and calendar.php "converts" them. Using 6/12/1977 as an example: echo '<a href="/calendar.php?display=month&month=6&year=1977">6/1977</a>'; To construct a link for a particular day's events , you would do something like this (using 6/12/1977 as example): $timestamp = mktime(12,12,12,6,7,1977); echo '<a href="/calendar.php?display=day&day=12&stamp='.$timestamp.'">6/12/1977</a>'; From a practical standpoint, the event display is not very usefull unless called from somewhere else since you need to know a valid event 'id' to request from the database. The timestamp existed in earlier versions of the calendar before I started working with it. I expect to change it in the next "feature" upgrade so that all dates will be specified in the "yyyy-mm-dd" format as they are stored in the database. That will make things easier. |
|
#5
|
|||
|
|||
|
RE: Different views of calendar possible?
I've been playing with the different views and have found the List display using categories to be *VERY* useful. I have been asked to construct a training-course schedule calendar and the List display would be ideal for users wanting to schedule their time to attend a course.
During my experimentation I think I may have discovered a bug, but it's more likely to be me not reading the code correctly and drawing the wrong conclusions! When displaying the List for a single month eveything is fine and dandy. However, when listing future months that do not contain any events the last month always displays the text "No Events found" in the date column. Previous empty months do not show this text, it's always the very last month. Firstly, is this correct? I would have thought that all empty months would show the message or none of them would, just to appear consistent. Secondly, the text only appears in the date column and does not stretch across all four columns (date, time, name, description). Third, there are no admin options, though the code looks like there should be if you are logged in. (Not sure about this one.) And finally, if I remove the "No Events found" text from the code, will I be affecting any other displays, error messages, etc, that I haven't yet discovered? Once again thanks in advance. |
|
#6
|
|||
|
|||
|
RE: Different views of calendar possible?
Just as an update to this, I have been asked to implement an "Event View" on our intranet's calendar. The calendar is being used to schedule internal training courses and our courses run throughout the whole year, so being able to select "Introduction to Word 2000" from a drop-down list would show all these courses for the year. The user could then pick which time of the year that suited them. This would be a nice addition for a future release (hint, hint)
|
|
#7
|
|||
|
|||
|
RE: Different views of calendar possible?
1) It's probably a bug.
2) A list based on Categories wouldn't be too hard. I'll keep it in mind. 3) With the holidays, getting ready to switch jobs, and switching OS's on my development system (from RedHat to Debian), I haven't had a lot of time to spend on the calendar (and can't look at bugs either). But I have Debian almost up (need to build PHP & apache Yet) then I'll be starting on the next release of the calendar. |
![]() |
| Viewing: Codewalkers Forums > Projects > ltwCalendar > Different views of calendar possible? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|