b2evolution PHP Cross Reference Blogging Systems

Source: /skins/forums/_catdir.disp.php - 190 lines - 6554 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  global $number_of_posts_in_cat, $cat;
  19  
  20  if( $cat > 0 )
  21  {
  22      // Init MainList

  23      $page = param( 'paged', 'integer', 1 );
  24      $MainList = new ItemList2( $Blog, $Blog->get_timestamp_min(), $Blog->get_timestamp_max(), $Blog->get_setting('posts_per_page') );
  25      $MainList->load_from_Request();
  26      $MainList->set_filters( array(
  27              'cat_array' => array( $cat ), // Limit only by selected cat (exclude posts from child categories)
  28              'page' => $page
  29          ) );
  30      $MainList->query();
  31      $MainList->nav_target = $cat; // set navigation target, we are always navigating through category in this skin

  32  
  33  
  34      $ChapterCache = & get_ChapterCache();
  35      if( $category = & $ChapterCache->get_by_ID( $cat ) )
  36      {    // Display category title
  37          $category_name = $category->get( 'name' ); // $category_name is also used below

  38          echo '<h2 class="page_title">'.$category_name.'</h2>';
  39      }
  40  
  41  // -------------------- PREV/NEXT PAGE LINKS (POST LIST MODE) --------------------

  42  mainlist_page_links( array(
  43          'block_start' => '<div class="navigation_top"><div class="navigation">'.T_('Page').': ',
  44          'block_end' => '</div></div>',
  45          'prev_text' => T_('Previous'),
  46          'next_text' => T_('Next'),
  47      ) );
  48  // ------------------------- END OF PREV/NEXT PAGE LINKS -------------------------

  49  
  50  ?>
  51  <div class="post_panel">
  52  <?php
  53      $Skin->display_post_button( $cat );
  54      // BREADCRUMBS

  55      $Skin->display_breadcrumbs( $cat );
  56      ?>
  57      <div class="clear"></div>
  58  </div>
  59  <?php
  60  }
  61  
  62  $chapters = $Skin->get_chapters( $cat );
  63  
  64  if( count( $chapters ) > 0 )
  65  {
  66  ?>
  67      <table class="bForums" width="100%" cellspacing="1" cellpadding="2" border="0">
  68          <tr>
  69              <th colspan="2"><?php echo isset( $category_name ) ? $category_name : T_('Forum'); ?></th>
  70              <th width="70"><?php echo T_('Topics'); ?></th>
  71              <th width="70"><?php echo T_('Replies'); ?></th>
  72          </tr>
  73  <?php
  74      foreach( $chapters as $Chapter )
  75      {    // Loop through categories:
  76          if( $Chapter->meta )
  77          {    // Meta category
  78              $chapters_children = $Chapter->children;
  79  ?>
  80          <tr class="meta_category">
  81              <th colspan="2"><a href="<?php echo $Chapter->get_permanent_url(); ?>" class="forumlink"><?php echo $Chapter->dget( 'name' ); ?></a></th>
  82              <td colspan="2">&nbsp;</td>
  83          </tr>
  84  <?php
  85          }
  86          else
  87          {    // Simple category with posts
  88              $chapters_children = array( $Chapter );
  89          }
  90  
  91          foreach( $chapters_children as $Chapter )
  92          {    // Loop through categories:
  93              if( $Chapter->lock )
  94              {    // Set icon for locked chapter
  95                  $chapter_icon = 'catBigLocked';
  96                  $chapter_icon_title = T_('This forum is locked: you cannot post, reply to, or edit topics.');
  97              }
  98              else
  99              {    // Set icon for unlocked chapter
 100                  $chapter_icon = 'catBig';
 101                  $chapter_icon_title = T_('No new posts');
 102              }
 103  ?>
 104          <tr>
 105              <td class="status"><span class="ficon <?php echo $chapter_icon; ?>" title="<?php echo $chapter_icon_title; ?>"></span></td>
 106              <td class="left">
 107                  <a href="<?php echo $Chapter->get_permanent_url(); ?>" class="forumlink"><?php echo $Chapter->dget( 'name' ); ?></a>
 108                  <?php
 109                  if( $Chapter->dget( 'description' ) != '' )
 110                  {
 111                      echo '<br />'.$Chapter->dget( 'description' );
 112                  }
 113                  if( count( $Chapter->children ) > 0 )
 114                  {    // Subforums are exist
 115                      echo '<div class="subcats">';
 116                      echo T_('Subforums').': ';
 117                      foreach( $Chapter->children as $cc => $child_Chapter )
 118                      {    // Display subforum
 119                          echo '<a href="'.$child_Chapter->get_permanent_url().'" class="forumlink">'.$child_Chapter->get('name').'</a>';
 120                          echo $cc < count( $Chapter->children ) - 1 ? ', ' : '';
 121                      }
 122                      echo '</div>';
 123                  }
 124                  ?>
 125              </td>
 126              <td class="row2"><?php echo get_postcount_in_category( $Chapter->ID ); ?></td>
 127              <td class="row2"><?php echo get_commentcount_in_category( $Chapter->ID ); ?></td>
 128          </tr>
 129  <?php
 130          }
 131      }    // End of categories loop.

 132  ?>
 133      </table>
 134  <?php
 135  }
 136  
 137  // ---------------------------------- START OF POSTS ------------------------------------

 138  if( isset( $MainList ) && $MainList->result_num_rows > 0 )
 139  {
 140  ?>
 141  <br />
 142  <table class="bForums bPosts" width="100%" cellspacing="1" cellpadding="2" border="0">
 143      <tr>
 144          <th colspan="2"><?php echo T_('Topics'); ?></th>
 145          <th width="70"><?php echo T_('Replies'); ?></th>
 146          <th width="100"><?php echo T_('Author'); ?></th>
 147          <th width="160"><?php echo T_('Last Post'); ?></th>
 148      </tr>
 149  <?php
 150  
 151  // Go Grab the featured posts:

 152  while( $Item = get_featured_Item() )
 153  {    // We have a intro post to display:
 154      // ---------------------- ITEM BLOCK INCLUDED HERE ------------------------

 155      skin_include( '_item_list.inc.php', array(
 156              'feature_block' => true,
 157              'content_mode'  => 'auto',        // 'auto' will auto select depending on $disp-detail
 158              'intro_mode'    => 'normal',    // Intro posts will be displayed in normal mode
 159              'item_class'    => 'featured_post',
 160              'image_size'    => 'fit-400x320',
 161          ) );
 162      // ----------------------------END ITEM BLOCK  ----------------------------

 163  }
 164  
 165  while( mainlist_get_item() )
 166  {    // For each blog post, do everything below up to the closing curly brace "}"
 167  
 168      // ---------------------- ITEM BLOCK INCLUDED HERE ------------------------

 169      skin_include( '_item_list.inc.php', array(
 170              'content_mode' => 'auto',        // 'auto' will auto select depending on $disp-detail
 171              'image_size'   => 'fit-400x320',
 172          ) );
 173      // ----------------------------END ITEM BLOCK  ----------------------------

 174  }
 175  ?>
 176  </table>
 177  <?php
 178  } // ---------------------------------- END OF POSTS ------------------------------------

 179  
 180  
 181  // -------------------- PREV/NEXT PAGE LINKS (POST LIST MODE) --------------------

 182  mainlist_page_links( array(
 183          'block_start' => '<div class="navigation font11">'.T_('Page').': ',
 184          'block_end' => '</div>',
 185          'prev_text' => T_('Previous'),
 186          'next_text' => T_('Next'),
 187      ) );
 188  // ------------------------- END OF PREV/NEXT PAGE LINKS -------------------------

 189  
 190  ?>

title

Description

title

Description

title

Description

title

title

Body