b2evolution PHP Cross Reference Blogging Systems

Source: /skins/_comments.disp.php - 102 lines - 2957 bytes - Text - Print

Description: This is the template that displays the links to the latest comments for a blog

   1  <?php
   2  /**
   3   * This is the template that displays the links to the latest comments for a blog
   4   *
   5   * This file is not meant to be called directly.
   6   * It is meant to be called by an include in the main.page.php template.
   7   * To display a feedback, you should call a stub AND pass the right parameters
   8   * For example: /blogs/index.php?disp=comments
   9   *
  10   * b2evolution - {@link http://b2evolution.net/}
  11   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  12   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  13   *
  14   * @package evoskins
  15   */
  16  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  17  
  18  
  19  // Default params:
  20  $params = array_merge( array(
  21          'author_link_text' => 'login', // avatar | only_avatar | login | nickname | firstname | lastname | fullname | preferredname
  22          'display_comment_avatar' => true,
  23      ), $params );
  24  
  25  
  26  $CommentList = new CommentList2( $Blog );
  27  
  28  // Filter list:
  29  $CommentList->set_filters( array(
  30          'types' => array( 'comment', 'trackback', 'pingback' ),
  31          'statuses' => get_inskin_statuses(),
  32          'order' => 'DESC',
  33          'comments' => 50,
  34          // fp> I don't think it's necessary to add a restriction here. (use case?)
  35          // 'timestamp_min' => $Blog->get_timestamp_min(),
  36          // 'timestamp_max' => $Blog->get_timestamp_max(),
  37      ) );
  38  
  39  // Get ready for display (runs the query):
  40  $CommentList->display_init();
  41  
  42  $CommentList->display_if_empty();
  43  
  44  echo '<div id="styled_content_block">';
  45  while( $Comment = & $CommentList->get_next() )
  46  { // Loop through comments:
  47      // Load comment's Item object:
  48      $Comment->get_Item();
  49      ?>
  50      <!-- ========== START of a COMMENT ========== -->
  51      <?php $Comment->anchor() ?>
  52      <div class="bComment">
  53          <?php
  54          if( $Comment->status != 'published' )
  55          {
  56              $Comment->status( 'styled' );
  57          }
  58          if( $params['display_comment_avatar'] )
  59          {
  60              $Comment->avatar();
  61          }
  62          ?>
  63          <h3 class="bTitle">
  64              <?php echo T_('In response to:') ?>
  65              <?php $Comment->Item->title( array(
  66                      'link_type' => 'permalink',
  67                  ) ); ?>
  68          </h3>
  69          <div class="bCommentTitle">
  70              <?php $Comment->author(
  71                  /* before: */ '',
  72                  /* after: */ '#',
  73                  /* before_user: */ '',
  74                  /* after_user: */ '#',
  75                  /* format: */ 'htmlbody',
  76                  /* makelink: */ true,
  77                  /* linkt_text*/ $params['author_link_text'] ) ?>
  78              <?php /* $Comment->author_url( '', ' &middot; ', '' ) */ ?>
  79          </div>
  80          <div class="bCommentText">
  81              <?php
  82              $Comment->content();
  83              ?>
  84          </div>
  85          <div class="bCommentSmallPrint">
  86              <?php
  87                  $Comment->permanent_link( array(
  88                          'class'    => 'permalink_right',
  89                          'nofollow' => true,
  90                      ) );
  91              ?>
  92              <?php $Comment->date() ?> @ <?php $Comment->time( 'H:i' ) ?>
  93              <?php $Comment->edit_link( ' &middot; ' ) /* Link to backoffice for editing */ ?>
  94              <?php $Comment->delete_link( ' &middot; ' ); /* Link to backoffice for deleting */ ?>
  95          </div>
  96      </div>
  97      <!-- ========== END of a COMMENT ========== -->
  98      <?php
  99  }    // End of comment loop.
 100  echo '</div>';
 101  
 102  ?>

title

Description

title

Description

title

Description

title

title

Body