Bloge-UrlApprove

Summary:Approve links one at a time
Version:2009-08-10
Prerequisites: PmWiki 2.2.x
Status: beta
Maintainer: Eemeli Aro
Categories: Blog, Links

Description

This is a wrapper for PmWiki's default UrlApprovals that adds the possibility to approve links one at a time rather than all at once for a full page.

Bloge-UrlApprove is a part of Cookbook.Bloge, but may also be used as a standalone recipe.

To install this recipe:

  • download bloge-urlapprove.phpΔ to your cookbook directory
  • add the following line to your configuration file:
    include_once("$FarmD/cookbook/bloge-urlapprove.php");

Usage

Follow the instructions as on PmWiki.UrlApprovals, except for including this recipe instead of urlapprove.php as shown above. With Bloge-UrlApprove, the default value of $UnapprovedLinkFmt is also different:

SDV($UnapprovedLinkFmt, empty($AuthId)
  ? '$LinkText'
  : "<u>\$LinkText</u>
<a class='apprlink' rel='nofollow' href='\$LinkUrl' title='$[Unapproved link]'>($[test])</a>
<a class='apprlink' rel='nofollow' href='{\$PageUrl}?action=approvelink&link=\$LinkUrl' title='$[Approve link]'>($[url ok])</a>
<a class='apprlink' rel='nofollow' href='{\$PageUrl}?action=approvelinksite&link=\$LinkUrl' title='$[Approve site]'>($[site ok])</a>");

In other words, links are shown as text only if the user isn't logged in using AuthUser and if logged in, links are provided to test and approve the link. Set this as required in your configuration file before including the recipe.

Notes

A new page variable {$LinksToApprove} is also provided, containing the number of unapproved links on the current page. This includes links in sidebars and other page elements.

The default dependency on AuthUser is known, and may be fixed in a later release.

Release notes

See also

Contributors

Comments

See discussion at Bloge-UrlApprove-Talk

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.