b2evolution PHP Cross Reference Blogging Systems

Source: /skins/forums/_item_comment.inc.php - 197 lines - 7191 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  global $comment_template_counter;
  16  
  17  if( ! isset( $comment_template_counter ) )
  18  {
  19      $comment_template_counter = 0;
  20  }
  21  
  22  /**

  23   * @var array Save all statuses that used on this page in order to show them in the footer legend

  24   */
  25  global $legend_statuses;
  26  
  27  if( !is_array( $legend_statuses ) )
  28  {    // Init this array only first time
  29      $legend_statuses = array();
  30  }
  31  
  32  // Default params:

  33  $params = array_merge( array(
  34          'comment_block_start'  => '',
  35          'comment_start'        => '<div class="bComment">',
  36          'comment_end'          => '</div>',
  37          'comment_block_end'    => '',
  38          'link_to'              => 'userurl>userpage', // 'userpage' or 'userurl' or 'userurl>userpage' or 'userpage>userurl'
  39          'before_image'         => '<div class="image_block">',
  40          'before_image_legend'  => '<div class="image_legend">',
  41          'after_image_legend'   => '</div>',
  42          'after_image'          => '</div>',
  43          'image_size'           => 'fit-400x320',
  44          'Comment'              => NULL, // This object MUST be passed as a param!
  45          'display_vote_helpful' => true,
  46      ), $params );
  47  
  48  /**

  49   * @var Comment

  50   */
  51  $Comment = & $params['Comment'];
  52  
  53  $comment_class = 'vs_'.$Comment->status;
  54  if( $comment_template_counter % 2 == 0 )
  55  { // Mark odd rows
  56      $comment_class .= ' odd';
  57  }
  58  $comment_class = ' class="'.$comment_class.'"';
  59  
  60  ?>
  61  <!-- ========== START of a COMMENT/TB/PB ========== -->
  62  <?php echo $params['comment_block_start'];
  63      if( $disp == 'comments' )
  64      { // We are displaying a comment in the Latest comments page, we want to show what post/topic it relates to:
  65      ?>
  66      <tr class="separator">
  67          <td colspan="2" class="InResponseTo"><h3>
  68                  <?php echo T_('In response to:');
  69                      $Comment->permanent_link( array(
  70                              'text' => $Comment->Item->dget( 'title' ),
  71                          ) );
  72                  ?>
  73              </h3></td>
  74      </tr>
  75      <?php
  76      }
  77      ?>
  78      <tr valign="top"<?php echo $comment_class; ?> id="comment_row_<?php echo $Comment->ID; ?>">
  79      <td class="col1"><?php
  80          $Comment->author2( array(
  81                  'before'       => ' ',
  82                  'after'        => '',
  83                  'before_user'  => '',
  84                  'after_user'   => '',
  85                  'format'       => 'htmlbody',
  86                  'link_to'      => $params['link_to'],        // 'userpage' or 'userurl' or 'userurl>userpage' or 'userpage>userurl'
  87                  'link_text'    => 'avatar',
  88                  'thumb_size'   => 'crop-top-80x80',
  89                  'thumb_class'  => 'avatar_above_login',
  90                  'nowrap'       => false,
  91              ) );
  92      ?></td>
  93      <td class="left" valign="top">
  94          <?php
  95          $Comment->anchor();
  96          $post_header_class = 'bPostDate';
  97          if( $Skin->enabled_status_banner( $Comment->status ) && $Comment->ID > 0 )
  98          { // Don't display status for previewed comments
  99              $Comment->statuses();
 100              $post_header_class .= ' '.$Comment->status;
 101              $legend_statuses[] = $Comment->status;
 102          }
 103          ?>
 104          <div class="<?php echo $post_header_class; ?>">
 105              <a href="<?php echo $Comment->get_permanent_url() ?>"><span class="ficon minipost" title="<?php echo T_('Post'); ?>"></span></a>
 106              <?php
 107                  if( $Skin->get_setting( 'display_post_date') )
 108                  {    // We want to display the post date:
 109                      echo T_('Posted: ');
 110                      $Comment->date( 'D M j, Y H:i' );
 111                  }
 112                  $Comment->rating( array(
 113                          'before' => '<div class="floatright">',
 114                          'after'  => '</div>',
 115                      ) );
 116              ?>
 117          </div>
 118          <?php echo $params['comment_start']; ?>
 119  
 120          <?php $Comment->content( 'htmlbody', false, true, $params ); ?>
 121  
 122          <?php echo $params['comment_end']; ?>
 123      </td>
 124  </tr>
 125  <tr<?php echo $comment_class; ?> id="comment_row_<?php echo $Comment->ID; ?>">
 126      <td class="left col1"><a href="<?php
 127          if( $disp == 'comments' )
 128          {    // We are displaying a comment in the Latest comments page:
 129              echo $Blog->get('lastcommentsurl');
 130          }
 131          else
 132          {    // We are displaying a comment under a post/topic:
 133              echo $Item->get_permanent_url();
 134          }
 135          ?>#skin_wrapper" class="postlink"><?php echo T_('Back to top'); ?></a></td>
 136      <td class="left">
 137      <?php
 138          if( $Comment->ID > 0 )
 139          {    // Display action buttons only for existing comments(Disable for previewed comment)
 140              $commented_Item = & $Comment->get_Item();
 141  
 142              echo '<div class="floatleft">';
 143              if( $commented_Item && $commented_Item->can_comment( NULL ) )
 144              {    // Display button to quote this comment
 145                  echo '<a href="'.$commented_Item->get_permanent_url().'?mode=quote&amp;qc='.$Comment->ID.'#form_p'.$commented_Item->ID.'" title="'.T_('Reply with quote').'" class="roundbutton_text floatleft quote_button">'.get_icon( 'comments', 'imgtag', array( 'title' => T_('Reply with quote') ) ).T_('Quote').'</a>';
 146              }
 147  
 148              if( $params['display_vote_helpful'] )
 149              {    // Display a voting tool
 150                  $Comment->vote_helpful( '', '', '&amp;', true, true, array(
 151                          'helpful_text'    => T_('Is this reply helpful?'),
 152                          'title_yes'       => T_('Mark this reply as helpful!'),
 153                          'title_yes_voted' => T_('You think this reply is helpful'),
 154                          'title_no'        => T_('Mark this reply as not helpful!'),
 155                          'title_no_voted'  => T_('You think this reply is not helpful'),
 156                          'class'           => 'vote_helpful'
 157                      ) );
 158              }
 159  
 160              // Display Spam Voting system

 161              $Comment->vote_spam( '', '', '&amp;', true, true, array(
 162                      'title_spam'          => T_('Mark this reply as spam!'),
 163                      'title_spam_voted'    => T_('You think this reply is spam'),
 164                      'title_notsure'       => T_('Mark this reply as not sure!'),
 165                      'title_notsure_voted' => T_('You are not sure in this reply'),
 166                      'title_ok'            => T_('Mark this reply as OK!'),
 167                      'title_ok_voted'      => T_('You think this reply is OK'),
 168                  ) );
 169              echo '</div>';
 170  
 171              echo '<div class="floatright">';
 172              $comment_redirect_url = rawurlencode( $Comment->get_permanent_url() );
 173              $Comment->edit_link( ' ', '', '#', T_('Edit this reply'), 'roundbutton_text', '&amp;', true, $comment_redirect_url ); /* Link for editing */
 174              echo ' <span class="roundbutton_group">';
 175              $delete_button_is_displayed = is_logged_in() && $current_User->check_perm( 'comment!CURSTATUS', 'delete', false, $Comment );
 176              $Comment->moderation_links( array(
 177                      'ajax_button' => true,
 178                      'class'       => 'roundbutton_text',
 179                      'redirect_to' => $comment_redirect_url,
 180                      'detect_last' => !$delete_button_is_displayed,
 181                  ) );
 182              $Comment->delete_link( '', '', '#', T_('Delete this reply'), 'roundbutton_text', false, '&amp;', true, false, '#', rawurlencode( $commented_Item->get_permanent_url() ) ); /* Link to backoffice for deleting */
 183              echo '</span>';
 184              echo '</div>';
 185          }
 186      ?>
 187      </td>
 188  </tr>
 189  <tr class="separator">
 190      <td colspan="2"><?php echo get_icon( 'pixel' ); ?></td>
 191  </tr>
 192  <?php echo $params['comment_block_end']; ?>
 193  <!-- ========== END of a COMMENT/TB/PB ========== -->
 194  <?php
 195  
 196  $comment_template_counter++;
 197  ?>

title

Description

title

Description

title

Description

title

title

Body