<?php
/**
 * @package WordPress
 * @subpackage Classic_Theme
 */
?>
<div class="footer-sidebar-wrap"><div class="footer-sidebar-top"><div class="footer-sidebar-bottom clearfix">
		<div class="footer-sidebar">
						<ul>
							<li class="footer_li1">
								<ul>
								<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer1') ) : ?>
									<li class="footer_about">
										<h2><?php echo wpthemes_options('about_us') ; ?></h2>
										<div><?php echo wpthemes_options('about_text') ; ?><div>
									</li>
								<?php endif; ?>
								</ul>
							</li>
							
							<li class="footer_li2">
								<ul>
									<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer2') ) : ?>
										<li>
											<h2>Recent comments</h2>
											<?php
												global $wpdb;
												$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
												comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved,
												comment_type,comment_author_url,
												SUBSTRING(comment_content,1,30) AS com_excerpt
												FROM $wpdb->comments
												LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
												$wpdb->posts.ID)
												WHERE comment_approved = '1' AND comment_type = '' AND
												post_password = ''
												ORDER BY comment_date_gmt DESC
												LIMIT 3";
												$comments = $wpdb->get_results($sql);
												$output = $pre_HTML;
												
												foreach ($comments as $comment) {
												$comment_avatar=get_avatar($comment->comment_author_email,32);
												$output .= "\n<div class='footer_sidebar_entry clearfix'><div class='thumbnail wp-post-image'><a href=\"" . get_permalink($comment->ID) .
												"#comment-" . $comment->comment_ID . "\" title=\"on " .
												$comment->post_title . "\">" . $comment_avatar. "</a></div><h3 class='title'><a href=\"" . get_permalink($comment->ID) .
												"#comment-" . $comment->comment_ID . "\" title=\"on " .
												$comment->post_title . "\">" . strip_tags($comment->com_excerpt)
												."</a></h3>" . " <span class='footer_sidebar_date'>" . $comment->comment_date_gmt . "</span></div>";
												}
												
												$output .= $post_HTML;
												echo '<div class="sidebar-cat">' . $output . '</div>';?>
										</li>
									<?php endif; ?>
								</ul>
							</li>

							<li class="footer_li3">
								<ul>
									<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer3') ) : ?>
										<?php wp_list_pages('title_li=<h2>' . __('Pages') . '</h2>' ); ?>
									<?php endif; ?>
								</ul>
							</li>
							<li class="footer_li4">
								<ul>
									<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer4') ) : ?>
										<li>
											<h2>Blogroll</h2>
											<ul class="blogroll">
												<?php wp_list_bookmarks("title_li=&categorize=0"); ?>
											</ul>
										</li>
									<?php endif; ?>
								</ul>
							</li>
						</ul>
</div></div></div></div>
<div id="footer-wrap">
	<div id="footer">
		<div class="credit">
        
        <?php // Our theme is licensed under Creative Commons Licence. http://creativecommons.org/licenses/by/3.0/
				// You are not allowed to remove or edit our family friendly links without permission.
				// We appreciate your help in making this site the best FREE High-Quality Themes for you. ?>
        
			Copyright &copy; 2011 <a href="http://www.wpthemepremium.com/">Wpthemepremium .com</a>. All rights reserved.
				<?php // This theme is licensed under CC3.0, you are not allowed to modify/remove our link without permission.
				// Please make sure that you keep all credit links intact. Thank you for supporting us making more FREE creative themes.?>
            <div class="credit_t">Designed by <a href="http://mssharepointhosting.com/sharepoint-site/">SharePoint Site</a> and <a href="http://virtualdesktoponline.com/vdi/">Virtual Desktop Infrastructure</a>, <a href="http://projectserverhosting.com/enterprise-project-management/">Enterprise Project Management</a>, <a href="http://businessemailhosting.com/exchange-hosting/">Exchange Hosting</a>.
		</div>
		<?php 
		if(wpthemes_options('footer_code') != '') {
		echo wpthemes_options("footer_code")  . "\n"; 
		}
		?>
		<?php wp_footer(); ?>
	</div>
</div>
</div>
</body>
</html>
