Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php global $comfy; ?>
- <div id="sidebar">
- <?php if (is_page()) : ?>
- <?php
- $pages = get_pages('child_of='.$post->ID);
- if (count($pages) > 0) {
- ?>
- <ul class="widgets">
- <li><h2><?php _e('Subpages','cmfy'); ?><a href="#minimize" class="Wminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Wclose"></a><?php endif; ?></h2>
- <ul>
- <?php
- foreach($pages as $child) {
- print '<li>';
- print '<a href="'.get_permalink($child->ID).'" title="'.$child->post_title.'">';
- print $child->post_title;
- print '</a>';
- print '</li>';
- }
- ?>
- </ul>
- <span class="foot"></span></li>
- </ul>
- <?php
- }
- ?>
- <?php endif; ?>
- <?php if (is_single()) : ?>
- <?php global $user_ID; if( $user_ID ) : ?>
- <?php if(current_user_can('level_10')) : ?>
- <div class="box_a">
- <h2><?php _e('Site Admin','cmfy'); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <ul class="admin_menu">
- <li><?php edit_post_link(__('Edit this article','cmfy'), '', ''); ?></li>
- <li><strong><?php wp_loginout(); ?></strong></li>
- </ul>
- <span class="foot"></span>
- </div>
- <?php endif; ?>
- <?php endif; ?>
- <div class="box_a">
- <h2><?php _e('The Author','cmfy'); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <div class="autho">
- <span class="side_avatar"><?php echo get_avatar(get_the_author_email(), '40'); ?></span>
- <p><?php printf(__('This post was written by <strong>%1$s</strong> on %2$s. This author has written <strong>%3$s posts</strong> on this blog.','cmfy'), get_the_author(), get_the_time('l, F j, Y, G:i'), get_the_author_posts()); ?></p>
- </div>
- <span class="foot"></span>
- </div>
- <div class="box_a">
- <h2><?php _e('Information','cmfy'); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <ul class="admin_menu">
- <?php if (is_single()) : ?><li class="ico_categories"><?php _e('Posted in','cmfy'); ?> <?php the_category(', '); ?></li><?php endif; ?>
- <li class="ico_comments"><?php _e('This post has','cmfy'); ?> <?php comments_number(__('<em>no comments yet</em>','cmfy'), __('<a href="#comments"><strong>1 Comment</strong></a>','cmfy'), __('<a href="#comments"><strong>% Comments</strong></a>','cmfy')); ?>. <?php _e('<a href="#respond"><strong>Write</strong></a> your own comment.','cmfy'); ?></li>
- <?php if(function_exists('the_views')) { print '<li class="ico_views"><strong>'; the_views(); print '</strong> '.__('views on this post','cmfy').'</li>'; } ?>
- <?php if(function_exists('the_ratings')) { print '<li class="ico_ratings">'.__('User Ratings','cmfy'); the_ratings(); print '</li>'; } ?>
- <?php if(function_exists('wp_print')) { print '<li class="ico_print">'; print print_link(); print '</li>'; } ?>
- </ul>
- <span class="foot"></span>
- </div>
- <?php endif; ?>
- <?php if (is_category()) : ?>
- <div class="box_a">
- <h2><?php _e('Hot topics in','cmfy'); ?> <?php print get_cat_name($cat); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <div style="padding:0 0 0 0">
- <ul id="Ctabs" class="tabs">
- <li><a href="#most-viewed" rel="mostv" class="selected"><?php _e('Most Viewed','cmfy'); ?></a></li>
- <li><a href="#top-rated" rel="trated"><?php _e('Top Rated','cmfy'); ?></a></li>
- <li><a href="#most-rated" rel="mrated"><?php _e('Most Rated','cmfy'); ?></a></li>
- </ul><div class="clear"></div>
- <ul id="mostv" class="tabcontent">
- <?php get_most_viewed_category($cat, 'post', 10); ?>
- </ul>
- <ul id="trated" class="tabcontent">
- <?php get_highest_rated_category($cat, 'post', 0, 10); ?>
- </ul>
- <ul id="mrated" class="tabcontent">
- <?php get_most_rated_category($cat, 'post', 0, 10); ?>
- </ul>
- <script type="text/javascript">
- var Ctabs=new ddtabcontent("Ctabs")
- Ctabs.setpersist(false)
- Ctabs.setselectedClassTarget("link")
- Ctabs.init()
- </script>
- </div>
- <span class="foot"></span>
- </div>
- <?php endif; ?>
- <div class="box_a" id="widget_S">
- <h2><?php _e('Subscription','cmfy'); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <div>
- <p><?php _e('Subscribe by <strong>RSS feed</strong> or by <strong>e-mail address</strong> to receive latest news and updates.','cmfy'); ?></p>
- <p><a href="<?php bloginfo('rss2_url'); ?>" id="feedlink"><?php _e('Subscribe by RSS feed','cmfy'); ?></a></p>
- <form id="feedform" method="post" action="http://feedburner.google.com/fb/a/mailverify?uri=<?php echo $comfy['feed_name']?>">
- <fieldset>
- <input type="text" id="feedemail" name="email" value="<?php _e('Enter your e-mail...','cmfy'); ?>" />
- <input type="hidden" value="<?php echo $comfy['feed_name']?>" name="uri"/>
- <input type="hidden" name="loc" value="en_US"/>
- <input type="submit" id="feedbutton" value="<?php _e('Sign Up','cmfy'); ?>" />
- </fieldset>
- </form>
- </div>
- <span class="foot"></span>
- </div>
- <?php if (!empty($comfy['adblock2'])) : ?>
- <div class="box_a" id="widget_A">
- <h2><?php _e('Advertisement','cmfy'); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <div>
- <p class="aligncenter"><?php print stripslashes($comfy['adblock2']); ?></p>
- </div>
- <span class="foot"></span>
- </div>
- <?php endif; ?>
- <?php if (!is_category() && !is_page()) : ?>
- <div class="box_a" id="widget_T">
- <h2><?php _e('Hot topics','cmfy'); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <div style="padding:0 0 0 0">
- <ul id="tabs" class="tabs">
- <li><a href="#recent-topics" rel="recent" class="selected"><?php _e('Recent Topics','cmfy'); ?></a></li>
- <li><a href="#most-viewed" rel="viewed"><?php _e('Most Viewed','cmfy'); ?></a></li>
- <li><a href="#most-discussed" rel="discussed"><?php _e('Most Discussed','cmfy'); ?></a></li>
- </ul><div class="clear"></div>
- <ul id="recent" class="tabcontent">
- <?php wp_get_archives('type=postbypost&limit='.$comfy['recent_num'].'&format=html'); ?>
- </ul>
- <ul id="viewed" class="tabcontent">
- <?php if (function_exists('get_most_viewed')): ?>
- <?php get_most_viewed('post', $comfy['viewed_num']); ?>
- <?php endif; ?>
- </ul>
- <ul id="discussed" class="tabcontent">
- <?php
- $now = gmdate("Y-m-d H:i:s",time());
- $ap = $comfy['discussed_num'];
- $popularposts = "SELECT ID, post_title, post_date, comment_count, COUNT($wpdb->comments.comment_post_ID) AS 'popular' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND post_date < '$now' AND comment_status = 'open' GROUP BY $wpdb->comments.comment_post_ID ORDER BY popular DESC LIMIT $ap";
- $posts = $wpdb->get_results($popularposts);
- $popular = '';
- if($posts){
- foreach($posts as $post){
- $post_title = stripslashes($post->post_title);
- $post_date = stripslashes($post->post_date);
- $comments = stripslashes($post->comment_count);
- $guid = get_permalink($post->ID);
- $popular .= '<li><a href="'.$guid.'#comments" title="'.$post_title.'">'.$post_title.' <span>'.sprintf(__('discussed %s times','cmfy'), $comments).'</span></a></li>';
- }
- }echo $popular;
- ?>
- </ul>
- <script type="text/javascript">
- var tabs=new ddtabcontent("tabs")
- tabs.setpersist(false)
- tabs.setselectedClassTarget("link")
- tabs.init()
- </script>
- </div>
- <span class="foot"></span>
- </div>
- <?php endif; ?>
- <?php if ($comfy['videose'] == true) : ?>
- <?php $videos = new WP_query(); $videos->query('showposts=1&cat='.$comfy['videos']); ?>
- <?php global $wp_query; $wp_query->in_the_loop = true; ?>
- <?php if ($videos->have_posts()) : ?>
- <div class="box_a" id="widget_V">
- <?php while ($videos->have_posts()) : $videos->the_post(); ?>
- <h2><?php the_title(); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
- <div>
- <?php show_video(304,204); ?>
- <p><a href="<?php print get_category_link($comfy['videos']); ?>"><strong><?php _e('See all videos','cmfy'); ?></strong></a></p>
- </div>
- <?php endwhile; ?>
- <span class="foot"></span>
- </div>
- <?php endif; ?>
- <?php endif; ?>
- <ul class="widgets">
- <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
- <li><h2><?php _e('Recent Posts','cmfy'); ?><a href="#minimize" class="Wminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Wclose"></a><?php endif; ?></h2>
- <ul><?php wp_get_archives('type=postbypost&limit=5'); ?></ul>
- <span class="foot"></span></li>
- <?php endif; ?>
- </ul>
- <div class="clear"></div>
- <ul class="widgetsl">
- <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
- <li><h2><?php _e('Popular Tags','cmfy'); ?></h2>
- <ul><li><?php wp_tag_cloud('smallest=8&largest=22&number=22'); ?></li></ul>
- <span class="foot_s"></span></li>
- <?php endif; ?>
- </ul>
- <ul class="widgetsr">
- <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(3) ) : else : ?>
- <li><h2><?php _e('Archives','cmfy'); ?></h2>
- <ul><?php wp_get_archives('type=monthly&limit=12'); ?></ul>
- <span class="foot_s"></span></li>
- <?php endif; ?>
- </ul>
- <div class="clear"></div>
- </div><div class="clear"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement