Version compatible with php 5.5:
wikilog0_3.phpΔ -- this PmWiki 2 version is an update of the version for PmWiki 1, simplified to reduce the number of script files. The latest version is tested with PmWiki 2.1.5.
Please note. The Publish PDF library includes the WikiCalendar recipe.
First you need to install the calendar.
This won't work when MultiLanguage is used. To make it work replace the above two lines with:
SDV($language,$_COOKIE['userlang']); include_once("$FarmD/cookbook/wikilog.php"); //DON'T include_once("$FarmD/cookbook/wikilog-i18n-XX.php");
and make sure to load multilanguage.php before wikilog.php - SteP February 14, 2007, at 04:34 PM
Using the calendar
In the following discussion, assume calendar entries are in a group called Calendar, with a home page called Calendar.Calendar:
To make a form for posting a story to (by default) "today's page" or another selected date, add the
To show a list of the latest entries from a page in another group, enter:
Calendar is the name of the calendar group and the home link points to Calendar.Calendar.
If you want the calendar home page to be something other than Calendar.Calendar, such as Calendar.HomePage, put the following into the Calendar.GroupHeader
To show a list of the latest entries on this page from a page in another group, enter:
To generate a list of "go to month" links suitable for a sidebar (including links to the first and last days' entries, if any, for those months), enter:
To display all the entries for the current week in a single page, enter:
To provide a form to post a story to a specified date, add this to the home page:
There is a range of configuration variables which an administrator can override in the local/config.php file. Place these settings before the
This configures how weekdays are presented. 0 - american style, Sun to Sat 1 - european style, Mon to Sun SDV($calendar_weekstyle,1); This configures how dates are presented. 0 - american style, 11/17/2002 1 - european style, 17.11.2002 2 - international style, 2002-11-17 SDV($calendar_datestyle,1); SDV($space_date_titles,1); SDV($SpaceDateString,'-'); How many months relative to the current one to start the calendar. Can be a negative (going back) or a positive (going ahead) number. The value zero (0) starts the calendar with the current month. SDV($calendar_months_start,0); How many months altogether to show on the calendar. SDV($calendar_months_number,2); How many months after we should wrap and start a new row. SDV($calendar_month_wrap,3); Whether or not to display current entries at the bottom of the calendar. Enter 'false' to omit the current period's entries. SDV($display_log_entries,true); Whether to display current entries in ascending or descending order. Enter 'false' to show the oldest first. SDV($newest_first,true); Whether to display a summary or full calendar on individual entry pages. Enter 'false' to include the calendar on every page. SDV($summary_only,true); This is the default home of each collection (Group) of date pages. SDV($wikilog_home_page,FmtPageName('$Group',$pagename)); Translate date markup yyyy-mm-dd into long dates SDV($DateSeparatorPattern,'[-.\/]'); Whether to display non-existent date entries in the calendar as day or day? Enter 'true' to use the wiki '?' convention for non-existent entries SDV($day_as_wiki,false); Whether to display a list or list and Publish button on wikilog news pages Enter 'true' to include a Publish button after the news list SDV($enable_publish,false); Whether to display warm and friendly week day names for (:thisweek:) Enter 'false' to use normal day names SDV($yesterday_today_tomorrow,true); Whether to display fully-defined week day names for (:thisweek:). 0 - day number only 1 - long date (day name, day number, month name, year) 2 - day and month number only (dd.mm or mm/dd or mm-dd) SDV($long_weekday,0); Whether to make an edit link on week day names Enter 'false' to suppress edit link SDV($edit_weekday,true); Month and day names in chosen language SDV($language,'en');
By default, the calendar publish function is disabled. To use the publish function, you will need the PublishWikiTrail recipe. The wikilog-i18n-xx.php files from PmWiki 1 work with the PmWiki 2 calendar.
To set local configuration values, either add
Finally, wikilog adds date markup: it turns yyyy-mm-dd text into long dates.
08 Jun 2006 -- set $calendar_box_access_code to false to disable the access code field on (:wikilogbox:)
01 Jun 2006 -- add nofollow to nonexistent dates
26 May 2006 -- add group and page option to (:wikilognav:)
24 May 2006 -- avoid mis-handling of dates in url text; improve (:wikilogbox:) handling
08 Mar 2006 upload correct i18n-en file
27 Oct 2005 fixed bug in function "calendar_nav_bar($pagename,$startingtime)" causing the previous month not to be displayed (Thierry Vanderschueren)
line : $lasttime =$startingtime-$calendar_months_number*2592000;
$lasttime =$startingtime-($calendar_months_number - 1) * 2592000;
Really? If I display 2 months ($calendar_months_number = 2), say October and November, the previous link is to August, which will then display August and September. If, however, I make the above change, the previous link is to September, which will then display September and (repeating itself) October. If I display 1 month, the previous link goes to the current month, not the previous month. So I don't understand why the above change is required or desirable. Perhaps you could help me see what I am missing.
20 Oct 2005 add configuration options for (:thisweek:)
22 May 2005 add (:wikilognav:) to list a series of months (default 15) in a style suitable for a sidebar (requires a new wikilog.css file)
15 May 2005 enhance (:wikilogbox:) so authors can select the date for the story (also requires new wikilog-i18n file)
11 May 2005 add support for
14 Mar 2005 merge the
27 Feb 2005 fixed bug if $calendar_datestyle = 2; and allow trailing spaces after (:wikilog:) directives
10 Feb 2005 changed $CalendarBoxFmt and include
to language files; move files to cookbook directory instead of local directory. (DanielScheibler)
25 Jan 2005 fix incompatibility with pmwiki beta 19, which led to invalid html being generated
17 Jan 2005 pick up the author from the PmWiki cookie (thanks to RobinS) and add support for yyyy-mm-dd markup (renders as a long date).
2 Dec 2004 try again: $url_connector should no longer be needed; but Paul could perhaps retest with beta 4.
15 Nov 2004 put back $url_connector from the PmWiki 1 version -- it's still needed. However, if $url_connector='&'; the WikiCalendar currently doesn't work correctly without a small change to pmwiki itself. See PITS.00165. Thanks to Paul Lewis for reporting the problem and testing a solution.
>A general comment: >* It's slightly confusing with the script called 'wikilog' when the > example is so extremely calendar-oriented. Is the functionality of a > log and a calendar so similar? >* Same goes for the directive (:wikilog:)...
to which John answered:
<boringHistory> When I were a lad, I was taught that experimental scientists always kept a lab book with a daily log of activities. Like a ship's log. James Cook's log book from the Endeavour voyages makes grim reading. He had some unrelentingly bad hair days. You can tell from the names he gave to places: Cape Tribulation, Cape Foulwind, Murderers' Bay... (I have since learnt that Abel Tasman named Murderers' Bay -- one of his crew got eaten.) Lab books were invariably stained, burnt, torn and dog-eared. Like their authors. So the original idea behind the wikilog was just for a web-based project log book. But what people see is a calendar and it just became easier to explain it in those terms. But it's not really a calendar; it has no pictures of snow-capped mountains, tumbling brooks, happy smiling children, or cute cats. Or ruddy hobbits. We could of course add such features (as long as there are no hobbits). And it was just too hard to come up with a new name and markup. The name 'wikilog' creates no pre-conceived notions about what it "should" do. All the others I could think of were freighted with too much cultural baggage. </boringHistory>
Questions, Comments, Suggestions