b2evolution PHP Cross Reference Blogging Systems

Source: /default.php - 242 lines - 8973 bytes - Text - Print

Description: This is the main public interface file! This file is NOT mandatory. You can delete it if you want. You can also replace the contents of this file with contents similar to the contents of a_stub.php, a_noskin.php, multiblogs.php, etc.

   1  <?php
   2  /**
   3   * This is the main public interface file!
   4   *
   5   * This file is NOT mandatory. You can delete it if you want.
   6   * You can also replace the contents of this file with contents similar to the contents
   7   * of a_stub.php, a_noskin.php, multiblogs.php, etc.
   8   *
   9   * b2evolution - {@link http://b2evolution.net/}
  10   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  11   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  12   *
  13   * @package evoskins
  14   * @subpackage noskin
  15   */
  16  
  17  /**
  18   * First thing: Do the minimal initializations required for b2evo:
  19   */
  20  require_once dirname(__FILE__).'/conf/_config.php';
  21  
  22  /**
  23   * Check this: we are requiring _main.inc.php INSTEAD of _blog_main.inc.php because we are not
  24   * trying to initialize any particular blog
  25   */
  26  require_once $inc_path.'_main.inc.php';
  27  
  28  
  29  
  30  // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
  31  // Note: This is totally optional. General caching must be enabled in Global settings, otherwise this will do nothing.
  32  // 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.
  33  load_class( '_core/model/_pagecache.class.php', 'PageCache' );
  34  $PageCache = new PageCache( NULL );
  35  // Check for cached content & Start caching if needed:
  36  if( ! $PageCache->check() )
  37  {    // Cache miss, we have to generate:
  38      // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
  39  
  40  
  41  // Add CSS:
  42  require_css( 'basic_styles.css', 'rsc_url' ); // the REAL basic styles
  43  require_css( 'basic.css', 'rsc_url' ); // Basic styles
  44  require_css( 'evo_distrib_2.css', 'rsc_url' );
  45  
  46  headers_content_mightcache( 'text/html' );        // In most situations, you do NOT want to cache dynamic content!
  47  ?>
  48  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  49  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>"><!-- InstanceBegin template="/Templates/evo_distrib_2.dwt" codeOutsideHTMLIsLocked="false" -->
  50  <head>
  51      <!-- InstanceBeginEditable name="doctitle" -->
  52      <title>b2evolution - Default Page</title>
  53      <!-- InstanceEndEditable -->
  54      <meta name="viewport" content="width = 750" />
  55      <meta name="robots" content="noindex, follow" />
  56      <?php include_headlines() /* Add javascript and css files included by plugins and skin */ ?>
  57      <!-- InstanceBeginEditable name="head" -->
  58      <base href="<?php echo $baseurl ?>" />
  59      <!-- InstanceEndEditable -->
  60      <!-- InstanceParam name="lang" type="text" value="&lt;?php locale_lang() ?&gt;" -->
  61  </head>
  62  
  63  <body>
  64      <!-- InstanceBeginEditable name="BodyHead" -->
  65      <?php
  66      // ---------------------------- TOOLBAR INCLUDED HERE ----------------------------
  67      require $skins_path.'_toolbar.inc.php';
  68      // ------------------------------- END OF TOOLBAR --------------------------------
  69  
  70      echo "\n";
  71      if( show_toolbar() )
  72      {
  73          echo '<div id="skin_wrapper" class="skin_wrapper_loggedin">';
  74      }
  75      else
  76      {
  77          echo '<div id="skin_wrapper" class="skin_wrapper_anonymous">';
  78      }
  79      echo "\n";
  80      ?>
  81      <!-- Start of skin_wrapper -->
  82      <!-- InstanceEndEditable -->
  83  
  84      <div class="wrapper1">
  85      <div class="wrapper2">
  86          <span class="version_top"><!-- InstanceBeginEditable name="Version" --><?php echo T_('Default page') ?><!-- InstanceEndEditable --></span>
  87  
  88          <a href="http://b2evolution.net/" target="_blank"><img src="rsc/img/distrib/b2evolution-logo.gif" alt="b2evolution" width="237" height="92" /></a>
  89  
  90          <div class="menu_top"><!-- InstanceBeginEditable name="MenuTop" -->
  91              <span class="floatright"><a href="<?php echo $baseurl ?>">Home</a> &bull; <a href="<?php echo $admin_url ?>">Admin</a> </span>
  92              &nbsp;
  93          <!-- InstanceEndEditable --></div>
  94  
  95          <!-- InstanceBeginEditable name="Main" -->
  96          <?php
  97          /**
  98           * @var BlogCache
  99           */
 100          $BlogCache = & get_BlogCache();
 101          $BlogCache->load_all();
 102  
 103          if( $pagenow == 'index.php' || count( $BlogCache->cache ) == 0 )
 104          {    // This page is actually included by the index.html page OR there are no blogs
 105              ?>
 106              <div class="block1">
 107              <div class="block2">
 108              <div class="block3">
 109  
 110                  <h1><?php echo T_('Welcome to b2evolution') ?></h1>
 111  
 112                  <?php
 113                      messages( array(
 114                              'block_start' => '<div class="action_messages">',
 115                              'block_end'   => '</div>',
 116                          ) );
 117  
 118                      if( count( $BlogCache->cache ) == 0 )
 119                      {    // There is no blog on this system!
 120                          echo '<p><strong>'.T_('b2evolution is installed and ready but you haven\'t created any blog on this system yet.').'</strong></p>';
 121  
 122                          echo '<p><a href="'.$admin_url.'?ctrl=collections&amp;action=new">'.T_( 'Create a first blog' ).' &raquo;</a></p>';
 123                      }
 124                      else
 125                      {
 126                          echo '<p><strong>'.T_('You have successfully installed b2evolution.').'</strong></p>';
 127  
 128                          echo '<p>'.T_('You haven\'t set a default blog yet. Thus, you see this default page.').'</p>';
 129                          ?>
 130                          <p><a href="<?php echo $admin_url ?>?ctrl=gensettings"><?php echo T_( 'Set a default blog' ) ?> &raquo;</a></p>
 131                          <?php
 132                      }
 133                      ?>
 134              </div>
 135              </div>
 136              </div>
 137              <?php
 138          }
 139  
 140          if( count( $BlogCache->cache ) )
 141          {    // There are blogs on this system!
 142          ?>
 143  
 144          <div class="block1">
 145          <div class="block2">
 146          <div class="block3">
 147  
 148      <h2><?php echo T_('Blogs on this system') ?></h2>
 149  
 150      <ul>
 151      <?php // --------------------------- BLOG LIST -----------------------------
 152          for( $l_Blog = & $BlogCache->get_first();
 153                      ! is_null( $l_Blog );
 154                       $l_Blog = & $BlogCache->get_next() )
 155          { # by uncommenting the following lines you can hide some blogs
 156              // if( $curr_blog_ID == 2 ) continue; // Hide blog 2...
 157              echo '<li><strong>';
 158              printf( T_('Blog #%d'), $l_Blog->ID );
 159              echo ': <a href="'.$l_Blog->gen_blogurl().'" title="'.$l_Blog->dget( 'shortdesc', 'htmlattr' ).'">';
 160              $l_Blog->disp( 'name' );
 161              echo '</a></strong>';
 162              echo '</li>';
 163          }
 164          // ---------------------------------- END OF BLOG LIST ---------------------------------
 165          ?>
 166      </ul>
 167  
 168          <?php
 169              echo '<p><a href="'.$admin_url.'?ctrl=collections&amp;action=new">'.T_( 'Add a new blog' ).' &raquo;</a></p>';
 170          ?>
 171          </div>
 172          </div>
 173          </div>
 174  
 175          <div class="block1">
 176          <div class="block2">
 177          <div class="block3">
 178  
 179       <h2><?php echo T_('Bonus templates &amp; features') ?></h2>
 180      <p class="note"><?php echo T_('These templates demonstrate more advanced uses of b2evolution. These do not make use of skins. The only way to change their look and feel is to edit their PHP template.') ?></p>
 181      <ul>
 182          <?php
 183              $first_Blog = & $BlogCache->get_by_ID( 1, false );
 184              if( !empty( $first_Blog ) )
 185              {
 186              ?>
 187                  <li><strong><a href="a_noskin.php"><?php echo T_('Blog #1 called through a custom template (not a skin)') ?></a></strong> &nbsp; <span class="note">(a_noskin.php)</span></li>
 188                  <li><strong><a href="multiblogs.php"><?php echo T_('Multiple blogs displayed on the same page') ?></a></strong> &nbsp; <span class="note">(multiblogs.php)</span></li>
 189                  <li><strong><a href="sitemap_a.php"><?php echo T_('Blog #1 XML sitemap (called through a stub)') ?></a></strong> &nbsp; <span class="note">(sitemap_a.php)</span></li>
 190                  <li><strong><a href="sitemap_blogs.php"><?php echo T_('Blog #1 aggregated XML sitemap (called through a stub)') ?></a></strong> &nbsp; <span class="note">(sitemap_blogs.php)</span></li>
 191              <?php
 192              }
 193          ?>
 194          <li><strong><a href="summary.php"><?php echo T_('Summary of latest posts in all blogs') ?></a></strong> &nbsp; <span class="note">(summary.php)</span></li>
 195          <li><strong><a href="default.php"><?php echo T_('The page you\'re looking at') ?></a></strong> &nbsp; <span class="note">(default.php)</span></li>
 196          <li><strong><a href="contact.php"><?php echo T_('A standalone admin-contact page for your site') ?></a></strong> &nbsp; <span class="note">(contact.php)</span></li>
 197      </ul>
 198  
 199      </div>
 200      </div>
 201      </div>
 202      <?php
 203      }
 204  ?>
 205  
 206  <!-- InstanceEndEditable -->
 207      </div>
 208  
 209      <div class="body_fade_out">
 210  
 211      <div class="menu_bottom"><!-- InstanceBeginEditable name="MenuBottom" -->Powered by <a href="http://b2evolution.net/" target="_blank">b2evolution</a> &bull; <a href="http://b2evolution.net/man/" target="_blank">Manual</a> &bull; <a href="http://forums.b2evolution.net/" target="_blank">Forums</a>
 212          <!-- InstanceEndEditable --></div>
 213  
 214      <div class="copyright"><!-- InstanceBeginEditable name="CopyrightTail" -->
 215          <a href="contact.php"><?php echo T_('Contact the admin') ?></a>
 216          <?php
 217              credits( array(
 218                      'list_start'  => ' &middot; ',
 219                      'list_end'    => ' ',
 220                      'separator'   => ' &middot; ',
 221                      'item_start'  => ' ',
 222                      'item_end'    => ' ',
 223                  ) );
 224          ?>
 225          <!-- InstanceEndEditable --></div>
 226  
 227      </div>
 228      </div>
 229  
 230      <!-- InstanceBeginEditable name="BodyFoot" -->
 231      <!-- End of skin_wrapper -->
 232      </div>
 233      <!-- InstanceEndEditable -->
 234  </body>
 235  <!-- InstanceEnd --></html>
 236  <?php
 237      // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
 238      // Save collected cached data if needed:
 239      $PageCache->end_collect();
 240  }
 241  // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
 242  ?>

title

Description

title

Description

title

Description

title

title

Body