|
PublishWikiTrail<< Simple Page Counter | Cookbook-V1 | FourOhFour Cache >> Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
GoalDisplay all the stops on a WikiTrail page in a form suitable for printing. SolutionAttach:publish.tar.gz - latest version that works with PmWiki version 0.6 Requires PmWiki/PmWiki version 0.5.17 or above ( Broke with changes introduced in PmWiki/PmWiki versions 0.6.x). Now fixed in the latest release.
Fix for 0.6.9 and aboveChange lines 14-15 in publish.php from to Replaced in the latest version to use a template and associated style sheet. Fix for numberingIf there is an new depth more than one level if ($depth[$i]<$predepth) {
for($j=$depth[$i];$j<$predepth;$j++) $counter[$j] = 0;
}
Fixed in the latest version DiscussionThe publish.php script adds an "?action=publish" option to wiki trail pages, which causes all the pages on the trail to be output in a form suitable for printing. WikiAdministrators will probably want to use this script as a guide for customizing their own publish functionality. The author inserts the markup $Publish? on any trail page and this appears as a button labelled Publish. Or the author can put [[$Publish:PageName]] on any page to publish the specified page. The steps performed by this script are:
To use this script, simply add <?php include_once("local/publish.php"); ?>
to your local.php configuration. Still to do: add radio buttons that let visitors choose between Screen (XHTML) and Print (PDF) formats. could you also revise it to also publish lists that are created with the T*PageName (and related) mark ups? - (see IncludePara) T*PageName markup now supported -- the original goal was to be consistent with the PmWiki core software, which doesn't treat T* markup as a trail reference. Authors can achieve the same effect by writing *PageName - [[para:PageName]]. This works as a trail reference and a Publish reference. To see an example, visit http://wiki.lianza.org.nz/index.php/KeyWords/Survey and press Publish. DiscussionPublish.php didn't work when the URI looks like ?pagename=... the patch below fixes this (very crudely :-)
[chr@aussie local]$ cvs diff -u
cvs diff: Diffing .
Index: publish.php
===================================================================
RCS file: /home/chr/repository/toc/local/publish.php,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 publish.php
--- publish.php 7 Dec 2003 11:29:08 -0000 1.1.1.1
+++ publish.php 23 Dec 2003 16:45:41 -0000
@@ -58,6 +58,7 @@
SDV($PublishPageNotFoundFmt,'Page \'\'$Tlink\'\' does not exist.');
SDV($PublishTagFmt,"<form target='_blank' action='\$PageUrl' method='get'>
<input type='hidden' name='action' value='publish' />
+ <input type='hidden' name='pagename' value='\$PageName' />
<input type='checkbox' name='include' value='include' />$[Include this page]
<input type='submit' value='$[Publish]' /></form>");
SDV($InlineReplacements['/\\[\\[\\$Publish(nodate)?\\]\\]/e'],
-- Christian
Revision HistoryReleased 7 August 2003 Revised 20 August: set $HTMLTitle and open publish view in a new window. Revised 1 September 2003: combine with PrintablePage, use a better style sheet, and work better with WebMenu. Revised 12 September 2003: add support for "T*PageName" markup (see IncludePara) and definition list (:PageName:) markup; fix a bug in page numbering. Revised 1 October 2003: add support for [[include: ... ]] directives, list external links as endnotes, provide an Include this page checkbox. Revised 30 October 2003: bring include handling into line with pmwiki.php Revised 5 January 2004: print date last modified for each page (can be omitted using the [[$Publishnodate]] variant), add support for [[$Publish:PageName]] Revised 25 May 2004: align with PmWiki version 0.6 See Also
Note: if you have downloaded and installed the WikiCalendar, you already have this latest version. Contributors
pmwiki-2.2.0-beta68 -- Last modified by {{jr}}
|