|
WhatLinksHere<< FourOhFour Cache | Cookbook-V1 | Smart Quotes >> Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
GoalTo provide backlinks; that is, to show what other pages link to a particular page. This can be useful for updating or changing pages, or for doing site architecture. SolutionAttach:pmwiki-whatlinkshere-0.1.tar.gz Attach:pmwiki-whatlinkshere-0.1.zip DiscussionRequirementsThis package was created with PHP 4.3.4, but it should work with lesser versions of PHP with some massaging. It was created using PmWiki 1.0.3, but should work with PmWiki 0.6 or above. Installation and configurationInstalling filesYou should be able to just unpack this tarball (or zipfile) and then copy all its contents recursively to your pmwiki directory:: tar zxvft pmwiki-whatlinkshere-0.1.tar.gz
cp -R pmwiki-whatlinkshere-0.1/* /path/to/pmwiki/
Configuring PmWikiTo activate this extension, add the following line to your PmWiki local/config.php file: include_once('cookbook/whatlinkshere.php');
It should work correctly by default. Configuration variablesThese are the config variables that affect how the whatlinkshere module works. You probably don't have to mess with any of these.
Using the extensionThe extension can be useful both for users and for developers. whatlinkshere actionThis extension provides an action to show the backlinks for a page. You may want to add this action to your template somewhere, like so: $PageUrl?action=whatlinkshere This will show a list of all pages that link to this page, as well as any pages that "depend" on the page (for example, that include or redirect to it). You can customize the output using the $*Fmt configuration variables specified above. FunctionsFor developers, this module provides two helpful functions.
Customizing rulesBy default, this package should handle the wiki syntax that PmWiki comes with. However, PmWiki allows you to customize the wiki syntax in (almost) arbitrary ways. I tried to make this package flexible enough so you can add new rules pretty easily, and disable existing rules. Disabling rulesYou can disable rules by setting their value in the rules list to false. For example, if you've disabled WikiWords in your wiki, you can keep them from showing up as links by adding this code to your local config: $LinkRules['groupwikiword'] = false;
$LinkRules['barewikiword'] = false;
You should probably do this after including the package. The default link rules are:
The default dependency rules are:
Creating new rulesYou can create a new link or dependency rule by adding a new rule function and adding it to the appropriate rules array. For example: $LinkRules['mylink'] = 'MyLinkRuleFunction'; You should probably put this after the line that includes the whatlinkshere.php module in your config file. A rule function has to work as follows:
See AlsoHistory
Comments & BugsThere're probably lots. Some notable ones:
ContributorsCopyrightCopyright (C) 2004 Evan Prodromou <evan@pigdog.org>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This software's available under the GNU General Public License (GPL) version 2 or later. I've tried to get the script working for a WikiFarm. With no success.
|