PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/blog/wp-content/plugins/podpress/wp-atom1.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 60 lines | 56 code | 3 blank | 1 comment | 11 complexity | b217f01e378241cd7f709cf2742d5858 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. // This is a podPress replacement file.
  3. if (empty($wp)) {
  4. require_once('wp-config.php');
  5. wp('feed=atom');
  6. }
  7. $blog_charset = get_bloginfo('charset');
  8. header('Content-type: application/atom+xml; charset=' . $blog_charset, true);
  9. $more = 1;
  10. echo '<?xml version="1.0" encoding="' . $blog_charset . '"?' . '>'; ?>
  11. <feed
  12. xmlns="http://www.w3.org/2005/Atom"
  13. xmlns:dc="http://purl.org/dc/elements/1.1/"
  14. xmlns:thr="http://purl.org/syndication/thread/1.0"
  15. xml:lang="<?php echo get_option('rss_language'); ?>"
  16. <?php do_action('atom_ns'); ?>
  17. >
  18. <id><?php bloginfo_rss('atom_url') ?></id>
  19. <title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
  20. <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('atom_url') ?>" />
  21. <link rel="alternate" type="application/rss+xml" href="<?php bloginfo_rss('rss2_url') ?>" />
  22. <link rel="alternate" type="text/html" hreflang="<?php echo get_option('rss_language'); ?>" href="<?php bloginfo_rss('home') ?>" />
  23. <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
  24. <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></updated>
  25. <generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
  26. <author>
  27. <name><?php bloginfo_rss('name'); ?></name>
  28. <uri><?php bloginfo_rss('siteurl'); ?></uri>
  29. </author>
  30. <?php ######### The rights tag and other license information for this feed will be inserted via 'atom_head' action. ######### ?>
  31. <?php do_action('atom_head'); ?>
  32. <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
  33. <entry>
  34. <id><?php the_guid(); ?></id>
  35. <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
  36. <link rel="alternate" type="text/html" hreflang="<?php echo get_option('rss_language'); ?>" href="<?php permalink_single_rss() ?>" />
  37. <link rel="related" type="application/rss+xml" href="<?php echo comments_rss(); ?>" />
  38. <author>
  39. <name><?php the_author() ?></name>
  40. <uri><?php $x = get_the_author_url(); if($x != 'http://' && $x != '') { echo $x; } else { echo bloginfo_rss('siteurl'); } ?></uri>
  41. </author>
  42. <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_modified_gmt, false); ?></updated>
  43. <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
  44. <?php the_category_rss('atom') ?>
  45. <summary type="<?php html_type_rss(); ?>">
  46. <![CDATA[<?php the_excerpt_rss(); ?><br /><br />(<a href="<?php comments_link(); ?>"><?php echo __('Comments');?></a>)]]>
  47. </summary>
  48. <?php if ( !get_settings('rss_use_excerpt') ) : ?>
  49. <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>">
  50. <![CDATA[<?php the_content('', 0, '') ?><br /><br />(<a href="<?php comments_link(); ?>"><?php echo __('Comments');?></a>)]]>
  51. </content>
  52. <?php endif; ?>
  53. <?php ######### The rights tag and other license information for podcast episode will be inserted via 'atom_head' action. ######### ?>
  54. <?php do_action('atom_entry'); ?>
  55. </entry>
  56. <?php $items_count++; if (($items_count == get_option('posts_per_rss')) && empty($m)) { break; } } } ?>
  57. </feed>