[pmwiki-users] Require: Permanent page creator name [little bug]

imoc blog.oc at gmail.com
Thu Jan 31 07:33:44 CST 2008


    For a new page there is no author set in the page attributes.
    Try this:

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

    or perhaps the last line could also be

       else return '{$Author}';


    ~Hans

Thanks Hans,

As usual, it worked again. :)

imoc




More information about the pmwiki-users mailing list