<?php get_header(); ?>
<?php
// build big boxes
$aOptions = SofaRooster::initOptions( false );
$numofbigbox = $aOptions[ 'numofbigbox' ];
$sing_comments = $aOptions[ 'sing_comments' ];
$plur_comments = $aOptions[ 'plur_comments' ];
$postedin = $aOptions[ 'postedin' ];
$readmore = $aOptions[ 'readmore' ];
$posts_total = get_option( 'posts_per_page' );
if( $numofbigbox > 0 && strlen( $numofbigbox ) > 0 && $posts_total > 0 ) {
query_posts( 'showposts=' . $numofbigbox );
if( have_posts() ) : while( have_posts() ) : the_post();
?>
<div class="panel fetaured">
<div class="label">
<span><?php echo ( strlen( $postedin ) > 0 ) ? stripslashes( $postedin ) : "Posted in "; ?><?php the_category( ', ' ); ?></span>
</div>
<div class="comments">
<?php
$phrase_singular = ( strlen( $sing_comments ) > 0 ) ? stripslashes( $sing_comments ) : "comment";
$phrase_plural = ( strlen( $plur_comments ) > 0 ) ? stripslashes( $plur_comments ) : "comments";
comments_number( '<span>0</span> ' . $plur_comments, '<span>1</span> ' . $sing_comments, '<span>%</span> ' . $plur_comments );
?>
</div>
<div class="panel-content">
<div class="date">
<div><?php the_time( 'm/j' ); ?> <span><?php the_time( 'Y' ); ?></span></div>
</div>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_content( ( strlen( $readmore ) > 0 ) ? stripslashes( $readmore ) : " READ MORE" ); ?>
</div>
</div>
<?php
endwhile;
endif;
} else $numofbigbox = 0;
?>
<?php
if( $posts_total > $numofbigbox ) {
$the_rest = $posts_total - $numofbigbox;
if( $the_rest > 0 ) {
$cnt_odd = 0;
query_posts( 'showposts=' . $the_rest . '&offset=' . $numofbigbox );
if( have_posts() ) : while( have_posts() ) : the_post();
?>
<div class="panel">
<div class="label">
<span><?php echo ( strlen( $postedin ) > 0 ) ? stripslashes( $postedin ) : "Posted in "; ?><?php the_category( ', ' ); ?></span>
</div>
<div class="comments">
<?php
$phrase_singular = ( strlen( $sing_comments ) > 0 ) ? stripslashes( $sing_comments ) : "comment";
$phrase_plural = ( strlen( $plur_comments ) > 0 ) ? stripslashes( $plur_comments ) : "comments";
comments_number( '<span>0</span> ' . $plur_comments, '<span>1</span> ' . $sing_comments, '<span>%</span> ' . $plur_comments );
?>
</div>
<div class="panel-content narrow">
<div class="date">
<div><?php the_time( 'm/j' ); ?> <span><?php the_time( 'Y' ); ?></span></div>
</div>
<h2 class="smaller"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_content( ( strlen( $readmore ) > 0 ) ? stripslashes( $readmore ) : " READ MORE" ); ?>
</div>
</div>
<?php
$cnt_odd ++;
if( $cnt_odd % 2 == 0 ) echo '<div style="width: 90%; clear: both; height: 1px; line-height: 0;"> </div>';
endwhile;
endif;
}
}
if( $posts_total == 0 ) {
?>
<div class="panel fetaured">
<div class="label">
<span>ERROR!</span>
</div>
<div class="comments">
404 or else?
</div>
<div class="panel-content">
<div class="date">
<div>NOTE <span>THIS</span></div>
</div>
<h2>Ups...</h2>
<p>It seems like there are no posts matching your criteria.</p>
</div>
</div>
<?php } ?>
</div><!-- close content DIV -->
<?php include( TEMPLATEPATH . "/sidebar_index.php" ); ?>
<?php get_footer(); ?>