<?php
error_reporting(E_ALL);
/**
 * This is the main template. It displays the blog.
 *
 * However this file is not meant to be called directly.
 * It is meant to be called automagically by b2evolution.
 * To display a blog, you should call a stub file instead, for example:
 * /blogs/index.php or /blogs/blog_b.php
 *
 * b2evolution - {@link http://b2evolution.net/}
 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
 * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * @package evoskins
 * @subpackage l33t_gray
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>">
<head>
  <?php skin_content_meta(); /* Charset for static pages */ ?>
  <?php $Plugins->trigger_event( 'SkinBeginHtmlHead' ); ?>
	<title><?php
		$Blog->disp('name', 'htmlhead');
		request_title( ' - ', '', ' - ', 'htmlhead' );
	?></title>
  <?php skin_base_tag(); /* Base URL for this skin. You need this to fix relative links! */ ?>
  <meta name="description" content="<?php $Blog->disp( 'shortdesc', 'htmlattr' ); ?>" />
  <meta name="keywords" content="<?php $Blog->disp( 'keywords', 'htmlattr' ); ?>" />
	<?php robots_tag(); ?>
  <meta name="generator" content="b2evolution <?php echo $app_version ?>" /> <!-- Please leave this for stats -->
  <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" />
  <link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" />
  <link rel="stylesheet" type="text/css" media="print" href="print.css" />
  <link rel="stylesheet" type="text/css" media="screen" href="l33t_gray.css" />
  <?php
  	$Blog->disp( 'blog_css', 'raw');
  	$Blog->disp( 'user_css', 'raw');
  ?>
</head>
<body>

<div id="container">
	<div class="centerTitle">
	<?php $Blog->disp('shortdesc', 'htmlbody'); ?>
	</div>

<div class="titleBlock">
	<div class="blogTitle">
		<h2><a href="<?php bloginfo('url'); ?>"><?php $Blog->disp( 'name', 'htmlbody' ) ?></a></h2>
		</div>
	<div class="blogTagline">
		>> &nbsp;<?php $Blog->disp( 'tagline', 'htmlbody' ) ?>
		</div>
	</div>

<div class="menuBlock">
<ul>
<li>>>&nbsp; <a href="<?php bloginfo('url'); ?>#blogs"><?php echo T_('Blogs') ?></a></li>
<li>>>&nbsp; <a href="<?php bloginfo('url'); ?>#cats"><?php echo T_('Categories') ?></a></li>
<li>>>&nbsp; <a href="<?php bloginfo('url'); ?>#archives"><?php echo T_('Archives') ?></a></li>
<li>>>&nbsp; <a href="<?php bloginfo('url'); ?>#user"><?php echo T_('User Functions') ?></a></li>
<li>>>&nbsp; <a href="<?php bloginfo('url'); ?>#links"><?php echo T_('Links/ Blogroll') ?></a></li>
</ul>
</div>

<div class="afterDiv"></div>

