[pmwiki-users] setting $Author with $AuthId as prefix

marc gmane at auxbuss.com
Mon Jan 22 09:44:28 CST 2007


Kathryn Andersen said...
 
> This is what I've done:
> 
>         include_once("$FarmD/scripts/author.php");
>         include_once("$FarmD/scripts/authuser.php");
>         # The author is prepended with the authId
>         # To make this easier, use '-' as a separator
>         # AuthId-Author
>         if ($Author) {

There seems to be something funky going on in author.php. 

If you remove the include for author.php and precede the above 'if' 
with:

  $Author = $_POST['author'];

then all looks good here. However, this won't preserve the change of 
author to "userid-Kathryn" for subsequent edits. Not sure whether this 
is a requirement or not.

>             if (strstr($Author, '-') != false) {
>                 $auth_split = explode('-', $Author, 2);
>                 $Author = $AuthId . '-' . $auth_split[1];
>             } else if ($Author != $AuthId) {
>                 $Author = $AuthId . '-' . $Author;
>             } else {
>                 $Author = $AuthId;
>             }
>         } else {
>             $Author = $AuthId;
>         }
> 
> This sort of works, as follows:
> 
> A) Initial edit: Author field is pre-filled with "userid".
> If I don't change this, then the Author is "userid".
> If I delete "userid" and type in "Kathryn", then
> - the History of the page says that the change was made by
>   "userid-Kathryn" (good)
> - the Recent Changes page says that the change was made by "Kathryn".
>   (bad)
> 
> B) Next edit: the Author field is pre-filled with "userid-Kathryn".
> If I leave it like that, then both the History of the page, and the
> Recent Changes page say that the change was made by "userid-Kathryn".
> 
> So why isn't the "userid-Kathryn" being used in the Recent Changes page
> in case A?


-- 
Cheers,
Marc





More information about the pmwiki-users mailing list