Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(0);
- require_once("IXR_Library.php.inc");
- // Create the client object
- $client = new IXR_Client('http://site.info/xmlrpc.php');
- $username = "admin";
- $password = "pass";
- $params = array(0,$username,$password,10); // Last Parameter tells how many posts to fetch
- // Run a query To Read Posts From Wordpress
- if (!$client->query('metaWeblog.getRecentPosts', $params)) {
- die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
- }
- $myresponse = $client->getResponse(); $i=0; ?>
- <table border="1" cellpadding="0" cellspacing="2">
- <tr>
- <td>Sr. No</td>
- <td>Date</td>
- <td>Author</td>
- <td>Post Id</td>
- <td>Title</td>
- <td>Categories</td>
- <td>Tags</td>
- <td>Status</td>
- </tr>
- <?php //foreach ($myresponse as $key => $value)
- foreach ($myresponse as $res) {
- if($res['post_status']!="draft"){
- //$times = new IXR_Date(); ?>
- <tr>
- <td><?php echo $i+1; ?></td>
- <td> <?php $object = $res['dateCreated']; echo $object->day."-".$object->month."-".$object->year." ".$object->hour.":".$object->minute; ?></td>
- <td><?php echo $res['wp_author_display_name']; ?></td>
- <td><?php echo $res['postid']; ?></td>
- <td><a href="<?php echo $res['permaLink']; ?>"><?php echo $res['title']; ?></a></td>
- <td> <?php echo implode($res['categories'],", ") ?> </td>
- <td><?php echo $res['mt_keywords']; ?></td>
- <td><?php echo $res['post_status']; ?></td>
- </tr>
- <?php $i++; } } ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement