Re: gray out an event on the yearly view
Roger Raymond <[email protected]> Mon, 30 Jun 2003 10:59:15 -0400
| Newsgroups | gmane.comp.web.postnuke.modules.postcalendar.user |
|---|---|
| Organization | PostCalendar |
| Message-ID | <[email protected]> |
frederic belleudy wrote: > Hi all. First of all, thanks for this module, its very helpfull for my > own developpement project. I need a little aid concerning the yearly > view on the calendar. I need to gray out the date where there is an > event, even if there is more than one event on a same day. I hope you > understand what I mean. I think my prob is in the calendar.php file. > Maybe you can help me to clear this out a bit and if its possible tell > me where in the code I can modify it to obtain what I need. > tksssss in advance :D By gray out, do you mean you don't want to show the date? All you need to do is count the $events for any particular day. This can be done directly in the template. In fact, the events are already counted in the template. The counting is done in this portion: [-if $A_EVENTS.$date|@count > 2 -] [-assign var="classname" value="event-three"-] [-elseif $A_EVENTS.$date|@count > 1 -] [-assign var="classname" value="event-two"-] [-elseif $A_EVENTS.$date|@count > 0 -] [-assign var="classname" value="event-one"-] [-else-] [-assign var="classname" value="event-none"-] [-/if-] and the display is done here: [-if $stylesheet ne "monthoff"-] <a class="[-$classname-]" href="[-pc_url action=day date=$date-]">[-$date|date_format:"%d"-]</a></td> [-else-] [-/if-] You should be able to modify the template to do what you need simply by changing the above two sections to something like: [-if $A_EVENTS.$date|@count > 0 -] [-assign var="haveevents" value=1-] [-else-] [-assign var="haveevents" value=0-] [-/if-] [-if $haveevents eq 1-] // gray out this day [-else-] // display the day [-/if-] Hope that helps --Roger