RelativeURLs

Summary: Allows you to specify relative URLS inside a wiki link.
Version: 1.0.1
Prerequisites: pmwiki-2.2.0-beta45 (It could work with eariler versions)
Status:
Maintainer:
Categories: Uncategorized

Description

Allows relative URLs to be inserted inside [[Link]] wiki links.

Installation

  • 1.0.1
    • Download RelativeURLs-1.0.1.zipΔ and extract it to your cookbook directory.
    • BugFix: RelativeURLs.php was having problems with UTF-8 html link encoding and the styles markup.
    • See version 1.0.0 for instructions.
  • 1.0.0
    • Download RelativeURLs-1.0.0.zipΔ and extract it to your cookbook directory.
    • Required: Add the following to your pmwiki/local/config.php
    • include_once("$FarmD/cookbook/RelativeURLs.php"); (This must be your last entry in config.php)

Notes

The recipe raises deprecated warnings with recent PHP versions. There is no author or license information in this recipe so we're probably not allowed to publish updated versions of the code.

If you must use this recipe with PHP 5.5 or newer, you need to replace on line 20:

  $x = preg_replace("/\\bhttps?:[^$UrlExcludeChars]+|\\.\\/[^$UrlExcludeChars]+/e", "Keep('$0')", $x);

with:

  $x = preg_replace_callback("/\\bhttps?:[^$UrlExcludeChars]+|\\.\\/[^$UrlExcludeChars]+/", "Keep", $x);

(This change requires PmWiki 2.2.103 or newer.)

Comments

See Also

  • Also used in StaticPages
  • $EnableLinkPageRelative - a variable introduced in pmwiki-2.2.0-beta45 [1] which, if set to 1, shortens links to other wiki pages.
  • InterMap - there is an existing entry "Path:" which allows to enter links, relative to the current website, i.e. Path:/wiki/ .

Contributors

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.