[pmwiki-users] Is 'Page Creator' worth to discuss?

Hans design5 at softflow.co.uk
Sun Feb 24 12:58:28 CST 2008


Sunday, February 24, 2008, 6:18:53 PM, Hans wrote:

> The SetPageCreator function sets cauthor everytime new when the page
> is saved, not just when the page is saved the first time.

I think this will do it:
the 'author' attribute does not exist before the first page save:

# set page creator attribute 'cauthor' automatically to $Author
function SetPageCreator($pagename, &$page, &$new) {
        global $EnablePost, $Author, $PageCreator, $Now;
        SDV($PageCreator, $Author);
        if ($EnablePost && !$new["author"])
                $new["cauthor"] = $PageCreator; 
}
array_unshift($EditFunctions, 'SetPageCreator');



  ~Hans




More information about the pmwiki-users mailing list