[pmwiki-users] Review before post Comments

Patrick R. Michaud pmichaud at pobox.com
Tue Jun 21 13:41:26 CDT 2005


On Tue, Jun 21, 2005 at 10:14:42AM -0700, John W Morris wrote:
>    Has anyone seen a "Review before Post" comment script?

PmWiki doesn't have this "built-in", but I'll outline how one
could do it.

One trick is to have a separate directory for storing pages with
unapproved edits.  This can be done with:

    if ($action == 'edit') {
       $WikiDir = new PageStore('edit.d/$FullName');
       $WikiLibDirs = array(&$WikiDir,
         new PageStore('wiki.d/$FullName'),
         new PageStore('wikilib.d/$FullName'));
    }

What this does is to cause any operations associated with ?action=edit
to be performed on files in the edit.d/ directory in preference to wiki.d/ .
Then, when a moderator wants to "approve" a particular page, the
pagefile is simply moved from edit.d/ into the wiki.d/ directory, so
that it appears for all of the "non-edit" actions such as browse.

Might be worth a cookbook recipe.

Pm



More information about the pmwiki-users mailing list