nxs_dsq_export_wp

The NextScripts: Social Networks Auto-Poster nxs dsq export wp function.

Description

nxs_dsq_export_wp( $nxPost, (constant) $comments = null ); 

Parameters (2)

0. $nxpost
The nxpost.
1. $comments — Optional. (constant) => null
The comments.

Usage

  1. if ( !function_exists( 'nxs_dsq_export_wp' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/nxs_functions.php'; 
  3.  
  4. // The nxpost. 
  5. $nxpost = null; 
  6.  
  7. // The comments. 
  8. $comments = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = nxs_dsq_export_wp($nxpost, $comments); 
  12.  

Defined (1)

The function is defined in the following location(s).

/nxs_functions.php  
  1. function nxs_dsq_export_wp($nxPost, $comments=null) { global $wpdb, $wp_query, $post; $post = $nxPost; ob_start(); echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";?> 
  2. <?php the_generator('export');?><rss version="2.0" xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/" xmlns:content="http://purl.org/rss/1.0/modules/content/" 
  3. xmlns:dsq="http://www.disqus.com/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"> 
  4. <channel> 
  5. <title><?php bloginfo_rss('name'); ?></title><link><?php bloginfo_rss('url') ?></link><pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate> 
  6. <generator>WordPress <?php bloginfo_rss('version'); ?>; Disqus <?php echo DISQUS_VERSION; ?></generator> 
  7. <?php $wp_query->in_the_loop = true; setup_postdata($post); ?> 
  8. <item><title><?php echo apply_filters('the_title_rss', $post->post_title); ?></title><link><?php the_permalink_rss() ?></link> 
  9. <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> 
  10. <dc:creator><?php echo dsq_export_wxr_cdata(get_the_author()); ?></dc:creator> 
  11. <guid isPermaLink="false"><?php the_guid(); ?></guid> 
  12. <content:encoded><?php echo dsq_export_wxr_cdata( apply_filters('the_content_export', $post->post_content) ); ?></content:encoded> 
  13. <dsq:thread_identifier><?php echo dsq_identifier_for_post($post); ?></dsq:thread_identifier> 
  14. <wp:post_id><?php echo $post->ID; ?></wp:post_id> 
  15. <wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt> 
  16. <wp:comment_status><?php echo $post->comment_status; ?></wp:comment_status> 
  17. <?php 
  18. if ( $comments ) { foreach ( $comments as $c ) { ?> 
  19. <wp:comment> 
  20. <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id> 
  21. <wp:comment_author><?php echo dsq_export_wxr_cdata($c->comment_author); ?></wp:comment_author> 
  22. <wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email> 
  23. <wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url> 
  24. <wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP> 
  25. <wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date> 
  26. <wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt> 
  27. <wp:comment_content><?php echo dsq_export_wxr_cdata($c->comment_content) ?></wp:comment_content> 
  28. <wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved> 
  29. <wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type> 
  30. <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent> 
  31. </wp:comment> 
  32. <?php } } // comments ?> 
  33. </item> 
  34. </channel> 
  35. </rss> 
  36. <?php $output = ob_get_clean(); return $output;