[ 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/_atom/ -> latestcom.tpl.php (source)

   1  <?php
   2  /**

   3   * This template generates an Atom 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://atompub.org/2005/07/11/draft-ietf-atompub-format-10.html}

   9   *

  10   * @package evoskins

  11   * @subpackage atom

  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  if( $debug)
  29  {
  30      skin_content_header( 'application/xml' );    // Sets charset!

  31  }
  32  else
  33  {
  34      skin_content_header( 'application/atom+xml' );    // Sets charset!

  35  }
  36  
  37  echo '<?xml version="1.0" encoding="'.$io_charset.'"?'.'>';
  38  ?>
  39  <feed xml:lang="<?php $Blog->disp( 'locale', 'xml' ) ?>" xmlns="http://www.w3.org/2005/Atom">
  40      <title><?php
  41          $Blog->disp( 'name', 'xml' );
  42          // ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------

  43          request_title( array(
  44                  'title_before'=> ' - ',
  45                  'title_after' => '',
  46                  'title_none'  => '',
  47                  'glue'        => ' - ',
  48                  'title_single_disp' => true,
  49                  'format'      => 'xml',
  50              ) );
  51          // ------------------------------ END OF REQUEST TITLE -----------------------------

  52      ?></title>
  53      <link rel="alternate" type="text/html" href="<?php $Blog->disp( 'lastcommentsurl', 'xml' ) ?>" />
  54      <link rel="self" type="application/atom+xml" href="<?php $Blog->disp( 'comments_atom_url', 'xmlattr' ) ?>" />
  55      <id><?php $Blog->disp( 'comments_atom_url', 'xmlattr' ) /* TODO: may need a regenerate_url() */ ?></id>
  56      <generator uri="http://b2evolution.net/" version="<?php echo $app_version ?>"><?php echo $app_name ?></generator>
  57      <updated><?php echo gmdate('Y-m-d\TH:i:s\Z'); ?></updated>
  58      <?php while( $Comment = & $CommentList->get_next() )
  59      { /* Loop through comments: */ ?>
  60      <entry>
  61          <title type="text"><?php
  62              echo format_to_output( T_('In response to:'), 'xml' ).' ';
  63              $Comment->get_Item();
  64              $Comment->Item->title( array(
  65                  'format' => 'xml',
  66                  'link_type' => 'none',
  67              ) ); ?></title>
  68          <link rel="alternate" type="text/html" href="<?php $Comment->permanent_url() ?>" />
  69          <author>
  70              <name><?php $Comment->author( '', '#', '', '#', 'xml' ) ?></name>
  71              <?php $Comment->author_url( '', '<uri>', "</uri>\n", false ) ?>
  72          </author>
  73          <id><?php $Comment->permanent_url() ?></id>
  74          <published><?php $Comment->date( 'isoZ', true ); ?></published>
  75          <updated><?php $Comment->date( 'isoZ', true ); ?></updated>
  76          <content type="html"><![CDATA[<?php echo make_rel_links_abs( $Comment->get_content() ); ?>]]></content>
  77      </entry>
  78      <?php
  79      } // End of comment loop.

  80      ?>
  81  </feed>
  82  <?php
  83      $Hit->log(); // log the hit on this page

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

  86      exit();
  87  ?>


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