<!-- begin sidebar -->
    <div id="sidebar">
		<?php 	/* Widgetized sidebar */
		if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(__("Sidebar One", "moderno")) ) : ?>             
        <div class="side-widget">
	        <?php get_search_form() ; ?>
        </div>
        <div class="side-widget">
            <h3><?php _e('Advertisements', "moderno"); ?></h3>
            	<div class="sideads">
					<?php if(theme_option('sidebar_ad')) { echo stripslashes(theme_option('sidebar_ad')); } else { ?>
                    <a href="#"><img src="<?php echo THEME_URL; ?>/images/adspot.png" alt="" class="four" /></a>
                    <a href="#"><img src="<?php echo THEME_URL; ?>/images/adspot.png" alt="" class="four" /></a>
                    <a href="#"><img src="<?php echo THEME_URL; ?>/images/adspot.png" alt="" class="four" /></a>
                    <a href="#"><img src="<?php echo THEME_URL; ?>/images/adspot.png" alt="" class="four" /></a>
                    <?php } ?>
                </div>
        </div>

		<div class="side-widget">
            <h3><?php _e('Categories', "moderno"); ?></h3>
        	<ul>
			<?php wp_list_categories('title_li=&depth=1'); ?>    
            </ul>
        </div>     

        <div class="side-widget">
            <h3 class="twitter"><?php _e('Twitter Feed', "moderno"); ?></h3>
        <?php
			$username = '';
			$limit = 5;
			$link = __('Follow Me on Twitter!', "moderno");
			
			$prefix = "<ul class='mytweets'>"; 
			$suffix = "</ul>";
			$tweetprefix = "<li>";
			$tweetsuffix = "</li>";
			
			$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=" . $limit;
			
			function parse_feed($feed, $prefix, $tweetprefix, $tweetsuffix, $suffix) {
			
				$feed = str_replace("&lt;", "<", $feed);
				$feed = str_replace("&gt;", ">", $feed);
				$feed = str_replace("&quot;", '"', $feed);
				$clean = explode("<content type=\"html\">", $feed);
				
				$amount = count($clean) - 1;
				
				echo $prefix;
				
				for ($i = 1; $i <= $amount; $i++) {
				$cleaner = explode("</content>", $clean[$i]);
				echo $tweetprefix;
				echo str_replace("&amp;", "&", $cleaner[0]);
				echo $tweetsuffix;
				}
				
				echo $suffix;
			}
			$twitterFeed = wp_remote_fopen($feed);
			parse_feed($twitterFeed, $prefix, $tweetprefix, $tweetsuffix, $suffix);
			echo '<a href="http://twitter.com/'.$username.'" class="twitterlink">'.$link.'</a>';
			?>
		</div>
        <?php endif; ?>
  
    </div> <!-- end #sidebar -->
<!-- end sidebar -->