b2evolution PHP Cross Reference Blogging Systems

Source: /inc/xmlrpc/apis/_metaweblog.api.php - 598 lines - 19750 bytes - Summary - Text - Print

Description: XML-RPC : MetaWeblog API b2evolution - {@link http://b2evolution.net/} Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}

   1  <?php
   2  /**
   3   * XML-RPC : MetaWeblog API
   4   *
   5   * b2evolution - {@link http://b2evolution.net/}
   6   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   7   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   8   *
   9   * @author tor
  10   *
  11   * @see http://b2evolution.net/man/metaweblog-api
  12   * @see http://www.xmlrpc.com/metaWeblogApi
  13   *
  14   * @package xmlsrv
  15   *
  16   * @version $Id: _metaweblog.api.php 6136 2014-03-08 07:59:48Z manuel $
  17   */
  18  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  19  
  20  
  21  $mwnewMediaObject_doc = 'Uploads a file to the media library of the blog';
  22  $mwnewMediaObject_sig = array(
  23          array($xmlrpcStruct,$xmlrpcInt,$xmlrpcString,$xmlrpcString, $xmlrpcStruct),
  24          array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString, $xmlrpcStruct)
  25      );
  26  /**
  27   * metaWeblog.newMediaObject  image upload
  28   *
  29   * image is supplied coded in the info struct as bits
  30   *
  31   * @see http://www.xmlrpc.com/metaWeblogApi#metaweblognewmediaobject
  32   *
  33   *
  34   * @param xmlrpcmsg XML-RPC Message
  35   *                    0 blogid (string): Unique identifier of the blog the post will be added to.
  36   *                        Currently ignored in b2evo, in favor of the category.
  37   *                    1 username (string): Login for a Blogger user who has permission to edit the given
  38   *                        post (either the user who originally created it or an admin of the blog).
  39   *                    2 password (string): Password for said username.
  40   *                    3 struct (struct)
  41   *                             - name : filename
  42   *                             - type : mimetype
  43   *                             - bits : base64 encoded file
  44   * @return xmlrpcresp XML-RPC Response
  45   */
  46  function mw_newmediaobject($m)
  47  {
  48      return _wp_mw_newmediaobject( $m );
  49  }
  50  
  51  
  52  $mwnewpost_doc='Adds a post, blogger-api like, +title +category +postdate';
  53  $mwnewpost_sig = array(
  54          array($xmlrpcStruct,$xmlrpcInt,$xmlrpcString,$xmlrpcString,$xmlrpcStruct),
  55          array($xmlrpcStruct,$xmlrpcInt,$xmlrpcString,$xmlrpcString,$xmlrpcStruct,$xmlrpcBoolean),
  56          array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcStruct,$xmlrpcBoolean)
  57      );
  58  /**
  59   * metaWeblog.newPost
  60   *
  61   * @param xmlrpcmsg XML-RPC Message
  62   *                    0 blogid (string): Unique identifier of the blog the post will be added to.
  63   *                        Currently ignored in b2evo, in favor of the category.
  64   *                    1 username (string): Login for a Blogger user who has permission to edit the given
  65   *                        post (either the user who originally created it or an admin of the blog).
  66   *                    2 password (string): Password for said username.
  67   *                    3 struct (struct)
  68   *                     4 publish (bool)
  69   * @param string item type 'post' or 'page'
  70   */
  71  function mw_newpost($m, $item_type = 'post' )
  72  {
  73      // CHECK LOGIN:
  74      /**
  75       * @var User
  76       */
  77      if( ! $current_User = & xmlrpcs_login( $m, 1, 2 ) )
  78      {    // Login failed, return (last) error:
  79          return xmlrpcs_resperror();
  80      }
  81  
  82      // GET BLOG:
  83      /**
  84       * @var Blog
  85       */
  86      if( ! $Blog = & xmlrpcs_get_Blog( $m, 0 ) )
  87      {    // Login failed, return (last) error:
  88          return xmlrpcs_resperror();
  89      }
  90  
  91      $xcontent = $m->getParam(3);
  92      $contentstruct = xmlrpc_decode_recurse($xcontent);
  93      logIO( 'Decoded xcontent' );
  94  
  95      $status = 'published';
  96      if( isset($m->params[4]) )
  97      {    // getParam(4) is a flag for publish or draft
  98          $xstatus = $m->getParam(4);
  99          $xstatus->scalarval();
 100          $status = $xstatus ? 'published' : 'draft'; // might be overrided later
 101      }
 102  
 103      $cat_IDs = _mw_get_cat_IDs( $contentstruct, $Blog );
 104      $date = _mw_decode_date( $contentstruct );
 105  
 106      if( !empty($contentstruct['post_type']) && $contentstruct['post_type'] != $item_type )
 107      {    // Overwrite from struct
 108          $item_type = $contentstruct['post_type'];
 109      }
 110  
 111      $tags = isset($contentstruct['mt_keywords']) ? $contentstruct['mt_keywords'] : '';
 112      $content = isset($contentstruct['description']) ? $contentstruct['description'] : '';
 113      $excerpt = isset($contentstruct['mt_excerpt']) ? $contentstruct['mt_excerpt'] : '';
 114      $urltitle = isset($contentstruct['wp_slug']) ? $contentstruct['wp_slug'] : '';
 115      $featured = isset($contentstruct['sticky']) ? $contentstruct['sticky'] : 0;
 116      $order = isset($contentstruct['wp_page_order']) ? $contentstruct['wp_page_order'] : 0;
 117      $custom_fields = isset($contentstruct['custom_fields']) ? $contentstruct['custom_fields'] : '';
 118      $parent_ID = isset($contentstruct['wp_page_parent_id']) ? $contentstruct['wp_page_parent_id'] : '';
 119  
 120      $item_typ_ID = isset($contentstruct['wp_post_format']) ? $contentstruct['wp_post_format'] : 1;
 121      if( $item_type == 'page' )
 122      {    // Force item type 'page'
 123          $item_typ_ID = 1000;
 124      }
 125  
 126      if( !empty( $contentstruct[$item_type.'_status'] ) )
 127      {    // Use WP status
 128          $status = wp_or_b2evo_item_status( $contentstruct[$item_type.'_status'], 'b2evo' );
 129      }
 130  
 131      if( !empty($content_struct['mt_text_more']) )
 132      {    // Add content extension
 133          $content .= '<!--more-->'.$content_struct['mt_text_more'];
 134      }
 135      //logIO( "Item content:\n".$content );
 136  
 137      if( !empty($content_struct['enclosure']) && is_array($content_struct['enclosure']) )
 138      {    // Add content extension
 139          $enclosure = $content_struct['enclosure'];
 140          if( isset($enclosure['url']) && isset($enclosure['length']) && isset($enclosure['type']) )
 141          {
 142              logIO( "Item enclosure\n".var_export($enclosure, true) );
 143              // TODO: sam2kb> Handle enclosures
 144          }
 145      }
 146  
 147      $comment_status = 'open';
 148      if( isset($contentstruct['mt_allow_comments']) )
 149      {
 150          if( ! $contentstruct['mt_allow_comments'] || in_array( $contentstruct['mt_allow_comments'], array(2,'closed') ) )
 151          {    // Comments disabled
 152              $comment_status = 'disabled';
 153          }
 154      }
 155  
 156      $params = array(
 157              'title'                => $contentstruct['title'],
 158              'content'            => $content,
 159              'cat_IDs'            => $cat_IDs,
 160              'status'            => $status,
 161              'date'                => $date,
 162              'tags'                => $tags,
 163              'excerpt'            => $excerpt,
 164              'item_typ_ID'        => $item_typ_ID,
 165              'comment_status'    => $comment_status,
 166              'urltitle'            => $urltitle,
 167              'featured'            => $featured,
 168              'order'                => $order,
 169              'parent_ID'            => $parent_ID,
 170              'custom_fields'        => $custom_fields,
 171          );
 172  
 173      // COMPLETE VALIDATION & INSERT:
 174      return xmlrpcs_new_item( $params, $Blog );
 175  }
 176  
 177  
 178  $mweditpost_doc='Edits a post, blogger-api like, +title +category +postdate';
 179  $mweditpost_sig = array(
 180          array($xmlrpcBoolean,$xmlrpcInt,$xmlrpcString,$xmlrpcString,$xmlrpcStruct),
 181          array($xmlrpcBoolean,$xmlrpcInt,$xmlrpcString,$xmlrpcString,$xmlrpcStruct,$xmlrpcBoolean),
 182          array($xmlrpcBoolean,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcStruct,$xmlrpcBoolean),
 183      );
 184  /**
 185   * metaWeblog.editPost
 186   *
 187   * @see http://www.xmlrpc.com/metaWeblogApi#basicEntrypoints
 188   *
 189   * @param xmlrpcmsg XML-RPC Message
 190   *                    0 postid (string): Unique identifier of the post to edit
 191   *                    1 username (string): Login for a Blogger user who has permission to edit the given
 192   *                        post (either the user who originally created it or an admin of the blog).
 193   *                    2 password (string): Password for said username.
 194   *                    3 struct (struct)
 195   *                    4 publish (bool)
 196   * @param string item type 'post' or 'page'
 197   */
 198  function mw_editpost( $m, $item_type = 'post' )
 199  {
 200      // CHECK LOGIN:
 201      /**
 202       * @var User
 203       */
 204      if( ! $current_User = & xmlrpcs_login( $m, 1, 2 ) )
 205      {    // Login failed, return (last) error:
 206          return xmlrpcs_resperror();
 207      }
 208  
 209      // GET POST:
 210      /**
 211       * @var Item
 212       */
 213      if( ! $edited_Item = & xmlrpcs_get_Item( $m, 0 ) )
 214      {    // Failed, return (last) error:
 215          return xmlrpcs_resperror();
 216      }
 217  
 218      // We need to be able to edit this post:
 219      if( ! $current_User->check_perm( 'item_post!CURSTATUS', 'edit', false, $edited_Item ) )
 220      {
 221          return xmlrpcs_resperror( 3 ); // Permission denied
 222      }
 223  
 224      $xcontent = $m->getParam(3);
 225      $contentstruct = xmlrpc_decode_recurse($xcontent);
 226      logIO('Decoded xcontent');
 227  
 228      if( isset($m->params[4]) )
 229      {    // getParam(4) is a flag for publish or draft
 230          $xstatus = $m->getParam(4);
 231          $xstatus = $xstatus->scalarval();
 232          $status = $xstatus ? 'published' : 'draft'; // might be overrided later
 233      }
 234  
 235      $cat_IDs = _mw_get_cat_IDs( $contentstruct, $edited_Item->get_Blog(), true /* empty is ok */ );
 236      $date = _mw_decode_date( $contentstruct );
 237  
 238      if( !empty($contentstruct['post_type']) && $contentstruct['post_type'] != $item_type )
 239      {    // Overwrite from struct
 240          $item_type = $contentstruct['post_type'];
 241      }
 242  
 243      // Don't overwrite if not set
 244      $tags = isset($contentstruct['mt_keywords']) ? $contentstruct['mt_keywords'] : NULL;
 245      $content = isset($contentstruct['description']) ? $contentstruct['description'] : NULL;
 246      $excerpt = isset($contentstruct['mt_excerpt']) ? $contentstruct['mt_excerpt'] : NULL;
 247      $urltitle = isset($contentstruct['wp_slug']) ? $contentstruct['wp_slug'] : NULL;
 248      $parent_ID = isset($contentstruct['wp_page_parent_id']) ? $contentstruct['wp_page_parent_id'] : NULL;
 249      $author_ID = isset($contentstruct['wp_author_id']) ? $contentstruct['wp_author_id'] : NULL;
 250      $featured = isset($contentstruct['sticky']) ? $contentstruct['sticky'] : NULL;
 251      $order = isset($contentstruct['wp_page_order']) ? $contentstruct['wp_page_order'] : NULL;
 252      $custom_fields = isset($contentstruct['custom_fields']) ? $contentstruct['custom_fields'] : NULL;
 253      $item_typ_ID = isset($contentstruct['wp_post_format']) ? $contentstruct['wp_post_format'] : NULL;
 254  
 255      if( isset($contentstruct[$item_type.'_status']) )
 256      {
 257          $status = wp_or_b2evo_item_status( $contentstruct[$item_type.'_status'], 'b2evo' );
 258      }
 259  
 260      if( isset($content_struct['mt_text_more']) )
 261      {    // Add content extension
 262          $content .= '<!--more-->'.$content_struct['mt_text_more'];
 263      }
 264      //logIO( "Item content:\n".$content );
 265  
 266      if( !empty($content_struct['enclosure']) && is_array($content_struct['enclosure']) )
 267      {    // Add content extension
 268          $enclosure = $content_struct['enclosure'];
 269          if( isset($enclosure['url']) && isset($enclosure['length']) && isset($enclosure['type']) )
 270          {
 271              logIO( "Item enclosure\n".var_export($enclosure, true) );
 272              // TODO: sam2kb> Handle enclosures
 273          }
 274      }
 275  
 276      $comment_status = ''; // Don't overwrite if not set
 277      if( isset($contentstruct['mt_allow_comments']) )
 278      {
 279          if( ! $contentstruct['mt_allow_comments'] || in_array( $contentstruct['mt_allow_comments'], array(2,'closed') ) )
 280          {    // Comments disabled
 281              $comment_status = 'disabled';
 282          }
 283          else
 284          {
 285              $comment_status = 'open';
 286          }
 287      }
 288  
 289      $params = array(
 290              'title'                => $contentstruct['title'],
 291              'content'            => $content,
 292              'cat_IDs'            => $cat_IDs,
 293              'status'            => $status,
 294              'date'                => $date,
 295              'tags'                => $tags,
 296              'excerpt'            => $excerpt,
 297              'item_typ_ID'        => $item_typ_ID,
 298              'comment_status'    => $comment_status,
 299              'urltitle'            => $urltitle,
 300              'parent_ID'            => $parent_ID,
 301              'author_ID'            => $author_ID,
 302              'featured'            => $featured,
 303              'order'                => $order,
 304              'custom_fields'        => $custom_fields,
 305          );
 306  
 307      // COMPLETE VALIDATION & INSERT:
 308      return xmlrpcs_edit_item( $edited_Item, $params );
 309  
 310  
 311      /*
 312      // Time to perform trackbacks NB NOT WORKING YET
 313      //
 314      // NB Requires a change to the _trackback library
 315      //
 316      // function trackbacks( $post_trackbacks, $content, $post_title, $post_ID )
 317  
 318      // first extract these from posting as post_trackbacks array, then rest is easy
 319      //     <member>
 320      //        <name>mt_tb_ping_urls</name>
 321      //    <value><array><data>
 322      //        <value><string>http://archive.scripting.com/2005/04/17</string></value>
 323      //    </data></array></value>
 324      //    </member>
 325      // First check that trackbacks are allowed - mt_allow_pings
 326      $trackback_ok = 0;
 327      $trackbacks = array();
 328      $trackback_ok = $contentstruct['mt_allow_pings'];
 329      logIO("Trackback OK  ...".$trackback_ok);
 330      if ($trackback_ok == 1)
 331      {
 332          $trackbacks = $contentstruct['mt_tb_ping_urls'];
 333          logIO("Trackback url 0  ...".$trackbacks[0]);
 334          $no_of_trackbacks = count($trackbacks);
 335          logIO("Number of Trackbacks  ...".$no_of_trackbacks);
 336          if ($no_of_trackbacks > 0)
 337          {
 338              logIO("Calling Trackbacks  ...");
 339              load_funcs('comments/_trackback.funcs.php');
 340               $result = trackbacks( $trackbacks, $content, $post_title, $post_ID );
 341              logIO("Returned from  Trackbacks  ...");
 342           }
 343  
 344      }
 345      */
 346  }
 347  
 348  
 349  $mwgetcats_sig =  array(
 350          array($xmlrpcStruct,$xmlrpcInt,$xmlrpcString,$xmlrpcString),
 351          array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString)
 352      );
 353  $mwgetcats_doc = 'Get categories of a post, MetaWeblog API-style';
 354  /**
 355   * metaWeblog.getCategories
 356   *
 357   * @see http://www.xmlrpc.com/metaWeblogApi#metawebloggetcategories
 358   *
 359   * @param xmlrpcmsg XML-RPC Message
 360   *                    0 blogid (string): Unique identifier of the blog the post will be added to.
 361   *                        Currently ignored in b2evo, in favor of the category.
 362   *                    1 username (string): Login for a Blogger user who has permission to edit the given
 363   *                        post (either the user who originally created it or an admin of the blog).
 364   *                    2 password (string): Password for said username.
 365   */
 366  function mw_getcategories( $m )
 367  {
 368      return _wp_mw_getcategories ( $m ) ;
 369  }
 370  
 371  
 372  $metawebloggetrecentposts_doc = 'fetches X most recent posts, blogger-api like';
 373  $metawebloggetrecentposts_sig = array(
 374          array($xmlrpcArray,$xmlrpcInt,$xmlrpcString,$xmlrpcString,$xmlrpcInt),
 375          array($xmlrpcArray,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcInt),
 376      );
 377  /**
 378   * metaWeblog.getRecentPosts
 379   *
 380   * @see http://xmlrpc.scripting.com/metaWeblogApi.html#metawebloggetrecentposts
 381   *
 382   * @param xmlrpcmsg XML-RPC Message
 383   *                    0 blogid (string): Unique identifier of the blog the post will be added to.
 384   *                        Currently ignored in b2evo, in favor of the category.
 385   *                    1 username (string): Login for a Blogger user who has permission to edit the given
 386   *                        post (either the user who originally created it or an admin of the blog).
 387   *                    2 password (string): Password for said username.
 388   *                    3 numposts (integer): number of posts to retrieve.
 389   */
 390  function mw_getrecentposts( $m )
 391  {
 392      // CHECK LOGIN:
 393      /**
 394       * @var User
 395       */
 396      if( ! $current_User = & xmlrpcs_login( $m, 1, 2 ) )
 397      {    // Login failed, return (last) error:
 398          return xmlrpcs_resperror();
 399      }
 400  
 401      // GET BLOG:
 402      /**
 403       * @var Blog
 404       */
 405      if( ! $Blog = & xmlrpcs_get_Blog( $m, 0 ) )
 406      {    // Login failed, return (last) error:
 407          return xmlrpcs_resperror();
 408      }
 409  
 410      $limit = $m->getParam(3);
 411      $limit = abs($limit->scalarval());
 412  
 413      $items = xmlrpc_get_items( array(
 414              'limit' => $limit,
 415          ), $Blog );
 416  
 417      if( empty($items) )
 418      {
 419          return new xmlrpcresp( new xmlrpcval( array(), 'array' ) );
 420      }
 421  
 422      $data = array();
 423      foreach( $items as $item )
 424      {
 425          $data[] = new xmlrpcval( $item, 'struct' );
 426      }
 427  
 428      logIO( 'OK.' );
 429      return new xmlrpcresp( new xmlrpcval( $data, 'array' ) );
 430  }
 431  
 432  
 433  $mwgetusersblogs_doc = 'returns the user\'s blogs - this is a dummy function, just so that BlogBuddy and other blogs-retrieving apps work';
 434  $mwgetusersblogs_sig = array(
 435          array($xmlrpcArray,$xmlrpcInt,$xmlrpcString,$xmlrpcString),
 436          array($xmlrpcArray,$xmlrpcString,$xmlrpcString,$xmlrpcString)
 437      );
 438  /**
 439   * metaweblog.getUsersBlogs returns information about all the blogs a given user is a member of.
 440   *
 441   * Data is returned as an array of <struct>s containing the ID (blogid), name (blogName),
 442   * and URL (url) of each blog.
 443   *
 444   * Non official: Also return a boolean stating wether or not the user can edit th eblog templates
 445   * (isAdmin).
 446   *
 447   * @see http://www.xmlrpc.com/stories/storyReader$2460
 448   *
 449   * @param xmlrpcmsg XML-RPC Message
 450   *                    0 appkey (string): Unique identifier/passcode of the application sending the post.
 451   *                        (See access info {@link http://www.blogger.com/developers/api/1_docs/#access} .)
 452   *                    1 username (string): Login for the Blogger user who's blogs will be retrieved.
 453   *                    2 password (string): Password for said username.
 454   *                        (currently not required by b2evo)
 455   * @return xmlrpcresp XML-RPC Response, an array of <struct>s containing for each blog:
 456   *                    - ID (blogid),
 457   *                    - name (blogName),
 458   *                    - URL (url),
 459   *                    - bool: can user edit template? (isAdmin).
 460   */
 461  function mw_getusersblogs($m)
 462  {
 463      return _wp_or_blogger_getusersblogs( 'blogger', $m );
 464  }
 465  
 466  
 467  $mwgetpost_doc = 'Fetches a post, blogger-api like';
 468  $mwgetpost_sig = array(
 469          array($xmlrpcStruct,$xmlrpcInt,$xmlrpcString,$xmlrpcString),
 470          array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString),
 471      );
 472  /**
 473   * metaWeblog.getPost retieves a given post.
 474   *
 475   * @see http://www.xmlrpc.com/metaWeblogApi#basicEntrypoints
 476   *
 477   * @param xmlrpcmsg XML-RPC Message
 478   *                    0 postid (string): Unique identifier of the post
 479   *                    1 username (string): Login for a Blogger user who has permission to edit the given
 480   *                        post (either the user who originally created it or an admin of the blog).
 481   *                    2 password (string): Password for said username.
 482   * @return xmlrpcresp XML-RPC Response
 483   */
 484  function mw_getpost($m)
 485  {
 486      // CHECK LOGIN:
 487      /**
 488       * @var User
 489       */
 490      if( ! $current_User = & xmlrpcs_login( $m, 1, 2 ) )
 491      {    // Login failed, return (last) error:
 492          return xmlrpcs_resperror();
 493      }
 494  
 495      // GET POST:
 496      /**
 497       * @var Item
 498       */
 499      if( ! $edited_Item = & xmlrpcs_get_Item( $m, 0 ) )
 500      {    // Failed, return (last) error:
 501          return xmlrpcs_resperror();
 502      }
 503  
 504      // CHECK PERMISSION:
 505      if( ! xmlrpcs_can_view_item( $edited_Item, $current_User ) )
 506      {    // Permission denied
 507          return xmlrpcs_resperror( 3 );    // User error 3
 508      }
 509  
 510      $item = _wp_mw_get_item_struct($edited_Item);
 511  
 512      logIO( 'OK.' );
 513      return new xmlrpcresp( new xmlrpcval( $item, 'struct' ) );
 514  }
 515  
 516  
 517  $mwdeletepost_doc = 'Deletes a post, blogger-api like';
 518  $mwdeletepost_sig = array(array($xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean));
 519  /**
 520   * metaWeblog.deletePost deletes a given post.
 521   *
 522   * This API call is not documented on
 523   * {@link http://www.blogger.com/developers/api/1_docs/}
 524   * @see http://www.xmlrpc.com/stories/storyReader$2460
 525   *
 526   * @param xmlrpcmsg XML-RPC Message
 527   *                    0 appkey (string): Unique identifier/passcode of the application sending the post.
 528   *                        (See access info {@link http://www.blogger.com/developers/api/1_docs/#access} .)
 529   *                    1 postid (string): Unique identifier of the post to be deleted.
 530   *                    2 username (string): Login for a Blogger user who has permission to edit the given
 531   *                        post (either the user who originally created it or an admin of the blog).
 532   *                    3 password (string): Password for said username.
 533   * @return xmlrpcresp XML-RPC Response
 534   */
 535  function mw_deletepost($m)
 536  {
 537      // CHECK LOGIN:
 538      if( ! $current_User = & xmlrpcs_login( $m, 2, 3 ) )
 539      {    // Login failed, return (last) error:
 540          return xmlrpcs_resperror();
 541      }
 542  
 543      // GET POST:
 544      /**
 545       * @var Item
 546       */
 547      if( ! $edited_Item = & xmlrpcs_get_Item( $m, 1 ) )
 548      {    // Failed, return (last) error:
 549          return xmlrpcs_resperror();
 550      }
 551  
 552      return xmlrpcs_delete_item( $edited_Item );
 553  }
 554  
 555  
 556  $xmlrpc_procs['metaWeblog.newMediaObject'] = array( // OK
 557                  'function' => 'mw_newmediaobject',
 558                  'signature' => $mwnewMediaObject_sig,
 559                  'docstring' => $mwnewMediaObject_doc);
 560  
 561  $xmlrpc_procs['metaWeblog.newPost'] = array( // Incomplete (minor): handle 'enclosure', 'custom_fields' in WP
 562                  'function' => 'mw_newpost',
 563                  'signature' => $mwnewpost_sig,
 564                  'docstring' => $mwnewpost_doc );
 565  
 566  $xmlrpc_procs['metaWeblog.editPost'] = array( // Incomplete (minor): handle 'enclosure', 'custom_fields' in WP
 567                  'function' => 'mw_editpost',
 568                  'signature' => $mweditpost_sig,
 569                  'docstring' => $mweditpost_doc );
 570  
 571  $xmlrpc_procs['metaWeblog.getPost'] = array( // OK
 572                  'function' => 'mw_getpost',
 573                  'signature' => $mwgetpost_sig,
 574                  'docstring' => $mwgetpost_doc );
 575  
 576  $xmlrpc_procs['metaWeblog.getCategories'] = array(
 577                  'function' => 'mw_getcategories',
 578                  'signature' => $mwgetcats_sig,
 579                  'docstring' => $mwgetcats_doc );
 580  
 581  $xmlrpc_procs['metaWeblog.getRecentPosts'] = array(
 582                  'function' => 'mw_getrecentposts',
 583                  'signature' => $metawebloggetrecentposts_sig,
 584                  'docstring' => $metawebloggetrecentposts_doc );
 585  
 586  // Blogger aliases, as in http://www.xmlrpc.com/stories/storyReader$2460
 587  
 588  $xmlrpc_procs['metaWeblog.deletePost'] = array(
 589                  'function' => 'mw_deletepost',
 590                  'signature' => $mwdeletepost_sig,
 591                  'docstring' => $mwdeletepost_doc );
 592  
 593  $xmlrpc_procs['metaWeblog.getUsersBlogs'] = array(
 594                  'function' => 'mw_getusersblogs',
 595                  'signature' => $mwgetusersblogs_sig,
 596                  'docstring' => $mwgetusersblogs_doc );
 597  
 598  ?>

title

Description

title

Description

title

Description

title

title

Body