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

imoc blog.oc at gmail.com
Thu Jan 31 03:18:10 CST 2008


>
> $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);
> } 
>

Hi Hans, I add these code in 'config.php' and put {$Creator} variable in 
'Site.PageAction' like 'Post by {*$Creator}'. It worked in every page 
except new page. While creating new page, there is a warning:

 Warning: end() [function.end]: Passed variable is not an array or 
 object in /home/jbooknet/public_html/tw/local/config.php on line 121

In my config.php the line 121 is:

         return end($authors);

If I ignore the message. The page can be saved with no problem. and 
everything are ok at next edit.

imoc




More information about the pmwiki-users mailing list