[pmwiki-users] [xmlrpc] ... PostWikiPage

Stéphane Heckel hsteph at club-internet.fr
Mon Mar 17 14:06:01 CDT 2008


The code below is part of the xmlrpc\blogger.php. It writes a wiki page with 
I would like to set/add the author name ($username), ...
It seems that adding $newpage['author'] = $username is not enough, ...
How should I do that ?



  function PostWikiPage($pagename, $content, $publish, $isnew=false) {
    global $EditFunctions;

    $oldpage = RetrieveAuthPage($pagename, 'edit', false);
    if (!$oldpage) {
      return new xmlrpcresp(0, 101, "Permission denied to edit page");

    // If the publish flag is set then tell PmWiki that we are posting
    if($publish) $_POST['post'] = 1;


    // Set new content and perform all edit functions that apply on new page
    $newpage = $oldpage;
    $newpage['text'] = str_replace("\r",'', $content);

    foreach((array)$EditFunctions as $fn) $fn($pagename,$oldpage,$newpage);

    if($isnew) {
      return new xmlrpcresp(new xmlrpcval($pagename));
    } else {
      return new xmlrpcresp(new xmlrpcval(1,"boolean"));

More information about the pmwiki-users mailing list