function widget($args, $instance) { extract($args); /* Before widget (defined by themes). */ echo $before_widget; ?> <div id="widget-tabs"> <ul class="tabs clearfix"> <li><a href="#tabs-popular"><?php _e("Popular", "solostream"); ?> <span></span></a></li> <li><a href="#tabs-recent"><?php _e("Recent", "solostream"); ?> <span></span></a></li> <li><a href="#tabs-comments"><?php _e("Comments", "solostream"); ?> <span></span></a></li> <li><a href="#tabs-archives"><?php _e("Archives", "solostream"); ?> <span></span></a></li> </ul> <div style="clear:both;"></div> <div id="tabs-popular" class="cat_content clearfix"> <?php if (function_exists('get_mostpopular')) { ?> <div class="popular"><?php get_mostpopular("range=weekly&limit=5&order_by=avg&stats_comments=0&pages=0"); ?> </div> <?php } else { ?> <ul><li><?php _e("This feature has not been activated yet.", "solostream"); ?> </li></ul> <?php } ?> </div> <div id="tabs-recent" class="cat_content clearfix"> <ul> <?php $numposts = 5; $my_query = new WP_Query(array('showposts' => $numposts)); while ($my_query->have_posts()) { $my_query->the_post(); ?> <li> <a href="<?php the_permalink(); ?> " rel="<?php _e("bookmark"); ?> " title="<?php _e("Permanent Link to"); ?> <?php the_title(); ?> "><?php the_title(); ?> </a> </li> <?php } ?> </ul> </div> <div id="tabs-comments" class="cat_content clearfix side-recent-comments"> <?php $pre_HTML = ""; $post_HTML = ""; 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,100) 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 5"; $comments = $wpdb->get_results($sql); $output = $pre_HTML; $output .= "\n<ul>"; foreach ($comments as $comment) { $output .= "\n<li><a href=\"" . get_permalink($comment->ID) . "#comment-" . $comment->comment_ID . "\" title=\"on " . $comment->post_title . "\">" . strip_tags($comment->comment_author) . ": " . strip_tags($comment->com_excerpt) . "</a></li>"; } $output .= "\n</ul>"; $output .= $post_HTML; echo $output; ?> </div> <div id="tabs-archives" class="cat_content clearfix"> <ul class="side-arc"> <li class="clearfix"> <p class="title"><?php _e("Archives", "solostream"); ?> :</p> <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(__('Select Month', 'solostream')); ?> </option> <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select> <noscript><input type="submit" value="<?php _e("Go", "solostream"); ?> " /></noscript> </li> <li class="clearfix"> <p class="title"><?php _e("Categories", "solostream"); ?> :</p> <form action="<?php bloginfo('url'); ?> /" method="get"> <?php $select = wp_dropdown_categories('show_option_none=' . __('Select Category', 'solostream') . '&show_count=1&orderby=name&echo=0&hierarchical=1'); $select = preg_replace("#<select([^>]*)>#", "<select\$1 onchange='return this.form.submit()'>", $select); echo $select; ?> <noscript><input type="submit" value="<?php _e("Go", "solostream"); ?> " /></noscript> </form> </li> <li class="clearfix"> <p class="title"><?php _e("Tags", "solostream"); ?> :</p> <select name="tag-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(__('Select a Tag', 'solostream')); ?> </option> <?php $posttags = get_tags('orderby=count&order=DESC&number=200'); ?> <?php if ($posttags) { foreach ($posttags as $tag) { echo "<option value='"; echo get_tag_link($tag); echo "'>"; echo $tag->name; echo " ("; echo $tag->count; echo ")"; echo "</option>"; } } ?> </select> <noscript><input type="submit" value="<?php _e("Go", "solostream"); ?> " /></noscript> </li> </ul> </div> </div> <?php /* After widget (defined by themes). */ echo $after_widget; }
if (function_exists('src_simple_recent_comments')) { src_simple_recent_comments(10, 60, '', ''); } ?> </div> </div> <!-- <div style="display: block;" id="content1"> <div class="toptabs"> <div class="tab1"><a href="javascript: swapPanel('content1')">Most Read</a></div> <div class="tab2"><a href="javascript: swapPanel('content2')">Latest Comments</a></div> </div> <div class="top_border"></div> <div class="caseText"> <?php if (function_exists('get_mostpopular')) { get_mostpopular(); } ?> </div> </div> <div style="display: none;" id="content2"> <div class="toptabs"> <div class="tab1"><a href="javascript: swapPanel('content1')">Most Read</a></div> <div class="tab2"><a href="javascript: swapPanel('content2')">Latest Comments</a></div> </div> <div class="top_border"></div> <div class="caseText"> <?php if (function_exists('src_simple_recent_comments')) { src_simple_recent_comments(10, 60, '', '');
_e("Archives", "solostream"); ?> <span></span></a></li> </ul> <div id="flextabs" class="flextabs clearfix"> <ul class="slides clearfix"> <!-- POPULAR POSTS SLIDE --> <li class="popular-slide clearfix"> <?php if (function_exists('get_mostpopular')) { ?> <?php get_mostpopular(array("range" => "weekly", "post_type" => "post", "limit" => "5", "order_by" => "avg", "thumbnail_width" => "100", "thumbnail_height" => "100", "excerpt_length" => "100", "post_start" => "<li><div class='pop-excerpt'>", "post_end" => "</div></li>", "do_pattern" => "1", "pattern_form" => "{image} {title}<br />{summary}", "post_html" => "<li><div class='pop-excerpt'>{image} {title}<br />{summary}</div></li>")); ?> <?php } else { ?> <ul><li><?php _e("This feature has not been activated yet.", "solostream"); ?> </li></ul> <?php } ?> </li> <!-- RECENT POSTS SLIDE --> <li class="recent-slide clearfix">
function widget($args, $instance) { extract($args); /* Before widget (defined by themes). */ echo $before_widget; ?> <div id="widget-tabs"> <ul class="tabs clearfix"> <li><a href="#tabs-popular"><?php _e("Popular", "solostream"); ?> <span></span></a></li> <li><a href="#tabs-recent"><?php _e("Recent", "solostream"); ?> <span></span></a></li> <li><a href="#tabs-comments"><?php _e("Comments", "solostream"); ?> <span></span></a></li> <li><a href="#tabs-archives"><?php _e("Archives", "solostream"); ?> <span></span></a></li> </ul> <div style="clear:both;"></div> <div id="tabs-popular" class="cat_content clearfix"> <?php if (function_exists('get_mostpopular')) { ?> <div class="popular"> <?php get_mostpopular(array("range" => "weekly", "post_type" => "post", "limit" => "3", "order_by" => "avg", "thumbnail_width" => "76", "thumbnail_height" => "76", "excerpt_length" => "100", "post_start" => "<li><div class='pop-excerpt'>", "post_end" => "</div></li>", "do_pattern" => "1", "pattern_form" => "{image} {title}<br />{meta}", "post_html" => "<li><div class='pop-excerpt'>{image} {title}<br />{meta}</div></li>")); ?> </div> <?php } else { ?> <ul><li><?php _e("This feature has not been activated yet.", "solostream"); ?> </li></ul> <?php } ?> </div> <div id="tabs-recent" class="cat_content clearfix"> <ul> <?php $numposts = 3; $my_query = new WP_Query(array('showposts' => $numposts)); while ($my_query->have_posts()) { $my_query->the_post(); ?> <li> <div class="pop-excerpt"> <a href="<?php the_permalink(); ?> " rel="<?php _e("bookmark", "solostream"); ?> " title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?> "><?php solostream_thumbnail(); ?> </a> <a href="<?php the_permalink(); ?> " rel="<?php _e("bookmark"); ?> " title="<?php _e("Permanent Link to"); ?> <?php the_title(); ?> "><?php the_title(); ?> </a> <?php get_template_part('postinfo'); ?> </div> </li> <?php } ?> </ul> </div> <div id="tabs-comments" class="cat_content clearfix side-recent-comments"> <?php $comments = get_comments(array('status' => 'approve', 'number' => '5')); $output = "\n<ul>"; foreach ($comments as $comment) { $comment_text = strip_tags($comment->comment_content); $num_words = 3; $blah = explode(' ', $comment_text); if (count($blah) > $num_words) { $k = $num_words; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } $excerpt = ''; for ($i = 0; $i < $k; $i++) { $excerpt .= $blah[$i] . ' '; } $excerpt .= $use_dotdotdot ? '[...]' : ''; $output .= "\n<li><div class='pop-excerpt'>" . get_avatar($comment, '72') . strip_tags($comment->comment_author) . "<br /><a href=\"" . get_permalink($comment->comment_post_ID) . "#comment-" . $comment->comment_ID . "\">" . strip_tags($excerpt) . "</a></div></li>"; } $output .= "\n</ul>"; echo $output; ?> </div> <div id="tabs-archives" class="cat_content clearfix"> <ul class="side-arc"> <li class="clearfix"> <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(__('Select a Month', 'solostream')); ?> </option> <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select> <noscript><input type="submit" value="<?php _e("Go", "solostream"); ?> " /></noscript> </li> <li class="clearfix"> <form action="<?php bloginfo('url'); ?> /" method="get"> <?php $select = wp_dropdown_categories('show_option_none=' . __('Select a Category', 'solostream') . '&show_count=1&orderby=name&echo=0&hierarchical=1&id=catdrop'); $select = preg_replace("#<select([^>]*)>#", "<select\$1 onchange='return this.form.submit()'>", $select); echo $select; ?> <noscript><input type="submit" value="<?php _e("Go", "solostream"); ?> " /></noscript> </form> </li> <li class="clearfix"> <select name="tag-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(__('Select a Tag', 'solostream')); ?> </option> <?php $posttags = get_tags('orderby=count&order=DESC&number=200'); ?> <?php if ($posttags) { foreach ($posttags as $tag) { echo "<option value='"; echo get_tag_link($tag); echo "'>"; echo $tag->name; echo " ("; echo $tag->count; echo ")"; echo "</option>"; } } ?> </select> <noscript><input type="submit" value="<?php _e("Go", "solostream"); ?> " /></noscript> </li> </ul> </div> </div> <?php /* After widget (defined by themes). */ echo $after_widget; }