b2evolution PHP Cross Reference Blogging Systems

Source: /skins/forums/_item_list.inc.php - 122 lines - 4081 bytes - Text - Print

Description: This is the template that displays the item block in list 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 in list

   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  // Default params:

  17  $params = array_merge( array(
  18          'display_column_forum' => false,
  19          'post_navigation' => 'same_category', // In this skin, it makes no sense to navigate in any different mode than "same category"
  20      ), $params );
  21  
  22  global $Item;
  23  
  24  /**

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

  26   */
  27  global $legend_statuses;
  28  
  29  if( !is_array( $legend_statuses ) )
  30  {    // Init this array only first time
  31      $legend_statuses = array();
  32  }
  33  
  34  $comments_number = generic_ctp_number( $Item->ID, 'comments', get_inskin_statuses() );
  35  
  36  $status_icon = 'topic';
  37  $status_title = '';
  38  $status_alt = T_('No new posts');
  39  if( $Item->is_featured() || $Item->is_intro() )
  40  {    // Special icon for featured & intro posts
  41      $status_icon = 'topicSticky';
  42      $status_title = '<strong>'.T_('Sticky').':</strong> ';
  43  }
  44  elseif( $Item->comment_status == 'closed' || $Item->comment_status == 'disabled' || $Item->is_locked() )
  45  {    // The post is closed for comments
  46      $status_icon = 'topicLocked';
  47      $status_alt = T_('This topic is locked: you cannot edit posts or make replies.');
  48  }
  49  elseif( $comments_number > 25 )
  50  {    // Popular topic
  51      $status_icon = 'folder_hot.gif';
  52  }
  53  ?>
  54          <tr>
  55              <td class="status">
  56              <?php
  57                  if( strpos( $status_icon, '.gif' ) !== false )
  58                  { // The animated icon
  59              ?>
  60                  <img src="img/<?php echo $status_icon; ?>" width="19" height="18" alt="<?php echo $status_alt; ?>" title="<?php echo $status_alt; ?>" />
  61              <?php
  62                  }
  63                  else
  64                  { // Static icon
  65              ?>
  66                  <span class="ficon <?php echo $status_icon; ?>" title="<?php echo $status_alt; ?>"></span>
  67              <?php } ?>
  68              </td>
  69              <?php
  70                  if( $params['display_column_forum'] )
  71                  {    // Display main category
  72              ?>
  73              <td class="left"><?php $Item->main_category( 'htmlbody', array( 'display_link' => true, 'link_class' => 'forumlink' ) ); ?></td>
  74              <?php } ?>
  75              <td class="left"><?php
  76                  echo $status_title;
  77                  $Item->title( array(
  78                          'link_class'      => 'topictitle',
  79                          'post_navigation' => $params['post_navigation'],
  80                      ) );
  81                  if( $Skin->enabled_status_banner( $Item->status ) )
  82                  {
  83                      $Item->status( array( 'format' => 'styled' ) );
  84                      $legend_statuses[] = $Item->status;
  85                  }
  86              ?></td>
  87              <td class="row2 font10"><?php
  88                  if( $comments_number == 0 && $Item->comment_status == 'disabled' )
  89                  {    // The comments are disabled
  90                      echo T_('n.a.');
  91                  }
  92                  else
  93                  {
  94                      echo $comments_number;
  95                  }
  96              ?></td>
  97              <td class="row3 font11"><?php $Item->author( array( 'link_text' => 'login' ) ); ?></td>
  98              <td class="row2 font10"><?php
  99                  if( $latest_Comment = & $Item->get_latest_Comment() )
 100                  {    // Display info about last comment
 101                      $latest_Comment->date('D M j, Y H:i');
 102                      $latest_Comment->author2( array(
 103                              'before'      => '<br />',
 104                              'before_user' => '<br />',
 105                              'after'       => ' ',
 106                              'after_user'  => ' ',
 107                              'link_text'   => 'login'
 108                          ) );
 109  
 110                      echo ' <a href="'.$latest_Comment->get_permanent_url().'"><span class="ficon latestReply" title="'.T_('View latest post').'"></span></a>';
 111                  }
 112                  else
 113                  {    // No comments, Display info of post
 114                      echo $Item->get_mod_date( 'D M j, Y H:i' );
 115                      echo $Item->author( array(
 116                              'before'    => '<br />',
 117                              'link_text' => 'login',
 118                          ) );
 119                      echo '<a href="'.$Item->get_permanent_url().'"><span class="ficon latestReply" title="'.T_('View latest post').'"></span></a>';
 120                  }
 121              ?></td>
 122          </tr>

title

Description

title

Description

title

Description

title

title

Body