[pmwiki-users] Page Variable for creator, problem...

Hans design5 at softflow.co.uk
Fri Dec 21 18:16:25 CST 2007


Friday, December 21, 2007, 11:36:57 PM, Anke wrote:

>> But I don't know how you want it saved. written when a page gets
>> posted as a page text variable?

> No, page variable, not page text variable - I'd like it saved on
> creation of the page, like the creation date suggested at the
> bottom of http://www.pmwiki.org/wiki/PmWiki/PageVariables

Here is a page variable definition for {$Creator}
Add to config.php:

$FmtPV['$Creator'] = 'PageCreationAuthor($pagename)';
function PageCreationAuthor($pagename) {
        $page = RetrieveAuthPage($pagename, 'read', true);
        foreach($page as $key => $value)
                if (strstr($key,'author'))
                        $authors[$key] = $value;
        return end($authors);
}


Hans




More information about the pmwiki-users mailing list