b2evolution PHP Cross Reference Blogging Systems

Source: /skins/_item_comment.inc.php - 122 lines - 3910 bytes - Text - Print

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

   1  <?php
   2  /**
   3   * This is the template that displays a single comment
   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'        => '<div class="bComment">',
  19          'comment_end'          => '</div>',
  20          'link_to'              => 'userurl>userpage', // 'userpage' or 'userurl' or 'userurl>userpage' or 'userpage>userurl'
  21          'author_link_text'     => 'login', // avatar | only_avatar | login | nickname | firstname | lastname | fullname | preferredname
  22          'before_image'         => '<div class="image_block">',
  23          'before_image_legend'  => '<div class="image_legend">',
  24          'after_image_legend'   => '</div>',
  25          'after_image'          => '</div>',
  26          'image_size'           => 'fit-400x320',
  27          'Comment'              => NULL, // This object MUST be passed as a param!
  28      ), $params );
  29  
  30  /**
  31   * @var Comment
  32   */
  33  $Comment = & $params['Comment'];
  34  
  35  ?>
  36  <!-- ========== START of a COMMENT/TB/PB ========== -->
  37  <?php
  38      $Comment->anchor();
  39      echo $params['comment_start'];
  40      if( $Comment->status != 'published' )
  41      {
  42          $Comment->status( 'styled' );
  43      }
  44  ?>
  45      <div class="bCommentTitle">
  46      <?php
  47          switch( $Comment->get( 'type' ) )
  48          {
  49              case 'comment': // Display a comment:
  50                  if( empty($Comment->ID) )
  51                  {    // PREVIEW comment
  52                      echo T_('PREVIEW Comment from:').' ';
  53                  }
  54                  else
  55                  {    // Normal comment
  56                      $Comment->permanent_link( array(
  57                              'before'    => '',
  58                              'after'     => ' '.T_('from:').' ',
  59                              'text'      => T_('Comment'),
  60                              'nofollow'  => true,
  61                          ) );
  62                  }
  63                  $Comment->author2( array(
  64                          'before'       => ' ',
  65                          'after'        => '#',
  66                          'before_user'  => '',
  67                          'after_user'   => '#',
  68                          'format'       => 'htmlbody',
  69                          'link_to'      => $params['link_to'],        // 'userpage' or 'userurl' or 'userurl>userpage' or 'userpage>userurl'
  70                          'link_text'    => $params['author_link_text'],
  71                      ) );
  72  
  73                  $Comment->msgform_link( $Blog->get('msgformurl') );
  74                  // $Comment->author_url( '', ' &middot; ', '' );
  75                  break;
  76  
  77              case 'trackback': // Display a trackback:
  78                  $Comment->permanent_link( array(
  79                          'before'    => '',
  80                          'after'     => ' '.T_('from:').' ',
  81                          'text'             => T_('Trackback'),
  82                          'nofollow'    => true,
  83                      ) );
  84                  $Comment->author( '', '#', '', '#', 'htmlbody', true, $params['author_link_text'] );
  85                  break;
  86  
  87              case 'pingback': // Display a pingback:
  88                  $Comment->permanent_link( array(
  89                          'before'    => '',
  90                          'after'     => ' '.T_('from:').' ',
  91                          'text'             => T_('Pingback'),
  92                          'nofollow'    => true,
  93                      ) );
  94                  $Comment->author( '', '#', '', '#', 'htmlbody', true, $params['author_link_text'] );
  95                  break;
  96          }
  97      ?>
  98      </div>
  99      <?php
 100      $Comment->rating();
 101      ?>
 102      <div class="bCommentText">
 103          <?php
 104              $Comment->avatar();
 105              $Comment->content( 'htmlbody', false, true, $params );
 106          ?>
 107      </div>
 108      <div class="bCommentSmallPrint">
 109          <?php
 110              $commented_Item = & $Comment->get_Item();
 111              $Comment->edit_link( '', '', '#', '#', 'permalink_right', '&amp;', true, rawurlencode( $Comment->get_permanent_url() ) ); /* Link to backoffice for editing */
 112              $Comment->delete_link( '', '', '#', '#', 'permalink_right', false, '&amp;', true, false, '#', rawurlencode( $commented_Item->get_permanent_url() ) ); /* Link to backoffice for deleting */
 113          ?>
 114  
 115          <?php $Comment->date() ?> @ <?php $Comment->time( 'H:i' ) ?>
 116          <?php $Comment->reply_link(); /* Link for replying to the Comment */ ?>
 117          <?php $Comment->vote_helpful( '', '', '&amp;', true, true );?>
 118      </div>
 119  <?php
 120      echo $params['comment_end'];
 121  ?>
 122  <!-- ========== END of a COMMENT/TB/PB ========== -->

title

Description

title

Description

title

Description

title

title

Body