|
Cookbook /
PmCalendarSummary: Calendar designed for PmWiki where each day is a separate wiki page.
Version: 1.0rc12
Status: Stable
Prerequisites: pmwiki-2.0
Maintainer: ccox
Votes: 5
Discussion: PmCalendar-Talk
DescriptionA web based calendar which uses PmWiki markup for display. Overview:pmcal.phpΔ - Adds a large Calendar that is designed to work with PmWiki. It's possible it could be ported to other wikis.
PmCal.cssΔ - Sample css theme showing how easy it is to customize the look and feel (rename to match the Group where your PmCalendar resides and move it to the pub/css/ directory). PmCal-Red.cssΔ - Red style theme. PmCal-Blog.cssΔ - For a blog text view. PmCal-Mini.cssΔ - For tiny calendars... see Cjc example. Demo:Click here to see a live example at PmCal. Installation:Place pmcal.php (this file) into your cookbook directory (e.g. /srv/www/htdocs/pmwiki/cookbook) Include the cookbook in your local/config.php include_once("cookbook/pmcal.php");
Create a new Group called, for example, PmCal.
You will need something on the default page of the group, let's say
just ! This is My Calendar Or... you could just have comment on the page. Just as long as a default page exists. For example: (:comment placeholder:), as used on Holidays?action=source Create a GroupFooter page in that Group with just (:pmcal:) Upload the desired CSS file (see above). Rename it to match the Group where your PmCalendar resides (PmCal.css) and move it to the pub/css/ directory. The entries on the individual days are shown on the calendar but it defaults to show the first paragraph using (:include YYYYMMDD paras=1:) This will allow you to create a table of contents of sorts... not the (:toc:) recipe though. Examples:
Changelog:
Todo:For 1.0:
See AlsoContributorsQuestions & CommentsQ: How do you create each new appointment? Click on the number on the day. It is a link. If you have edit rights, you should be able to edit the page. --Ccox Q: Is there an easy way to edit/delete an item ? Normal page deletion works. Go to the day page by cliking on the number on that day and use the "delete" string you have setup for your site. By default, "delete" on a page by itself will remove it. --Ccox Q: Is there a way to see a live demo? A screenshot is fine but obviously not enough. By the way, this is a remark common to many cookbook recipes: authors should be able to provide a sandbox where visitors could get the feel of the new feature ... Q: Is there an easy way to specify anniversaries or repeating events ? Thanks! -rru? Not at this time. PmCalendar exploits the features of PmWiki. A full scheduler would likely require the ability to create PmWiki content in native (binary) form. I can't consider this feature for 1.0. Q2: Note by the questioner: Then I patched pmcal.php: ...
for ($i=1; $i<=$totaldays; $i++) {
$dayindex = $d % 7;
$pmcalpagename=sprintf("%s.%04d%02d%02d",$group,$year,$month,$iday);
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
$anniversarypagename=sprintf("%s.%02d%02d",$group,$month,$iday);
if ($caltype == 'normal') { ...
and ...
if ($includes != 'false' && PageExists($pmcalpagename)) {
$MaxIncludes++;
$out.=sprintf("\\\\\n\n(:include %s paras=1:)\n",$pmcalpagename);
}
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
if ($includes != 'false' && PageExists($anniversarypagename)) {
$MaxIncludes++;
$out.=sprintf("\\\\\n\n(:include %s paras=1:)\n",$anniversarypagename);
} ...
Now the content of this anniversary pages gets included every year. A very simple approach, but it works for me ... what do You think of it? rru? ccox responds: I like that! That's a simple way of dealing with anniversary dates. And it's pretty much inline with PmCalendar philosophy... elegant, simple and stupid (stupid in a good sense). ccox update: I'm implementing this with a year=ACAL. This means that anniversaries can be stored inside a calendar group. And I'm adding acals=name1,name2,... to allow you to include anniversary information from multiple calendars. Thus you might have for PmCal/PmCal markup like (:pmcal acals=PmCal,Cjc:) which includes the anniversary days inside of PmCal and Cjc into the normal PmCal view. Great, I'm looking forward to the next release - thanks! rru? Q: After having installed the recipe pmcal I get the following message: Warning: Cannot modify header information - headers already sent by (output started at ./cookbook/pmcal.php:755) in /Users/pascallambrechts/Sites/pmwiki/pmwiki.php on line 709 at top of each of my wiki pages. Is this a reported bug? Thanks, pascal? October 15, 2005, at 05:45 PM Are you running the latest version of pmcal.php? I know a problem similar to this was fixed quite some time ago. It's possible that some other recipe is interfering with this as well. Try experimenting with the placement of (:pmcal:). I guess I need more information on this one. Q: I installed the calendar but it appears twice on the same page... Is there anyone that can help me ? Bye. A: I am guessing that you installed (:pmcal:) into your Group.GroupFooter page? If so, realize that viewing that page will show the calendar twice. Normally, you would view Group.Group or Group.HomePage. Can you give us a URL? Q2: Thank you for your reply. I can't give you a url because it's a corporate wiki that can't be accessed from outside the company. First i created a group called Calendar. Then i created a page called Calendar.GroupFooter where i put (:pmcal:). I also created a page called Calendar.calendar where i put the same thing. Maybe i should delete one of the two pages ? If so, which one should i keep ? Thank you again. Bye. A: Personally, I like the calendar to show up on any calendar page, so I'd keep the one in GroupFooter and either put a (:comment something:) in the Group homepage or perhaps a name for the calendar there. Q: I'd like to use PmCalendar to keep track of the occupation of different offices, say Office 1 (needs its own calendar), Office 2 (also needs its own calendar), etc. But I see that when I make a modification in the calendar of Office 1 it shows also in the calendar of Office 2. In short, is there a way I could make each page have its own calendar? Thank you. Alex. A: You need to place a (:pmcal:) markup in different groups. On this site, for example, there is the PmCal/PmCal calendar, the Cjc/Cjc calendar and the Holidays/HomePage calendar. The PmCal calendar includes the Cjc and Holidays calendar groups as part of its markup, for example, (:pmcal cals=Holidays,Cjc:). This allow you to have separate calendars and yet have a super calendar that includes the entries from other calendars. PmCalendars are setup by Group, not by page. Q: Hello, how to create a calendar like CJC example? Thanks! A: This is what I have in my Calendar.GroupFooter which gives results similar to the CJC example: ---- %lfloat%The main [[Calendar/Calendar]] page. (:if false:) (:noleft:) (:ifend:) (:div style='float:right;width:70%;border:4px double #bbbbbb;background-color:darkslateblue':) !%center%Upcoming Events (:pmcal styles=PmCal-Mini caltype=text monthsahead=2 expire=true zebra=false textdatefmt='%A, %B %d, %Y':) (:divend:) (:pmcal styles=PmCal-Mini monthsback=1 monthsahead=2 includes=false:) --Feral February 10, 2006, at 07:21 PM
Q: After giving long names to two of my calendars, I'm having formatting problems with the names being too long when I include both of those calendars in a third. I can get calfmt=abrrevname to work for one calendar but how would I write my group footer for the third calendar so that the headers of both included calendars are abbreviated? A: Not really an answer.... I would try to shorten the Group names associated with your calendars. You should be able to move/rename all your data fairly easily for a calendar. The calfmt is just to adjust the formatting of the included calendar name... not really for replacing the name itself on a calendar group by calendar group basis. ccox Q: I'm using Feral's CJC-like arrangement, but sometimes the number of appointments on the right text is too long. I'd like just 1 week of appointments to show. Is it possible to have a weeksahead or daysahead variable? Alternatively, and probably less elegant, could monthsahead=.25 for 1 week? (Thanks for "stopafter" -- it works great!) ~Steve A: This feature added to 1.0rc7, called stopafter which is a delta day offset from today. For example, stopafter=7 would not display entries in caltype=text for entries beyond 7 days from today. Q: I encounter serious problems with the ACAL feature. I think I don't really understand how to use the year= and acal= and cals= parameters together. I thought I made a good copy of the examples you gave, but it does not seem to work at all... Would you have a look to http://lossouarn.yann.free.fr/public_wiki/index.php5?n=MonCalendrier.MonCalendrier ? A: If you are wanting to see anniversary entries, you can pull in the ACAL entries from any Calendar with acals=CalendarName. So for your calendar:
Should pull in the ACAL entries from MonCalendrier. You see an example at PmCal-Examples, but there I'm pulling in a foreign calendar with cals=... you do not need that unless there is another calendar on your system and you want its entries to show up inside your calendar. Q: Is there a way to enter events that span over multiple days. For example a vacation calendar. Possible notation could be "PmCal.060820-060828". Is that feasible? A: Not easily done. Sorry. Q: I have created a Support.Calendar GroupFooter page with a link to Support.Calender. In that Support.Calender link I have a line
A: Currently (and this may change), PmCalendar is meant to be inside of a Group.. So you can create an empty Group.HomePage (or Group.Group) with something in it... could be (:comment whatever:)... just as long as there is something in it. Then put the markup (:pmcal:) inside of the Group.GroupHeader or Group.GroupFooter. I have received some patches that will make it work like you want (I think). But I have not implemented them yet. Right now, a PmCalendar wants to reside inside of its own Group. Hope that's enough explanation. Q: Hi, great cookbook, thx. Just a question. I'd like to use it as in the cjc example. I reused the code provided here, but anyway, whatever is the configuration, I never manage to have the dates displayed. I took a look at the .php and .css and I didn't find any "explanation". The dates are present in the html page but are not displayed. Any idea ? Thank you. A: Found it. In fact I've been using before the PmCal.css renamed with my Group Name. It looks like it was confusing the script. Deleted it and now it's fine, but it leads me to another question below. Q: How can I use simultaneously the PmCal and PmCal-Mini in 2 different pages (see previous topic) in regards of the .css renaming problem ? Thank you. Here is a possible answer. Take a look at PmCal/Mini. If you edit a value or display, the page will revert to the big calendar look though. I just made sure that both css files were in my PmCal group. PmCal lets you specify what css to use and it CAN look in the upload directory. Q: Hi, we are from Germany. It's a nice program. Is it possible to get an german language-translation file. Or an example "what is do do" to translate it in an other language. Thank you. You can try locale=de_DE and see if that is sufficient. Depends on the locale support of the server that PmWiki is running on. If that does not work, then you can create your own overrides for month and day of week names. See the GroupFooter source for the PmCal group at: GroupFooter?action=source and look at the Pig Latin example. Q: Hi, is it possible to use this as an event management calendar? So eg. I want to book a laptop out from the pool for four days. Could an 'event' be logged on the calendar that would show for four days? Also, when I tested this I found that I could only make one entry per day. It would be nice to have multiple pages per day. eg the calendar shows times 9.00 9.30 10.00 10.30 etc and clicking on a time allows you to edit a page for that time of day. Maybe I'm asking too much. Thanks PmCalendar does not directly support events per se. As you have noticed, you can just put multiple entries on a single day. You can use a bulleted list so that only the bulleted items show up on a given day e.g. PmCal/20061205. There is no way to create a single item that repeats for so many days or on certain days... at least not yet. Works perfect. Yet, in the CSS file there are three unimportant errors. In each case it should read font-weight:bold instead of font-style:bold... Cheers Q: I love this recipe and am currently trying to implement a calendar patterned after Cjc. I have a slight CSS problem, though, as it seems the calendar CSS is overridden by my standard CSS (specifically, for the <h2> tags and the <a href ...> tags), and my standard CSS is very hard to read when there is a link in a link in an <h2> headline. Is there a way to make the calendar CSS override my standard pmwiki CSS here? Or do I have to create a separate CSS for the calendar group? --Henning February 16, 2007, at 01:20 PM Right now, css styles are searched for in the
Q: Does something need to be changed in the css file paths to load the style sheets across a Wiki Farm? Francis Right now, css styles are searched for in the Ah yes, I see now that Cookbook:SharedPages#css also answers this. Thanks, Francis Q: I get to each day page the eg "20070325" title, with really I hate it, more even beacuse I speak spanish, where/how should I change in order to get somethihg to "25-03-07"? Thanks in advance! The YYYYMMDD format is ISO standard (really... it is!). So... the ACTUAL page name cannot be changed. HOWEVER, it is possible to change the displayed title for the page. Consider adding to your GroupFooter or GroupHeader:
(:title {$PmCalDName:Calendar %d-%m-%y}:)
Q: Regarding the same topic as above: Could you post please more of the "%d,%m,etc.-Variables". Should be able to use any of the macros from strftime from PHP. See: Q: Is there anyway to customize this not run off the system clock, but to allow me to make a calender that contains 5 days in a week and 8 months in a year, each named as I desire to, I would also like to be able to have it run of different time. Reason is, I run a MUD and our time system contains 8 hours in each day, 5 days per week, 20 days per month, and 8 months a year. Even a limited function calender would be fine, just so I could create dates and events, and have them displayed in the main calender page.? My initial thought is that this would be VERY difficult to do. Sorry. Is there a way to display the Cjc calenders sideways - like 3 mini calenders side-by-side across the page? May 2008 - June 2008 - July 2008 Thanks CC Category: Calendar
|