Url Approvals

A script urlapprove.php for approval of Internet addresses (URL) is supplied with the standard distribution. To activate it, you have to add to the local/config.php file:

 include_once('scripts/urlapprove.php');

You will then approve URLs while adding them to a "white list" defined in the variable $WhiteUrlPatterns which is set in the local/config.php file.
To add multiples URLs, use the separator | . By example:

 $WhiteUrlPatterns =
   "http://example.com/|http://example.net/|http://example.org/";

To add all URLs from, say New Zealand and Australia, use

 $WhiteUrlPatterns[] = 'http://[^/]+\\.nz';
 $WhiteUrlPatterns[] = 'http://[^/]+\\.au';

This white list is also completed by loading the content of the Main.ApprovedUrls page.

Following a non-approved link will be displayed a message "(Approve sites)". A click on this message will approve all sites of the page, if you have writing rights on the Main.ApprovedUrls page.
If you don't want the links to be approved by everyone, this page must be protected by a password. Then, the password will be requested after clicking the "(approve sites)" link.

If you want to change the name of this page write in local/config.php (after the script inclusion line):

  $ApprovedUrlPagesFmt = array('OtherGroup.OtherName');

Generally, it might be

  array('$DefaultGroup.ApprovedUrls');

You can limit the number of unapproved links per page. If the number is exceeded, the page cannot be posted. This is useful because spammers write long link lists. To activate this limit write in the local/config.php file the next line (value 5 is only for example):

  $UnapprovedLinkCountMax = 5; #by default 100000

You can also make PmWiki display a disapproval message defined in the $UnapprovedLinkFmt variable, by example:

 $UnapprovedLinkFmt = 
  "<b>Address not displayed before approval</b>
   <a class='apprlink' href='\$PageUrl?action=approvesites'>
   $[(approve sites)]</a>";

This is not very useful for the person in charge of links approval, so use it only if really required, or if you wish to totally forbid link addition. In that case, the message can simply be:

  $UnapprovedLinkFmt = "<b>No link allowed</b>";


<< Available actions | Documentation Index | Variables >>