b2evolution PHP Cross Reference Blogging Systems

Source: /skins/_item_comment_wp.inc.php - 100 lines - 2531 bytes - Text - Print

Description: This is the template that displays a single comment, WP style. This file is not meant to be called directly.

   1  <?php
   2  /**
   3   * This is the template that displays a single comment, WP style.
   4   *
   5   * This file is not meant to be called directly.
   6   *
   7   * b2evolution - {@link http://b2evolution.net/}
   8   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   9   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  10   *
  11   * @package evoskins
  12   */
  13  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14  
  15  
  16  // Default params:
  17  $params = array_merge( array(
  18      'comment_start'  => '<li>',
  19      'comment_end'    => '</li>',
  20      'preview_start'  => '<ul><li id="comment_preview">',
  21      'preview_end'    => '</li></ul>',
  22      'Comment'        => NULL, // This object MUST be passed as a param!
  23      ), $params );
  24  
  25  /**
  26   * @var Comment
  27   */
  28  $Comment = & $params['Comment'];
  29  
  30  ?>
  31  <!-- ========== START of a COMMENT/TB/PB ========== -->
  32  <?php
  33      $Comment->anchor();
  34    echo $params['comment_start'];
  35  ?>
  36  
  37  <?php $Comment->rating(); ?>
  38  
  39  <?php $Comment->content() ?>
  40  
  41  <p><cite>
  42      <?php
  43          switch( $Comment->get( 'type' ) )
  44          {
  45              case 'comment': // Display a comment:
  46                  if( empty($Comment->ID) )
  47                  {    // PREVIEW comment
  48                      echo T_('PREVIEW Comment by').' ';
  49                  }
  50                  else
  51                  {    // Normal comment
  52                      $Comment->permanent_link( array(
  53                              'before'    => '',
  54                              'after'     => ' '.T_('by').' ',
  55                              'text'             => T_('Comment'),
  56                              'nofollow'    => true,
  57                          ) );
  58                  }
  59                  $Comment->author();
  60                  $Comment->msgform_link( $Blog->get('msgformurl') );
  61                  $Comment->author_url( '', ' &middot; ', '' );
  62                  break;
  63  
  64              case 'trackback': // Display a trackback:
  65                  $Comment->permanent_link( array(
  66                          'before'    => '',
  67                          'after'     => ' '.T_('by').' ',
  68                          'text'             => T_('Trackback'),
  69                          'nofollow'    => true,
  70                      ) );
  71                  $Comment->author( '', '#', '', '#', 'htmlbody', true );
  72                  break;
  73  
  74              case 'pingback': // Display a pingback:
  75                  $Comment->permanent_link( array(
  76                          'before'    => '',
  77                          'after'     => ' '.T_('by').' ',
  78                          'text'             => T_('Pingback'),
  79                          'nofollow'    => true,
  80                      ) );
  81                  $Comment->author( '', '#', '', '#', 'htmlbody', true );
  82                  break;
  83          }
  84      ?>
  85      &#8212;
  86      <?php $Comment->date() ?> @ <?php $Comment->time( 'H:i' ) ?>
  87  </cite>
  88  
  89  <?php
  90      $Comment->edit_link( '', '', '#', '#', 'permalink_right' ); /* Link to backoffice for editing */
  91      $Comment->delete_link( '', '', '#', '#', 'permalink_right' ); /* Link to backoffice for deleting */
  92  ?>
  93  </p>
  94  
  95  <br/>
  96  
  97  <?php
  98    echo $params['comment_end'];
  99  ?>
 100  <!-- ========== END of a COMMENT/TB/PB ========== -->

title

Description

title

Description

title

Description

title

title

Body