Plugin Directory

Changeset 760469


Ignore:
Timestamp:
08/22/2013 02:55:27 AM (13 years ago)
Author:
nethmk
Message:

Version 0.2.0.8 ( Fix few bugs )

Location:
exxmlrpc/tags/0.2.0.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • exxmlrpc/tags/0.2.0.8/Readme.txt

    r748678 r760469  
    5252* first releace version.
    5353
     54= 0.2.0.8 =
     55Fix the search function of past articles.
     56
     57
    5458== Upgrade Notice ==
    5559
  • exxmlrpc/tags/0.2.0.8/exxmlrpc.php

    r738064 r760469  
    22/*
    33Plugin Name: ExXmlRpc for WordPressPost
    4 Version: 0.2.0.7
     4Version: 0.2.0.8
    55Plugin URI:http://wpp.nethmk.com/plugin/ExXmlRpcForWPP/ExXmlRpc.zip
    66Description:ExXmlRpc(WordPressPost) is a plugin to post to WordPress from WordPressPost.
     
    3939        $this->methods['wpex.findRecentPostTitles'] = 'this:wpex_findRecentPostTitles';
    4040        $this->methods['wpex.replaceString'] = 'this:wpex_replaceString';
     41        $this->methods['wpex.getPages'] = 'this:wpex_getPages';
    4142    }
    4243
     
    560561           
    561562            if ( $postdate <> '' ){
    562                 $postedDate = date('Ymd',strtotime($entry['post_date_gmt']));
     563/*              $postedDate = date('Ymd',strtotime($entry['post_date_gmt']));   */
     564                $postedDate = date('Ymd',strtotime($entry['post_date']));
    563565                if ( stristr($postedDate , $postdate) == false ){
    564566                    $findPost = false;
     
    759761    }
    760762
     763/* ------------------------------------------------------------------------- */
     764/* Get Pages */
     765/* ------------------------------------------------------------------------- */
     766    function wpex_getPages($args) {
     767
     768        $this->escape($args);
     769
     770        $blog_id    = (int) $args[0];
     771        $username   = $args[1];
     772        $password   = $args[2];
     773        $num_pages  = isset($args[3]) ? (int) $args[3] : 10;
     774
     775        if ( !$user = $this->login($username, $password) )
     776            return $this->error;
     777
     778        if ( !current_user_can( 'edit_pages' ) )
     779            return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
     780
     781        do_action('xmlrpc_call', 'wp.getPages');
     782
     783        $pages = get_posts( array('post_type' => 'page', 'post_status' => 'any', 'numberposts' => $num_pages) );
     784        $num_pages = count($pages);
     785
     786        // If we have pages, put together their info.
     787        if ( $num_pages >= 1 ) {
     788            $pages_struct = array();
     789
     790            foreach ($pages as $page) {
     791                if ( current_user_can( 'edit_page', $page->ID ) )
     792
     793                    $post_date = mysql2date('Ymd\TH:i:s', $page['post_date'], false);
     794                    $pages_struct[] = array(
     795                        'dateCreated' => new IXR_Date($post_date),
     796                        'title' => $page->post_title,
     797                        'userid' => $page->post_author,
     798                        'page_id' => $page->ID,
     799                        'page_status' => $page->post_status
     800                    );
     801
     802            }
     803
     804            return($pages_struct);
     805        }
     806        // If no pages were found return an error.
     807        else {
     808            return(array());
     809        }
     810    }
     811
    761812}
    762813
    763 
    764814?>
Note: See TracChangeset for help on using the changeset viewer.