<?php
global $options;
foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
?>

<div id="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?>

<div class="widget">
<?php get_search_form(); ?>
</div>

<?php if (is_home()): ?>
<?php else: ?>
<div class="widget">
<h4>Recent Posts</h4>
<?php query_posts('showposts=7'); ?>
<ul>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile;?>
</ul>
</div>
<?php endif; ?>

<div class="widget">
<h4>Categories</h4>
<ul>
<?php wp_list_cats('sort_column=name&depth=1'); ?>
</ul>
</div>

<div class="widget">
<h4>Calendar</h4>
<?php get_calendar(); ?>
</div>

<?php if ($cleansimplewhite_twitter_disable == "true") { ?><?php } else { ?>
<div class="widget">
<h4>Latest Tweets</h4>
<?php include(TEMPLATEPATH.'/twitter.php'); ?>
</div>
<?php } ?>

<?php endif; ?>
</div><!-- end sidebar -->