b2evolution PHP Cross Reference Blogging Systems

Source: /summary.php - 186 lines - 6491 bytes - Summary - Text - Print

Description: This is a demo template displaying a summary of the last posts in each blog If you're new to b2evolution templates or skins, you should not start with this file It will be easier to start examining blog_a.php or noskin_a.php for instance...

   1  <?php
   2  /**
   3   * This is a demo template displaying a summary of the last posts in each blog
   4   *
   5   * If you're new to b2evolution templates or skins, you should not start with this file
   6   * It will be easier to start examining blog_a.php or noskin_a.php for instance...
   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   * @subpackage noskin
  14   */
  15  
  16  /**
  17   * Check this: we are requiring _main.inc.php INSTEAD of _blog_main.inc.php because we are not
  18   * trying to initialize any particular blog
  19   */
  20  require_once dirname(__FILE__).'/conf/_config.php';
  21  
  22  require_once $inc_path.'_main.inc.php';
  23  
  24  load_funcs( 'skins/_skin.funcs.php' );
  25  
  26  
  27  // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
  28  // Note: This is totally optional. General caching must be enabled in Global settings, otherwise this will do nothing.
  29  // Delete this block if you don't care about page level caching. Don't forget to delete the matching section at the end of the page.
  30  load_class( '_core/model/_pagecache.class.php', 'PageCache' );
  31  $PageCache = new PageCache( NULL );
  32  // Check for cached content & Start caching if needed:
  33  if( ! $PageCache->check() )
  34  {    // Cache miss, we have to generate:
  35      // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
  36  
  37  
  38  // Add CSS:
  39  require_css( 'basic_styles.css', 'rsc_url' ); // the REAL basic styles
  40  require_css( 'basic.css', 'rsc_url' ); // Basic styles
  41  require_css( 'blog_base.css', 'rsc_url' ); // Default styles for the blog navigation
  42  require_css( 'item_base.css', 'rsc_url' ); // Default styles for the post CONTENT
  43  require_css( 'fp02.css', 'rsc_url' );
  44  
  45  add_js_for_toolbar();        // Registers all the javascripts needed by the toolbar menu
  46  
  47  headers_content_mightcache( 'text/html' );        // In most situations, you do NOT want to cache dynamic content!
  48  ?>
  49  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  50  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>"><!-- InstanceBegin template="/Templates/Standard.dwt" codeOutsideHTMLIsLocked="false" -->
  51  <head>
  52  <!-- InstanceBeginEditable name="doctitle" -->
  53  <title><?php echo T_('Summary Demo'); ?></title>
  54  <!-- InstanceEndEditable -->
  55  <!-- InstanceBeginEditable name="head" -->
  56  <?php include_headlines() /* Add javascript and css files included by plugins and skin */ ?>
  57  <!-- InstanceEndEditable -->
  58  </head>
  59  <body>
  60  <!-- InstanceBeginEditable name="ToolBar" -->
  61  <?php
  62      // ---------------------------- TOOLBAR INCLUDED HERE ----------------------------
  63      require $skins_path.'_toolbar.inc.php';
  64      // ------------------------------- END OF TOOLBAR --------------------------------
  65      echo "\n";
  66      if( show_toolbar() )
  67      {
  68          echo '<div id="skin_wrapper" class="skin_wrapper_loggedin">';
  69      }
  70      else
  71      {
  72          echo '<div id="skin_wrapper" class="skin_wrapper_anonymous">';
  73      }
  74      echo "\n";
  75  ?>
  76  <!-- InstanceEndEditable -->
  77  <div class="pageHeader">
  78  <!-- InstanceBeginEditable name="NavBar2" -->
  79  <?php
  80      // --------------------------------- START OF BLOG LIST --------------------------------
  81      skin_widget( array(
  82                          // CODE for the widget:
  83                          'widget' => 'colls_list_public',
  84                          // Optional display params
  85                          'block_start' => '<div class="NavBar">',
  86                          'block_end' => '</div>',
  87                          'block_display_title' => false,
  88                          'list_start' => '',
  89                          'list_end' => '',
  90                          'item_start' => '',
  91                          'item_end' => '',
  92                          'item_selected_start' => '',
  93                          'item_selected_end' => '',
  94                          'link_selected_class' => 'NavButton2',
  95                          'link_default_class' => 'NavButton2',
  96                  ) );
  97      // ---------------------------------- END OF BLOG LIST ---------------------------------
  98  ?>
  99  <!-- InstanceEndEditable -->
 100  <div class="pageTitle">
 101  <h1 id="pageTitle"><!-- InstanceBeginEditable name="PageTitle" --><?php echo T_('Summary Demo') ?><!-- InstanceEndEditable --></h1>
 102  </div>
 103  </div>
 104  
 105  
 106  <div class="pageSubTitle"><!-- InstanceBeginEditable name="SubTitle" --><?php echo T_('This demo template displays a summary of last posts in all blogs') ?><!-- InstanceEndEditable --></div>
 107  
 108  
 109  <div class="main"><!-- InstanceBeginEditable name="Main" -->
 110  
 111  <!-- =================================== START OF MAIN AREA =================================== -->
 112  
 113  
 114  <?php // --------------------------- BLOG LIST -----------------------------
 115  
 116      load_class( 'items/model/_itemlist.class.php', 'ItemList' );
 117  
 118      $BlogCache = & get_BlogCache();
 119  
 120      $blog_array = $BlogCache->load_public();
 121  
 122      foreach( $blog_array as $blog )
 123      {    // Loop through all public blogs:
 124          # by uncommenting the following lines you can hide some blogs
 125          // if( $blog == 2 ) continue; // Hide blog 2...
 126  
 127      /**
 128           * @var Blog
 129           */
 130          $l_Blog = & $BlogCache->get_by_ID( $blog );
 131  
 132          ?>
 133          <h3><a href="<?php echo $l_Blog->gen_blogurl(); ?>" title="<?php $l_Blog->disp( 'shortdesc', 'htmlattr' ); ?>"><?php $l_Blog->disp( 'name', 'htmlattr' ); ?></a></h3>
 134          <ul>
 135          <?php    // Get the 3 last posts for each blog:
 136  
 137              $BlogBList = new ItemList2( $l_Blog, $l_Blog->get_timestamp_min(), $l_Blog->get_timestamp_max(), 3 );
 138  
 139              $BlogBList->set_filters( array(
 140                      'order' => 'DESC',
 141                      'unit' => 'posts',
 142                  ) );
 143  
 144              // Run the query:
 145              $BlogBList->query();
 146  
 147              while( $Item = & $BlogBList->get_item() )
 148              {
 149                  ?>
 150                  <li lang="<?php $Item->lang() ?>">
 151                      <?php
 152                          $Item->issue_date( array(
 153                                  'before'      => ' ',
 154                                  'after'       => ' ',
 155                                  'date_format' => '#',
 156                              ) );
 157  
 158                          $Item->title( array(
 159                                  'link_type' => 'permalink',
 160                              ) );
 161                      ?>
 162                      <span class="small">[<?php $Item->lang() ?>]</span>
 163                  </li>
 164                  <?php
 165              }
 166              ?>
 167              <li><a href="<?php echo $l_Blog->gen_blogurl(); ?>"><?php echo T_('More posts...') ?></a></li>
 168          </ul>
 169          <?php
 170      }
 171      // ---------------------------------- END OF BLOG LIST --------------------------------- ?>
 172  <!-- InstanceEndEditable --></div>
 173  <div class="footer">
 174  This is a demo page for <a href="http://b2evolution.net/">b2evolution</a>.
 175  <!-- InstanceBeginEditable name="Baseline" -->
 176  <?php echo '</div>' ?>
 177  <!-- InstanceEndEditable --></div>
 178  </body>
 179  <!-- InstanceEnd --></html>
 180  <?php
 181      // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
 182      // Save collected cached data if needed:
 183      $PageCache->end_collect();
 184  }
 185  // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
 186  ?>

title

Description

title

Description

title

Description

title

title

Body