<?php
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<div class="contentarea">',
    'after_widget' => '</div>',
 'before_title' => '<h4>',
        'after_title' => '</h4>',
    ));


// WP-zenlike Pages Box 
 function widget_zenlike_pages() {
?>

<h4><?php _e('Pages'); ?></h4>
<div class="contentarea">
   <ul>
<li class="page_item"><a href="<?php bloginfo('url'); ?>">Home</a></li>

<?php wp_list_pages('title_li='); ?>

 </ul>
</div>
<?php
}
if ( function_exists('register_sidebar_widget') )
    register_sidebar_widget(__('Pages'), 'widget_zenlike_pages');


// WP-zenlike Search Box 
 function widget_zenlike_search() {
?>
 

 <h4><?php _e('Search Posts'); ?></h4>
 <div class="contentarea">
 
    <ul>
<li>
   <form id="searchform" method="get" action="<?php bloginfo('url'); ?>/index.php">
 
            <input type="text" name="s" size="18" /><br>

     
            <input type="submit" id="submit" name="Submit" value="Search" />
      
     
 </form>

 
</li>
</ul>
</div>
<?php
}
if ( function_exists('register_sidebar_widget') )
    register_sidebar_widget(__('Search'), 'widget_zenlike_search');


 function widget_links_with_style() {
   global $wpdb;
   $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
   foreach ($link_cats as $link_cat) {
  ?>

  <h4><?php echo $link_cat->cat_name; ?></h4>
<div class="contentarea">
   <ul>
   <?php get_links($link_cat->cat_id, '<li>', '</li>', '<br />', FALSE, 'rand', TRUE,  TRUE, -1, TRUE); ?>
   </ul>
</div>
   <?php } ?>
   <?php }
   if ( function_exists('register_sidebar_widget') )
   register_sidebar_widget(__(' Links With Style'), 'widget_links_with_style');
   
 


?>