[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/skins/_rss2/ -> latestcom.tpl.php (source)

   1  <?php
   2  /**

   3   * This template generates an RSS 2.0 feed for the requested blog's latest comments

   4   *

   5   * For a quick explanation of b2evo 2.0 skins, please start here:

   6   * {@link http://manual.b2evolution.net/Skins_2.0}

   7   *

   8   * See {@link http://backend.userland.com/rss}

   9   *

  10   * @package evoskins

  11   * @subpackage rss

  12   *

  13   * @version $Id: latestcom.tpl.php,v 1.6 2007/11/03 04:56:07 fplanque Exp $

  14   */
  15  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  16  
  17  if( isset($Item) )
  18  {    // Comments for a specific Item:
  19    $CommentList = & new CommentList( $Blog, "'comment'", array('published'), $Item->ID,
  20                                                                        '', 'DESC', '', $Blog->get_setting('posts_per_feed') );
  21  }
  22  else
  23  {    // Comments for the blog:
  24    $CommentList = & new CommentList( $Blog, "'comment'", array('published'), '',
  25                                                                        '',    'DESC',    '',    $Blog->get_setting('posts_per_feed') );
  26  }
  27  
  28  skin_content_header( 'application/xml' );    // Sets charset!

  29  
  30  echo '<?xml version="1.0" encoding="'.$io_charset.'"?'.'>';
  31  
  32  ?>
  33  <!-- generator="<?php echo $app_name ?>/<?php echo $app_version ?>" -->
  34  <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  35      <channel>
  36          <title><?php
  37              $Blog->disp( 'name', 'xml' );
  38              // ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------

  39              request_title( array(
  40                      'title_before'=> ' - ',
  41                      'title_after' => '',
  42                      'title_none'  => '',
  43                      'glue'        => ' - ',
  44                      'title_single_disp' => true,
  45                      'format'      => 'xml',
  46                  ) );
  47              // ------------------------------ END OF REQUEST TITLE -----------------------------

  48          ?></title>
  49          <link><?php $Blog->disp( 'lastcommentsurl', 'xml' ) ?></link>
  50          <description></description>
  51          <language><?php $Blog->disp( 'locale', 'xml' ) ?></language>
  52          <docs>http://backend.userland.com/rss</docs>
  53          <admin:generatorAgent rdf:resource="http://b2evolution.net/?v=<?php echo $app_version ?>"/>
  54          <ttl>60</ttl>
  55          <?php while( $Comment = & $CommentList->get_next() )
  56          { // Loop through comments:
  57              // Load comment's Item:

  58              $Comment->get_Item();
  59              ?>
  60          <item>
  61              <title><?php echo format_to_output( T_('In response to:'), 'xml' ) ?> <?php $Comment->Item->title( array(
  62                  'format' => 'xml',
  63                  'link_type' => 'none',
  64              ) ); ?></title>
  65              <pubDate><?php $Comment->time( 'r', true ); ?></pubDate>
  66              <dc:creator><?php $Comment->author( '', '#', '', '#', 'xml' ); ?></dc:creator>
  67              <guid isPermaLink="false">c<?php $Comment->ID() ?>@<?php echo $baseurl ?></guid>
  68              <description><?php echo make_rel_links_abs( $Comment->get_content('entityencoded') ); ?></description>
  69              <content:encoded><![CDATA[<?php echo make_rel_links_abs( $Comment->get_content() ); ?>]]></content:encoded>
  70              <link><?php $Comment->permanent_url() ?></link>
  71          </item>
  72          <?php
  73          } /* End of comment loop. */
  74      ?>
  75      </channel>
  76  </rss>
  77  <?php
  78      $Hit->log(); // log the hit on this page

  79  
  80      // This is a self contained XML document, make sure there is no additional output:

  81      exit();
  82  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics