WikiCalendar

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

Create a group of pages formatted as a calendar, one page per day. Present people with a picture of a calendar, showing days with and without entries.

Solution

New version: Attach:wikilog-0.2.3.tar.gz for use with PmWiki version 1.0 and above.

jr has tested the recipe with a clean install of PmWiki 1.0.8 and everything works perfectly. Just follow the README instructions.

For older versions (PmWiki version 0.5):

Discussion

The README contains detailed installation instructions. In summary:

  1. move the wikilog/ directory into local/
  2. move css/wikilog.css into pub/css/
  3. move skins/publish/ into pub/skins/
  4. move CalendarGroup.php into local/ and rename it to the group that will hold your calendar; for example, Calendar.php
  5. add the following line to local/config.php -- include_once("local/wikilog/wikilog-config.php");
  6. add [[wikilog]] to Calendar.GroupHeader and press 'return' twice
  7. optional: add [[$Wikilog]] to Calendar.Calendar, which gives a form that posts to "today"

Important: to allow numeric page names, wikilog redefines $PageTitlePattern:

  $PageTitlePattern = 
      "[A-Z0-9]([A-Za-z0-9]*)(-([A-Za-z0-9]+))*";

and makes a corresponding change to $FreeLinkPattern.

NOTE: This clashes with the function, Pm kindly spent some time going through a problem with the include function with me and tracked the source down to this. wikilog freesupport.php line 16 should be changed to $PageTitlePattern = "$TitlePattern(?:-$AnyLetter+)*(?:~$TitlePattern)?"; to get it working. Pm is letting John Rankin know. Thanks. Tom

Now fixed. Thank you. jr

The script treats references of the form Group . or / followed by 8 digits as a valid page reference.

There are various parameters you can set in the wikilog-config.php script to control how it displays, such as choosing between American and European date formats.

All the predefined text values, such as day and month names, are defined as variables, with the English values set by default. It also includes a German translation.

