b2evolution PHP Cross Reference Blogging Systems

Source: /skins/forums/_item_block.inc.php - 261 lines - 10699 bytes - Text - Print

Description: This is the template that displays the item block This file is not meant to be called directly. It is meant to be called by an include in the main.page.php template (or other templates)

   1  <?php
   2  /**

   3   * This is the template that displays the item block

   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 (or other templates)

   7   *

   8   * b2evolution - {@link http://b2evolution.net/}

   9   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}

  10   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}

  11   *

  12   * @package evoskins

  13   */
  14  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  15  
  16  global $Item, $preview, $dummy_fields;
  17  
  18  /**

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

  20   */
  21  global $legend_statuses;
  22  
  23  if( !is_array( $legend_statuses ) )
  24  {    // Init this array only first time
  25      $legend_statuses = array();
  26  }
  27  
  28  // Default params:

  29  $params = array_merge( array(
  30          'feature_block'   => false,
  31          'content_mode'    => 'auto',        // 'auto' will auto select depending on $disp-detail
  32          'item_class'      => 'bPost',
  33          'image_size'        => 'fit-400x320',
  34      ), $params );
  35  ?>
  36  
  37  <h2><?php
  38      $Item->title( array(
  39              'link_type' => 'permalink'
  40          ) );
  41  ?></h2>
  42  <div class="post_panel">
  43  <?php
  44  // In this skin, it makes no sense to navigate in any different mode than "same category"

  45  // Use the category from param

  46  $current_cat = param( 'cat', 'integer', 0 );
  47  if( $current_cat == 0 )
  48  { // Use main category by default because the category wasn't set
  49      $current_cat = $Item->main_cat_ID;
  50  }
  51  
  52  $Skin->display_post_button( $current_cat, $Item );
  53  // BREADCRUMBS

  54  $Skin->display_breadcrumbs( $current_cat );
  55  ?>
  56      <div class="clear"></div>
  57  </div>
  58  
  59  <a name="top"></a>
  60  <a name="p<?php echo $Item->ID; ?>"></a>
  61  <table id="styled_content_block" class="bForums fixed_layout" width="100%" cellspacing="1" cellpadding="2" border="0">
  62      <?php /* This empty row is used to fix columns width, when table has css property "table-layout:fixed" */ ?>
  63      <tr class="fixrow0"><td class="col1"></td><td></td></tr>
  64      <tr class="top">
  65          <td colspan="2" valign="middle" class="right">
  66      <?php
  67      if( !$Item->is_featured() )
  68      {
  69          // ------------------- PREV/NEXT POST LINKS (SINGLE POST MODE) -------------------

  70          item_prevnext_links( array(
  71                  'block_start'     => '',
  72                  'separator'       => ' :: ',
  73                  'block_end'       => '',
  74                  'target_blog'     => $Blog->ID,    // this forces to stay in the same blog, should the post be cross posted in multiple blogs
  75                  'post_navigation' => 'same_category', // force to stay in the same category in this skin
  76                  'featured'        => false, // don't include the featured posts into navigation list
  77              ) );
  78          // ------------------------- END OF PREV/NEXT POST LINKS -------------------------

  79      }
  80      ?>
  81          </td>
  82      </tr>
  83      <tr>
  84          <th class="col1"><?php echo T_('Author'); ?></th>
  85          <th><?php echo T_('Message'); ?></th>
  86      </tr>
  87      <tr>
  88          <td valign="top" class="col1"><?php
  89              $Item->author( array(
  90                  'link_text' => 'avatar',
  91                  'thumb_size'   => 'crop-top-80x80',
  92                  'thumb_class'  => 'avatar_above_login',
  93                  'nowrap'       => false,
  94              ) );
  95          ?></td>
  96          <td class="left" valign="top">
  97              <?php
  98              $post_header_class = 'bPostDate';
  99              if( $Skin->enabled_status_banner( $Item->status ) )
 100              {
 101                  $Item->status( array( 'format' => 'styled' ) );
 102                  $post_header_class .= ' '.$Item->status;
 103                  $legend_statuses[] = $Item->status;
 104              }
 105              ?>
 106              <div class="<?php echo $post_header_class; ?>">
 107                  <a href="<?php echo $Item->get_permanent_url(); ?>"><span class="ficon minipost" title="<?php echo T_('Topic'); ?>"></span></a>
 108                  <?php
 109                      if( $Skin->get_setting( 'display_post_date') )
 110                      {    // We want to display the post date:
 111                          $Item->issue_time( array(
 112                                  'before'      => /* TRANS: date */ T_('Posted: '),
 113                                  'after'       => ' &nbsp; &nbsp; ',
 114                                  'time_format' => 'D M j, Y H:i',
 115                              ) );
 116                      }
 117                      echo T_('Topic subject').': ';
 118                      // Link to original location and don't use current navigation target param

 119                      $Item->title( array( 'nav_target' => false ) );
 120                  ?>
 121              </div>
 122  <?php
 123      // ---------------------- POST CONTENT INCLUDED HERE ----------------------

 124      skin_include( '_item_content.inc.php', $params );
 125      // Note: You can customize the default item feedback by copying the generic

 126      // /skins/_item_content.inc.php file into the current skin folder.

 127      // -------------------------- END OF POST CONTENT -------------------------

 128  ?>
 129          </td>
 130      </tr>
 131      <tr>
 132          <td class="left col1"><a href="<?php echo $Item->get_permanent_url(); ?>#skin_wrapper" class="postlink"><?php echo T_('Back to top'); ?></a></td>
 133          <td class="left">
 134          <?php
 135              echo '<div class="floatleft">';
 136              if( $Item->can_comment( NULL ) )
 137              {    // Display button to quote this post
 138                  echo '<a href="'.$Item->get_permanent_url().'?mode=quote&amp;qp='.$Item->ID.'#form_p'.$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>';
 139              }
 140              echo '</div>';
 141  
 142              // List all tags attached to this topic:

 143              $Item->tags( array(
 144                      'before' =>    '<span class="topic_tags">'.T_('Tags').': ',
 145                      'after' =>     '</span>',
 146                      'separator' => ', ',
 147                  ) );
 148  
 149              echo '<div class="floatright">';
 150              $Item->edit_link( array(
 151                      'before' => ' ',
 152                      'after'  => '',
 153                      'title'  => T_('Edit this topic'),
 154                      'text'   => '#',
 155                      'class'  => 'roundbutton_text',
 156                  ) );
 157              echo ' <span class="roundbutton_group">';
 158              // Set redirect after publish to the same category view of the items permanent url

 159              $redirect_after_publish = $Item->add_navigation_param( $Item->get_permanent_url(), 'same_category', $current_cat );
 160              $Item->next_status_link( array( 'before' => ' ', 'class' => 'roundbutton_text', 'post_navigation' => 'same_category', 'nav_target' => $current_cat ), true );
 161              $Item->next_status_link( array( 'class' => 'roundbutton_text', 'before_text' => '', 'post_navigation' => 'same_category', 'nav_target' => $current_cat ), false );
 162              $Item->delete_link( '', '', '#', T_('Delete this topic'), 'roundbutton_text', false, '#', TS_('You are about to delete this post!\\nThis cannot be undone!'), get_caturl( $current_cat ) );
 163              echo '</span>';
 164              echo '</div>';
 165          ?>
 166          </td>
 167      </tr>
 168      <tr class="separator">
 169          <td colspan="2"><?php echo get_icon( 'pixel' ); ?></td>
 170      </tr>
 171  <?php
 172  if( !$Item->can_see_comments( true ) || $preview )
 173  {    // If comments are disabled for this post we should close the <table> tag that was opened above for post content
 174      // Otherwise this tag will be closed below by 'comment_list_end'

 175      echo '</table>';
 176  }
 177  ?>
 178  
 179      <?php
 180          $Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)

 181      ?>
 182  
 183      <?php
 184          // ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------

 185          skin_include( '_item_feedback.inc.php', array(
 186                  'preview_block_start'  => '<table id="comment_preview" class="bForums" width="100%" cellspacing="1" cellpadding="2" border="0">
 187      <tr>
 188          <th width="100">'.T_('Author').'</th>
 189          <th>'.T_('PREVIEW Message').'</th>
 190      </tr>',
 191                  'preview_start'        => '<div class="bText">',
 192                  'preview_end'          => '</div>',
 193                  'preview_block_end'    => '</table><br />',
 194                  'notification_text'    => T_( 'This is your topic. You are receiving notifications when anyone posts a reply on your topics.' ),
 195                  'notification_text2'   => T_( 'You will be notified by email when someone posts a reply here.' ),
 196                  'notification_text3'   => T_( 'Notify me by email when someone posts a reply here.' ),
 197                  'before_section_title' => '<h4>',
 198                  'after_section_title'  => '</h4>',
 199                  'comment_list_end'     => '</table>',
 200                  'comment_start'        => '<div class="bText">',
 201                  'comment_end'          => '</div>',
 202                  'disp_rating_summary'  => false,
 203                  'disp_section_title'   => false,
 204                  'form_title_start'     => '',
 205                  'form_title_end'       => '',
 206                  'form_title_text'      => '',
 207                  'form_comment_text'    => T_('Message body'),
 208                  'form_submit_text'     => T_('Submit'),
 209                  'form_params'          => array(
 210                          'formstart'      => '<table class="bForums" width="100%" cellspacing="1" cellpadding="2" border="0"><tr><th colspan="2">'.T_('Post a reply').'</th></tr>',
 211                          'formend'        => '</table>',
 212                          'fieldset_begin' => '<tr class="top"><td colspan="2">',
 213                          'fieldset_end'   => '</td></tr>',
 214                          'fieldstart'     => '<tr>',
 215                          'fieldend'       => '</tr>',
 216                          'labelstart'     => '<td class="left"><strong>',
 217                          'labelend'       => '</strong></td>',
 218                          'inputstart'     => '<td class="row2 left">',
 219                          'inputend'       => '</td>',
 220                          'infostart'      => '<td class="row2 left">',
 221                          'infoend'        => '</td>',
 222                      ),
 223                  'comments_disabled_text_member'     => T_( 'You must be a member of this blog to post a reply.' ),
 224                  'comments_disabled_text_registered' => T_( 'You must be logged in to post a reply.' ),
 225                  'comments_disabled_text_validated'  => T_( 'You must activate your account before you can post a reply.' ),
 226                  'feed_title'                        => get_icon( 'feed' ).' '.T_('RSS feed for replies to this topic'),
 227                  'before_comment_error' => '<p class="center" style="font-size:150%"><b>',
 228                  'comment_closed_text'  => T_('This topic is closed.'),
 229                  'after_comment_error'  => '</b></p>',
 230                  // Params for ajax comment form on quote action

 231                  'comment_mode'         => param( 'mode', 'string', '' ),
 232                  'comment_qc'           => param( 'qc', 'integer', 0 ),
 233                  'comment_qp'           => param( 'qp', 'integer', 0 ),
 234                  $dummy_fields[ 'content' ] => param( $dummy_fields[ 'content' ], 'html' )
 235              ) );
 236          // Note: You can customize the default item feedback by copying the generic

 237          // /skins/_item_feedback.inc.php file into the current skin folder.

 238          // ---------------------- END OF FEEDBACK (COMMENTS/TRACKBACKS) ---------------------

 239      ?>
 240  
 241      <?php
 242          locale_restore_previous();    // Restore previous locale (Blog locale)

 243      ?>
 244  <script type="text/javascript">
 245  jQuery( document ).ready( function()
 246  {
 247      jQuery( '.quote_button' ).click( function()
 248      { // Submit a form to save the already entered content
 249          console.log( jQuery( this ).attr( 'href' ) );
 250          var form = jQuery( 'form[id^=bComment_form_id_]' );
 251          if( form.length == 0 )
 252          { // No form found, Use an url of this link
 253              return true;
 254          }
 255          // Set an action as url of this link and submit a form

 256          form.attr( 'action', jQuery( this ).attr( 'href' ) );
 257          form.submit();
 258          return false;
 259      } );
 260  } );
 261  </script>

title

Description

title

Description

title

Description

title

title

Body