<?php // START POSTS
if( isset($MainList) ) $MainList->display_if_empty( '' ); // Display message if no post
if( isset($MainList) ) while( $Item = $MainList->get_item() ) {
	locale_temp_switch( $Item->locale ); // Temporarily switch to post locale
	// $MainList->date_if_changed( '<h2>', '</h2>', '' ); // display post date if it changed
	$Item->anchor(); // Anchor for permalinks to refer to
	?>

<div class="bPost" lang="<?php $Item->lang() ?>">
<div class="centerTitle"><?php $Item->title( '', '', true ); ?></div>
<div class="centerContent">
	<?php $Item->issue_date(); ?> @ 
	<?php
	$Item->issue_time( '' );
	echo ', ', T_('Categories'), ': ';
	$Item->categories( '#', '<strong>', '</strong>', '', '', '<em>', '</em>', ', ' );
	echo ', ';
	$Item->wordcount();
	echo ' ', T_('words');
	echo ' &nbsp; ';
	locale_flag( $Item->locale, 'h10px', 'flag', '' );
	?>

	<?php 
	$Item->content();
	link_pages( '#', '#', 'number', '#', '#', '%d' );
	?>

<?php $Item->feedback_link( 'comments', '', ' &#124; ' ) // Link to comments ?>
<?php $Item->feedback_link( 'trackbacks', '', ' &#124; ' ) // Link to trackbacks ?>
<?php $Item->feedback_link( 'pingbacks', '', ' &#124; ' ) // Link to trackbacks ?>
 <a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>">Permalink</a>
<?php $Item->edit_link( ' &#124; ' ) // Link to backoffice for editing ?>
<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
</div>

<?php // START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC.
$disp_comments = 1; // Display comments if requested
$disp_comment_form = 1; // Display comments form if requested
if ( get_bloginfo( 'allowtrackbacks' ) == 1 ) {
	$disp_trackbacks = 1; // Display trackbacks if requested
	$disp_trackback_url = 1; // Display trackback URL if requested
	} else {
	$disp_trackbacks = 0; // or don't
	$disp_trackback_url = 0; // or don't
	}
/*if ( get_bloginfo( 'allowpingbacks' ) == 1 ) {
	$disp_pingbacks = 1; // Display pingbacks if requested
	} else {
	$disp_pingbacks = 0;
	}
	*/
	$disp_pingbacks = 0;
require( dirname(__FILE__).'/_feedback.php' );

locale_restore_previous(); // Restore previous locale (Blog locale)
?>

</div>
<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>

<p class="center"><strong>
<?php posts_nav_link( ' :: ', '#', '#' ); ?>
<?php
// previous_post( '<p class="center">%</p>' );
// next_post( '<p class="center">%</p>' );
?>
</strong></p>

  <?php // START OF INCLUDES FOR LAST COMMENTS, STATS, ARCHIVE DIRECTORY, PROFILE, FLIGHT LOG
  switch( $disp ) {
   case 'comments':
  	 // this includes the last comments if requested:
  	 require( dirname(__FILE__).'/_lastcomments.php' );
  	 break;

   case 'arcdir':
  	 // this includes the archive directory if requested
  	 require( dirname(__FILE__).'/_arcdir.php');
  	 break;

   case 'profile':
  	 // this includes the profile form if requested
  	 require( dirname(__FILE__).'/_profile.php');
  	 break;

   case 'msgform':
  	 // this includes the email form if requested
  	 require( dirname(__FILE__).'/_msgform.php');
  	 break;

   case 'subs':
  	 // this includes the subscription form if requested
  	 require( dirname(__FILE__).'/_subscriptions.php');
  	 break;
  } ?>




</div>

<div class="leftBlock">
<div class="centerTitle">WTF?</div>
<div class="centerContent">
<?php $Blog->disp('longdesc', 'htmlbody'); ?>
</div>

<div class="centerTitle"><a name="blogs"></a>blogs</div>
<div class="centerContent">
<?php require( dirname(__FILE__).'/_bloglist.php'); // BLOG LIST INCLUDED HERE ?>
</div>


	<?php
		// -------------------------- CATEGORIES INCLUDED HERE -----------------------------
		// Call the Categories plugin:
		$Plugins->call_by_code( 'evo_Cats', array(	// Add parameters below:
		  'block_start' => '<div class="centerTitle"><a name="cats"></a>'.T_('Categories').'</div><div class="centerContent">',
      'title' => ''
			) );
		// -------------------------------- END OF CATEGORIES ----------------------------------
	?>




<div class="centerTitle"><a name="archives"></a><?php echo T_('Archives') ?></div>
	<div class="centerContent"><div align="center">
	  
	  <?php
			// -------------------------- CALENDAR INCLUDED HERE -----------------------------
			// Call the Calendar plugin:
			$Plugins->call_by_code( 'evo_Calr', array(	// Params follow:
					'block_start'=>'',
					'block_end'=>'',
					'title'=>'',			// No title.
				) );
			// -------------------------------- END OF CALENDAR ----------------------------------
		?>
		<?php
  		// -------------------------- ARCHIVES INCLUDED HERE -----------------------------
  		// Call the Archives plugin:
  		$Plugins->call_by_code( 'evo_Arch', array(	// Add parameters below:
  		  'block_start' => '',
  		  'block_end' => '',
        'title' => ''
  			) );
  		// -------------------------------- END OF ARCHIVES ----------------------------------
  	?>

	</div>
	</div>

<div class="centerTitle"><a name="user"></a><?php echo T_('User Functions') ?></div>
<div class="centerContent">
<h4><?php echo T_('Management') ?></h4>
<ul>
	<?php
		user_login_link( '<li>', '</li>' );
		user_register_link( '<li>', '</li>' );
		user_admin_link( '<li>', '</li>' );
		user_profile_link( '<li>', '</li>' );
		user_subs_link( '<li>', '</li>' );
		user_logout_link( '<li>', '</li>' );
	?>
</ul>

<h4><?php echo T_('Misc') ?></h4>
<ul>
<li><a href="<?php $Blog->disp( 'lastcommentsurl', 'raw' ) ?>" title="Read the latest comments"><?php echo T_('Last comments') ?></a></li>
</ul>

<h4><?php echo T_('Search') ?></h4>
<div class="search">
<?php form_formstart( $Blog->dget( 'blogurl', 'raw' ), 'search', 'SearchForm' ) ?>
<p><input type="text" name="s" size="15" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" /><br />
<input type="radio" name="sentence" value="AND" id="sentAND" <?php if( $sentence=='AND' ) echo 'checked="checked" ' ?>/><label for="sentAND"><?php echo T_('All Words') ?></label><br />
<input type="radio" name="sentence" value="OR" id="sentOR" <?php if( $sentence=='OR' ) echo 'checked="checked" ' ?>/><label for="sentOR"><?php echo T_('Some Word') ?></label><br />
<input type="radio" name="sentence" value="sentence" id="sentence" <?php if( $sentence=='sentence' ) echo 'checked="checked" ' ?>/><label for="sentence"><?php echo T_('Entire phrase') ?></label></p>
<input type="submit" name="submit" class="submit" value="<?php echo T_('Search') ?>" />
</form>
</div>

<?php if( ! $Blog->get('force_skin') ) { // if skin switching is enabled
  echo '<h4>'. T_('Skins').'</h4>';
  require( dirname(__FILE__).'/_skinslist.php'); // SKINS LIST INCLUDED HERE
} 
?>

<h4> <?php echo T_('XML Feeds') ?></h4>
<ul>
<li>RSS 0.92: <a href="<?php $Blog->disp( 'rss_url', 'raw' ) ?>" /><?php echo T_('Posts') ?>, <a href="<?php $Blog->disp( 'comments_rss_url', 'raw' ) ?>"><?php echo T_('Comments') ?></a></li>
<li>RSS 1.0: <a href="<?php $Blog->disp( 'rdf_url', 'raw' ) ?>" /><?php echo T_('Posts') ?>, <a href="<?php $Blog->disp( 'comments_rdf_url', 'raw' ) ?>"><?php echo T_('Comments') ?></a></li>
<li>RSS 2.0: <a href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" /><?php echo T_('Posts') ?>, <a href="<?php $Blog->disp( 'comments_rss2_url', 'raw' ) ?>"><?php echo T_('Comments') ?></a></li>
<li>Atom: <a href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" /><?php echo T_('Posts') ?>, <a href="<?php $Blog->disp( 'comments_atom_url', 'raw' ) ?>"><?php echo T_('Comments') ?></a></li>
<li><a href="http://fplanque.net/Blog/devblog/2004/01/10/p456" title="External - English">What is RSS?</a></li>
</ul>
</div>

</div>

<div class="rightBlock">

<div class="centerTitle"><a name="links"></a>links</div>
<div class="centerContent">
<?php require( dirname(__FILE__).'/_linkblog.php' ); // LINKBLOG INCLUDED HERE ?>
</div>

<div class="centerTitle"><a name="power"></a><?php echo T_('Credits') ?></div>
<div class="centerContent">
	<ul>
	  <li>powered by <a href="http://b2evolution.net/" title="b2evolution: next generation blog software">b2evolution</a></li>
	  <li>skin design by <a href="http://www.dementedkitty.com">Tara Chen</a></li>
		<?php
			// Display additional credits (see /conf/):
 			// If you can add your own credits without removing the defaults, you'll be very cool :))
			// Please leave this at the bottom of the page to make sure your blog gets listed on b2evolution.net
		  display_list( $credit_links, '', '', '', '<li>', '</li>' );
		?>
	</ul>
</div>

</div>
<div class="afterDiv">&nbsp;</div>
<?php 
log_hit(); // log the hit on this page
debug_info(); // output debug info if requested
?>
</body>
</html>