There is a parameter to set depending on whether you need ThisPage:?logdate= (the default) or ThisPage:&logdate= (for references of the form http:// ... &pagename= ... )

I think it's XHTML compliant, but I may be wrong

If it's set up correctly, you should see:

  • on the home page, a calendar plus a list of the first paragraphs for any entries in the current period, the most recent first (configurable), plus navigation to the next and previous periods
  • a Publish button
  • by default, days without entries are styled red; to create an entry for a new day, just click on the day
  • optionally via the day_as_wiki parameter, days without entries are styled as day? (ie as normal wiki words)
  • on date pages, the date is spelled out in long form, with navigation to the next and previous entries for the month, plus a link to the calendar home page

Revision history

23 August -- improve use of css for the calendar display, add support for international dates and PmWiki/WikiFarms

21 May -- fixed to work with new [[include: ... ]] markup options

25 April -- simplified installation procedure

21 April -- minor bug fix and improve css support

20 April -- add support for a form to post entries automatically to today; minor bug fixes and display enhancements

1 April -- fix bug that ignored [= ... =] markup, add support for {{Group/free links}}, provide an option to list entries oldest first or newest first

23 March -- fix bug that ignored [[<<]] markup processing and add support for stop characters in the list of entries

18 March -- make the Publish button on news pages a configurable option

15 March -- space titles that are dates if $SpaceWikiWords is on (space character user-definable) and 17 March to fix a stupid mistake on the author's part

8 March 2004 -- version that works with 0.6.7 and above, add support for markup to list the latest entries from another group

12 September -- support Publish, make installation more reliable, make translations easier (really, it needs to use the php setlocale function -- any volunteers?)

1 September 2003 -- support other languages and change how days without entries display

Released 7 August 2003

Contributors

John Rankin (the core calendar display logic came from a free software program by Stephan Uhlmann)

Simo Salanne added the ability to use languages other than English

Geoff Hopkins and Carlo Strozzi for helping to work out the installation instructions

Eric Charikane for suggesting the Publish option and working out a better way to translate the display

Albi Rebmann for translating the interface into German.

Andres Yver for suggesting the blogging features.

Notes

Obscure bug or "Doctor, it hurts when I go like this..."

This belongs on the mailing list...anyway.

I am using the latest download of pmwiki in a wikifarm installation.

I had created a wikitrails based presentation (I guess you would call it WikiPoint).

I wanted a better look so I used a modified print.tmpl to strip the page of all headers and footers.

The wikitrails links worked fine in regular viewing and printable page viewing.

I added wikilog and then the wikitrails links only apeared in the regular version of the page and not the printable version.

I set the wikilog print.tmpl back to it's original state and I still could only see the wikitrails links in the regular version of the page and not in the printable version.

I'll throw some thought at it when I have a moment.

--RossKowalski


I'm a bit afraid of installing this cookbook as I'm not sure what it's going to do and what it'll look like. Can anyone point us to an example web page where this calendar feature has been used in a pmwiki site?

See http://wiki.lianza.org.nz/index.php/Calendar/Calendar
or http://www.vogel-nest.de/wiki.php4/Blog/Stefan (and I like it very much, easy to use ... very nice)


I tried Calendar on Win/IIS platform. Wikilog.php generated error when the URL did not contain "logdate" parameter. I replaced the line:

  $logdate = $HTTP_GET_VARS['logdate'];

by

  if (array_key_exists("logdate", $HTTP_GET_VARS)) {
       $logdate = $HTTP_GET_VARS['logdate'];
  }

Which fixed the problem.

Simo Salanne, 1-Oct-2003

  • Work on Win/Apache (?!?) platform. Publish works! Then I uploaded the complete pmwiki-folder to the webserver (Linux, Apache). → Everything works, except the publish-function. Seems to be a php-configuration-problem. Tried all listed suggestions and can´t find the problem. HEEELP!!!!

10-Oct-2003


The following version of the list_entries function will handle multiple entries per date. Simply have at least one blank line between entries. A summary of each entry is then displayed as a bulleted list. Similar to javadoc, a summary is the first part of an entry terminalted by a period.

Attach:list_entries.php

Frank Hellwig, 2003-11-18

(does not work with the latest calendar version)
How to add multiple entries / day in latest version?

It was really bugging me how the log entries were displayed in descending order from the most far off event to the most recent. So I modified wikilog.php to give the the option of reversing the list. Here is a patch against wikilog-0.6.7:

Attach:wikilog_revlog.patch.gz

John Blyberg, 2004-03-25

support added 2004-04-01 via a configuration parameter jr

The PmWiki variable for adding headers has changed in PmWiki 0.6 and above. It's used by this tool to colorize the calendar. The old variable is $HTMLHeaderFmt; the new one is $HTMLHeaders.

Actually, $HTMLHeaders is deprecated and will be removed in a future release. The correct variable is $HTMLHeaderFmt, which is now an array. --Pm
The latest version has a style sheet to colour the calendar, using $HTMLHeaderFmt, plus fixes a number of things that work slightly differently in version 0.6 of PmWiki --jr

The "Publish"-Function doesnt work with my installation: It produces a page without any Calendar-Entries. I'm using the latest PmWiki. Can anyone provide a solution or at least an ultimate installation instruction for this great Calendar tool?

Can you provide a link, and set $EnableDiag = 1; in your local/config.php? jr

Sorry for the delay... Changed the config.php, and here's the link: http://www.interpool-net.de/pmwiki3/pmwiki.php/Calendar/Calendar Maybe I forgot something during the installation process, don't know.

Michael Schoemburg, 2004-04-10

This has me stumped. It works fine on my computer running PmWiki version 0.6.14. The problem may be the statement "$GLOBALS['PublishList'] = $PublishList;" 7 lines from the end of wikilog.php. I can replicate your behaviour if I comment out that line. Try the following experiment:
  • comment out the "$GLOBALS['PublishList'] = $PublishList;" statement
  • insert the line "global $PublishList;" at the start of the HandleCalendarPublish function
This change works for me. If this fixes the problem, I'll update publish.php also and release a revised version. Although I don't know why. --jr, 2004-04-15

Did not work. But many thanks for your help! Maybe you can send me a notice if you have made any upgrades for that great tool: . --Michael Schoemburg, 2004-04-20


Has this been fixed yet? I am having the same problem as above, and did both the things stated above:

http://temp.modwest.com/bacctexas.org

can anyone help?? geo [snail] kitecorpus [period] com

Also.. why doesn't the PrintableView Work either for it? seems like that should work at least, but when you press it, nothing appears.. not sure if it has to do with the script or what? anyone know? would be nice for people to be able to go to a month, and hit print to have it print out and put on their wall!

Printable view works as specified: it prints GroupPrintHeader, then the current page, then GroupPrintFooter. So if one has the <#>? directive in a GroupHeader and an empty Calendar.Calendar page, you see an empty printable view. If you try the printable view on one of the pages with an entry, you see the entry. As to why publish doesn't work, it may be to do with the site using urls with ?pagename=... and it's not picking up the page correctly. If you can figure out the fix, please post it here!
I don't even see the entry.. you can look here
http://bacctexas.org/pmwiki.php/Calendar/Calendar, click the print page button, and nothing appears, even though there is one entry on the page. also.. i fixed pagenames, and that did not help the Publish function, or the Printable Page functionality.. If i can't get the publish thing working, is there a way i can prevent it from showing on the calendar page?
Try installing the very latest version -- I have changed the publish buttons to work exactly the way PmWiki search buttons do. Also, printable view is working exactly right -- go to the page for 04/23/2004 and click printable view. (If you put some text on the home page, you see it when you click the printable view.) And you can disable the publish button. In the current version, uncomment the following line in wikilog-config.php
$PublishCalendarTagFmt = '';
But do test the latest version first.
it looks like this

Calendar:
  • 04/23/2004: Parade of Homes Kick off Party

Can you see it now?? it is there and should show up when someone hits the Print Page button.

Repetitive Entries

how can i create repetitive entries? e.g. i wish to have the same entry valid from april 2nd through to june 6th. can i do that wih free links?

How about something like the following. Suppose that we:
  • create a page called "20040402 to 20040606" and it has some content that applies for all those dates
  • have a GroupFooter with a new directive, say called "[[$RepeatingEntries]]"
  • on the calendar home page and other non-date pages, use today's date to see if there are any applicable repetitive entries and if so display the first paragraph
  • on date pages, use the page title to see if there are any applicable repetitive entries and if so display the first paragraph
  • set up a RepeatingEntries page that lists all repeating entry pages, and use this to locate pages that apply to the date in question
Is this a suitable approach? Is there a better one that's simpler to implement?

Problem with Spanish WikiWord

The calendar works fine, but turns off all WikiWords containing extended alphanumeric character like:

LeerDocumentación (note the ó)

Leaving it like:

LeerDocumentación

Any ideas?

try modifying freesupport.php, line 10, replace to something like
  $AnyLetter = "[A-Üa-ü0-9]";
also try $AnyLetter = ":alnum:?"; and if that works I'll update this script and PageTableOfContents
Yeah It Works great! Thanks. That's the right line.
This change is now included.

wikilog.css is visible outside the calendar group

I could not change the background color of the body of a page in another group. I looked at the HTML and saw a link to wikilog.in the <head> section. wikilog.css starts off with

  body { 
	background-color: #f5f5f5; 
  }

and for some reason that was taking precedence over other directives.

Is there a way to get wikilog.css included only for pages in the calendar group? 7qe5skl02 [snail] sneakemail [period] com

the body reference is now removed from the css

Support for ISO date format

There are American format and European format date options for displaying the date (don't know where you got the European format from) but the international standard for date format wich I use and as specified in ISO 8601 is not supported. I've created my own workaround for this (see below) but I would appreciate if the standard is supported in future versions. Thanx for a great add-on!

Fix to view ISO date-format: Change line 557 in wikilog.php to

	switch ($calendar_datestyle)
	{
		case 0:
		return "$month/$day/$year";
		case 1:
		return "$day.$month.$year";
		case 2:
		return "$year-$month-$day";
	}

And set in wikilog-config.php

        $calendar_datestyle = 2

Read more:

/ Per Axbom

this feature is now included

It would be fantastic to have either

  1. a sidebar summary of this week's calendar items, or
  2. alt-text popup when you mouse over a date.

Thoughts?


My question is:

Is there a way to display links to all the pages in the calendar group? I just find out it is too difficult to visit pages that i wrote months ago.

thanks in advance.

--keith pmwiki-2.3.38 -- Last modified by {{Svogel}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons