term_id] = $category->parent; $parents = array_unique(array_diff($parents, array_keys($parents))); if ( $zero = array_search('0', $parents) ) unset($parents[$zero]); return $parents; } /** * Place string in CDATA tag. * * @since unknown * * @param string $str String to place in XML CDATA tag. */ function dsq_export_wxr_cdata($str) { if ( seems_utf8($str) == false ) $str = utf8_encode($str); // $str = ent2ncr(esc_html($str)); $str = '', ']]]]>', $str ) . ']]>'; return $str; } /** * {@internal Missing Short Description}} * * @since unknown * * @return string Site URL. */ function dsq_export_wxr_site_url() { global $current_site; // mu: the base url if ( isset($current_site->domain) ) { return 'http://'.$current_site->domain.$current_site->path; } // wp: the blog url else { return get_bloginfo_rss('url'); } } /** * {@internal Missing Short Description}} * * @since unknown * * @param object $c Category Object */ function dsq_export_wxr_cat_name($c) { if ( empty($c->name) ) return; echo '' . dsq_export_wxr_cdata($c->name) . ''; } /** * {@internal Missing Short Description}} * * @since unknown * * @param object $c Category Object */ function dsq_export_wxr_category_description($c) { if ( empty($c->description) ) return; echo '' . dsq_export_wxr_cdata($c->description) . ''; } /** * {@internal Missing Short Description}} * * @since unknown * * @param object $t Tag Object */ function dsq_export_wxr_tag_name($t) { if ( empty($t->name) ) return; echo '' . dsq_export_wxr_cdata($t->name) . ''; } /** * {@internal Missing Short Description}} * * @since unknown * * @param object $t Tag Object */ function dsq_export_wxr_tag_description($t) { if ( empty($t->description) ) return; echo '' . dsq_export_wxr_cdata($t->description) . ''; } // receives an array of posts to export function dsq_export_wp($post, $comments=null) { global $wpdb; if (!$comments) { $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%'", $post->ID) ); } // start catching output ob_start(); echo '\n"; ?> <?php bloginfo_rss('name'); ?> WordPress ; Disqus in_the_loop = true; // Fake being in the loop. setup_postdata($post); ?> <?php echo apply_filters('the_title_rss', $post->post_title); ?> post_content) ); ?> ID; ?> post_date_gmt; ?> comment_status; ?> comment_ID; ?> comment_author); ?> comment_author_email; ?> comment_author_url; ?> comment_author_IP; ?> comment_date; ?> comment_date_gmt; ?> comment_content) ?> comment_approved; ?> comment_type; ?> comment_parent; ?>