<?php if ( (is_home())  ) { ?><?php } else { ?></div></div><?php } ?>

<div id="footer">

<div class="inner">

<div class="col4">
<?php if ( !function_exists('dynamic_sidebar')
		        || !dynamic_sidebar('footer-column1') ) : ?>

<h3><?php _e( 'Comments', 'ines') ?></h3>



<?php endif; ?>
</div>

<div class="col5">
<?php if ( !function_exists('dynamic_sidebar')
		        || !dynamic_sidebar('footer-column2') ) : ?>
<h3><?php _e( 'Popular', 'ines') ?></h3>

<?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 3"); 
foreach ($result as $post) { 
setup_postdata($post);
$postid = $post->ID; 
$title = $post->post_title; 
$commentcount = $post->comment_count; 
if ($commentcount != 0) { ?> 

<h4><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>">
<?php echo $title ?></a></h4> <?php echo $commentcount ?> <?php _e( 'Comments', 'ines') ?>
<a href="<?php the_permalink() ?>" title="<?php _e( 'Read more', 'ines') ?>" class="read"><?php _e( 'Read on', 'ines') ?> </a>
<?php } } ?>

<?php endif; ?>
</div>

<div class="col6">
<?php if ( !function_exists('dynamic_sidebar')
		        || !dynamic_sidebar('footer-column3') ) : ?>

<h3><?php _e( 'Tags', 'ines') ?></h3>

<?php wp_tag_cloud('smallest=8&largest=22'); ?>

<h3><?php _e( 'Authors', 'ines') ?></h3>

<ul>
<?php wp_list_authors
('exclude_admin=0&show_fullname=1&hide_empty=1&feed_image=' .
get_bloginfo('template_directory') . '/images/feed.gif&feed=XML'); ?>
</ul>

<?php endif; ?>
</div>

<div class="col7">
<?php if ( !function_exists('dynamic_sidebar')
		        || !dynamic_sidebar('footer-column4') ) : ?>

<h3><?php _e( 'Topics', 'ines') ?></h3>
<ul><?php wp_list_categories('orderby=id&show_count=0&sort_column=name&title_li=&depth=-1'); ?></ul>

<?php endif; ?>
</div>

</div>
</div>

<div id="navbarf">
<ul>
<?php wp_list_pages('title_li=&depth=-1'); ?>
</ul>
</div>

<div class="clearfix"></div><hr class="clear" />

<div id="foo">
<div class="fhead">
<h1><a title="<?php _e( 'Get back to the frontpage', 'ines') ?>" href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="des"><?php bloginfo('description'); ?></div>
</div>

<?php get_template_part('members'); ?>
</div>

<div class="credits">

<div class="creditsl">
<?php _e( 'Copyright', 'ines') ?> &copy; <?php echo date("Y"); ?> <?php bloginfo('name'); ?><br />
<a title="<?php _e('Design by milo.'); ?>" href="http://3oneseven.com/"><?php _e('Design by'); ?> milo</a>
</div>

<div class="creditsr">
<p><?php _e( 'Updates via', 'ines') ?> <a href="<?php bloginfo('rss2_url'); ?>" class="rss">RSS</a> <br /><?php _e( 'or', 'ines') ?> 
<a href="<?php bloginfo('rss2_url'); ?>" class="rss"><?php _e( 'Email', 'ines') ?></a></p>
</div>
</div>

<?php do_action('wp_footer'); ?>



</body>
</html>