<?php
$aside_cat = 1;
$aside_number = 5;
?>
<div id="sidebar">
<ul class="xoxo">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : // begin first sidebar widgets ?>
<li id="ad300x250" class="adblock">
<p class="adtitle"><?php _e( 'Реклама', 'wpbx' ) ?></p>
<?php include (TEMPLATEPATH . '/ads/ads-300x250.php'); ?>
</li>
<?php endif; // end first sidebar widgets ?>
<li id="tabber" class="widget_block tablist">
<ul class="clearfix">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : // begin second sidebar widgets ?>
<?php if (function_exists('get_most_rated')): ?>
<li id="mostrated" class="widget">
<h3 class="tabber-title"><?php _e( 'Шокиращи', 'wpbx' ) ?></h3>
<ul>
<?php get_most_rated('post', 0, 5); ?>
</ul>
</li>
<?php endif; ?>
<?php if (function_exists('get_most_viewed')): ?>
<li id="mostview" class="widget">
<h3 class="tabber-title"><?php _e( 'Популярни', 'wpbx' ) ?></h3>
<ul>
<?php get_most_viewed('post', 5); ?>
</ul>
</li>
<?php endif; ?>
<?php if (function_exists('mdv_most_commented')): ?>
<li id="mostcomm" class="widget">
<h3 class="tabber-title"><?php _e( 'Коментирани', 'wpbx' ) ?></h3>
<ul>
<?php mdv_most_commented(); ?>
</ul>
</li>
<?php endif; ?>
<?php endif; // end second sidebar widgets ?>
</ul>
</li>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : // begin third sidebar widgets ?>
<li id="archives-link">
<h3 class="widget-title"><?php _e( 'Archives', 'wpbx' ) ?></h3>
<span class="browse"><a href="<?php bloginfo('url'); ?>/archives" title="Browse the archives"><?php _e( 'Разгледай архивите', 'wpbx' ) ?></a></span>
<p><?php _e( 'Разгледай някои по-стари статии.', 'wpbx' ) ?></p>
</li>
<li id="asides">
<h3 class="widget-title"><?php _e( 'Топ Класации', 'wpbx' ); ?></h3>
<?php $asides = new WP_Query("cat=$aside_cat&showposts=$aside_number"); while($asides->have_posts()) : $asides->the_post(); ?>
<div class="entry-block clearfix">
<?php
$aside_preview = get_post_custom_values("entry-preview");
if ( is_array($aside_preview) ) { ?>
<img class="entry-image block-image" src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, 'entry-preview',true) ?>&w=75&h=65&zc=1" alt="<?php the_title(); ?>" />
<?php } else { ?>
<img class="entry-image block-image" src="<?php bloginfo('template_directory'); ?>/images/image-blank-small.jpg" alt="<?php the_title(); ?>" />
<?php } ?>
<div class="block-content">
<h4 class="block-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('%s'), wp_specialchars(get_the_title(), 1)) ?>"><?php the_title(); ?></a></h4>
<?php the_excerpt(''); ?>
</div>
</div>
<?php endwhile; ?>
</li><!-- end Asides section -->
<li id="ad300x100" class="adblock">
<?php include (TEMPLATEPATH . '/ads/ads-300x100.php'); ?>
</li>
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<li id="tag-cloud">
<h3 class="widget-title"><?php _e('Популярни Тагове'); ?></h3>
<div>
<?php wp_tag_cloud('smallest=8&largest=18&number=15'); ?>
</div>
</li><!-- end Popular Tags section -->
<?php endif; ?>
<?php wp_list_bookmarks('title_before=<h3 class="widget-title">&title_after=</h3>&show_images=0') ?>
<?php endif; // end third sidebar widgets ?>
</ul>
</div><!-- #sidebar -->