function express_editPost($args)
{
    global $nxt_xmlrpc_server;
    if (get_option('woo_tumblog_content_method') == 'post_format') {
        $args = express_woo_post_format($args);
    } else {
        $args = express_woo_taxonomy($args);
    }
    $result = $nxt_xmlrpc_server->mw_editPost($args);
    if ($result == false) {
        return false;
    }
    // Insert taxonomies
    if (get_option('woo_tumblog_content_method') != 'post_format') {
        if (isset($content_struct['taxonomy'])) {
            set_new_taxonomy_tag($post_ID, $content_struct['taxonomy']);
        }
    }
    // TODO: Remove old attachments
    // Add new attachments
    $post_ID = (int) $args[0];
    $content_struct = $args[3];
    $attachments = $content_struct['attachments'];
    if (is_array($attachments)) {
        foreach ($attachments as $attachment_ID) {
            $attachment_post = nxt_get_single_post($attachment_ID, ARRAY_A);
            extract($attachment_post, EXTR_SKIP);
            $post_parent = $post_ID;
            $postdata = compact('ID', 'post_parent', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt');
            nxt_update_post($postdata);
        }
    }
    return true;
}
Example #2
0
/**
 * Do trackbacks for a list of URLs.
 *
 * @since 1.0.0
 *
 * @param string $tb_list Comma separated list of URLs
 * @param int $post_id Post ID
 */
function trackback_url_list($tb_list, $post_id)
{
    if (!empty($tb_list)) {
        // get post data
        $postdata = nxt_get_single_post($post_id, ARRAY_A);
        // import postdata as variables
        extract($postdata, EXTR_SKIP);
        // form an excerpt
        $excerpt = strip_tags($post_excerpt ? $post_excerpt : $post_content);
        if (strlen($excerpt) > 255) {
            $excerpt = substr($excerpt, 0, 252) . '...';
        }
        $trackback_urls = explode(',', $tb_list);
        foreach ((array) $trackback_urls as $tb_url) {
            $tb_url = trim($tb_url);
            trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);
        }
    }
}
 /**
  * Retrieve array of URLs that pingbacked the given URL.
  *
  * Specs on http://www.aquarionics.com/misc/archives/blogite/0198.html
  *
  * @since 1.5.0
  *
  * @param array $args Method parameters.
  * @return array
  */
 function pingback_extensions_getPingbacks($args)
 {
     global $nxtdb;
     do_action('xmlrpc_call', 'pingback.extensions.getPingbacks');
     $this->escape($args);
     $url = $args;
     $post_ID = url_to_postid($url);
     if (!$post_ID) {
         // We aren't sure that the resource is available and/or pingback enabled
         return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn’t exist, or it is not a pingback-enabled resource.'));
     }
     $actual_post = nxt_get_single_post($post_ID, ARRAY_A);
     if (!$actual_post) {
         // No such post = resource not found
         return new IXR_Error(32, __('The specified target URL does not exist.'));
     }
     $comments = $nxtdb->get_results($nxtdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM {$nxtdb->comments} WHERE comment_post_ID = %d", $post_ID));
     if (!$comments) {
         return array();
     }
     $pingbacks = array();
     foreach ($comments as $comment) {
         if ('pingback' == $comment->comment_type) {
             $pingbacks[] = $comment->comment_author_url;
         }
     }
     return $pingbacks;
 }