Advertisement
Guest User

Shawn Moniz

a guest
May 14th, 2010
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.52 KB | None | 0 0
  1. <?php global $comfy; ?>
  2. <div id="sidebar">
  3.  
  4. <?php if (is_page()) : ?>
  5. <?php
  6. $pages = get_pages('child_of='.$post->ID);
  7. if (count($pages) > 0) {
  8. ?>
  9. <ul class="widgets">
  10. <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>
  11. <ul>
  12. <?php
  13. foreach($pages as $child) {
  14. print '<li>';
  15. print '<a href="'.get_permalink($child->ID).'" title="'.$child->post_title.'">';
  16. print $child->post_title;
  17. print '</a>';
  18. print '</li>';
  19. }
  20. ?>
  21. </ul>
  22. <span class="foot"></span></li>
  23. </ul>
  24. <?php
  25. }
  26. ?>
  27. <?php endif; ?>
  28.  
  29. <?php if (is_single()) : ?>
  30.  
  31. <?php global $user_ID; if( $user_ID ) : ?>
  32. <?php if(current_user_can('level_10')) : ?>
  33. <div class="box_a">
  34.  
  35. <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>
  36. <ul class="admin_menu">
  37.  
  38. <li><?php edit_post_link(__('Edit this article','cmfy'), '', ''); ?></li>
  39. <li><strong><?php wp_loginout(); ?></strong></li>
  40.  
  41. </ul>
  42.  
  43. <span class="foot"></span>
  44. </div>
  45. <?php endif; ?>
  46. <?php endif; ?>
  47.  
  48. <div class="box_a">
  49.  
  50. <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>
  51. <div class="autho">
  52.  
  53. <span class="side_avatar"><?php echo get_avatar(get_the_author_email(), '40'); ?></span>
  54. <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>
  55.  
  56. </div>
  57.  
  58. <span class="foot"></span>
  59. </div>
  60.  
  61. <div class="box_a">
  62.  
  63. <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>
  64. <ul class="admin_menu">
  65.  
  66. <?php if (is_single()) : ?><li class="ico_categories"><?php _e('Posted in','cmfy'); ?> <?php the_category(', '); ?></li><?php endif; ?>
  67. <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>
  68. <?php if(function_exists('the_views')) { print '<li class="ico_views"><strong>'; the_views(); print '</strong> '.__('views on this post','cmfy').'</li>'; } ?>
  69. <?php if(function_exists('the_ratings')) { print '<li class="ico_ratings">'.__('User Ratings','cmfy'); the_ratings(); print '</li>'; } ?>
  70. <?php if(function_exists('wp_print')) { print '<li class="ico_print">'; print print_link(); print '</li>'; } ?>
  71.  
  72. </ul>
  73.  
  74. <span class="foot"></span>
  75. </div>
  76.  
  77. <?php endif; ?>
  78.  
  79. <?php if (is_category()) : ?>
  80. <div class="box_a">
  81.  
  82. <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>
  83. <div style="padding:0 0 0 0">
  84.  
  85. <ul id="Ctabs" class="tabs">
  86. <li><a href="#most-viewed" rel="mostv" class="selected"><?php _e('Most Viewed','cmfy'); ?></a></li>
  87. <li><a href="#top-rated" rel="trated"><?php _e('Top Rated','cmfy'); ?></a></li>
  88. <li><a href="#most-rated" rel="mrated"><?php _e('Most Rated','cmfy'); ?></a></li>
  89. </ul><div class="clear"></div>
  90.  
  91. <ul id="mostv" class="tabcontent">
  92. <?php get_most_viewed_category($cat, 'post', 10); ?>
  93. </ul>
  94.  
  95. <ul id="trated" class="tabcontent">
  96. <?php get_highest_rated_category($cat, 'post', 0, 10); ?>
  97. </ul>
  98.  
  99. <ul id="mrated" class="tabcontent">
  100. <?php get_most_rated_category($cat, 'post', 0, 10); ?>
  101. </ul>
  102.  
  103. <script type="text/javascript">
  104. var Ctabs=new ddtabcontent("Ctabs")
  105. Ctabs.setpersist(false)
  106. Ctabs.setselectedClassTarget("link")
  107. Ctabs.init()
  108. </script>
  109.  
  110. </div>
  111.  
  112. <span class="foot"></span>
  113. </div>
  114. <?php endif; ?>
  115.  
  116. <div class="box_a" id="widget_S">
  117.  
  118. <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>
  119. <div>
  120.  
  121. <p><?php _e('Subscribe by <strong>RSS feed</strong> or by <strong>e-mail address</strong> to receive latest news and updates.','cmfy'); ?></p>
  122. <p><a href="<?php bloginfo('rss2_url'); ?>" id="feedlink"><?php _e('Subscribe by RSS feed','cmfy'); ?></a></p>
  123. <form id="feedform" method="post" action="http://feedburner.google.com/fb/a/mailverify?uri=<?php echo $comfy['feed_name']?>">
  124. <fieldset>
  125. <input type="text" id="feedemail" name="email" value="<?php _e('Enter your e-mail...','cmfy'); ?>" />
  126. <input type="hidden" value="<?php echo $comfy['feed_name']?>" name="uri"/>
  127. <input type="hidden" name="loc" value="en_US"/>
  128. <input type="submit" id="feedbutton" value="<?php _e('Sign Up','cmfy'); ?>" />
  129. </fieldset>
  130. </form>
  131.  
  132. </div>
  133.  
  134. <span class="foot"></span>
  135. </div>
  136.  
  137. <?php if (!empty($comfy['adblock2'])) : ?>
  138. <div class="box_a" id="widget_A">
  139.  
  140. <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>
  141. <div>
  142.  
  143. <p class="aligncenter"><?php print stripslashes($comfy['adblock2']); ?></p>
  144.  
  145. </div>
  146.  
  147. <span class="foot"></span>
  148. </div>
  149. <?php endif; ?>
  150.  
  151. <?php if (!is_category() && !is_page()) : ?>
  152. <div class="box_a" id="widget_T">
  153.  
  154. <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>
  155. <div style="padding:0 0 0 0">
  156.  
  157. <ul id="tabs" class="tabs">
  158. <li><a href="#recent-topics" rel="recent" class="selected"><?php _e('Recent Topics','cmfy'); ?></a></li>
  159. <li><a href="#most-viewed" rel="viewed"><?php _e('Most Viewed','cmfy'); ?></a></li>
  160. <li><a href="#most-discussed" rel="discussed"><?php _e('Most Discussed','cmfy'); ?></a></li>
  161. </ul><div class="clear"></div>
  162.  
  163. <ul id="recent" class="tabcontent">
  164. <?php wp_get_archives('type=postbypost&limit='.$comfy['recent_num'].'&format=html'); ?>
  165. </ul>
  166.  
  167. <ul id="viewed" class="tabcontent">
  168. <?php if (function_exists('get_most_viewed')): ?>
  169. <?php get_most_viewed('post', $comfy['viewed_num']); ?>
  170. <?php endif; ?>
  171. </ul>
  172.  
  173. <ul id="discussed" class="tabcontent">
  174. <?php
  175. $now = gmdate("Y-m-d H:i:s",time());
  176. $ap = $comfy['discussed_num'];
  177. $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";
  178. $posts = $wpdb->get_results($popularposts);
  179. $popular = '';
  180. if($posts){
  181. foreach($posts as $post){
  182. $post_title = stripslashes($post->post_title);
  183. $post_date = stripslashes($post->post_date);
  184. $comments = stripslashes($post->comment_count);
  185. $guid = get_permalink($post->ID);
  186. $popular .= '<li><a href="'.$guid.'#comments" title="'.$post_title.'">'.$post_title.' <span>'.sprintf(__('discussed %s times','cmfy'), $comments).'</span></a></li>';
  187. }
  188. }echo $popular;
  189. ?>
  190. </ul>
  191.  
  192. <script type="text/javascript">
  193. var tabs=new ddtabcontent("tabs")
  194. tabs.setpersist(false)
  195. tabs.setselectedClassTarget("link")
  196. tabs.init()
  197. </script>
  198.  
  199. </div>
  200.  
  201. <span class="foot"></span>
  202. </div>
  203. <?php endif; ?>
  204.  
  205. <?php if ($comfy['videose'] == true) : ?>
  206. <?php $videos = new WP_query(); $videos->query('showposts=1&cat='.$comfy['videos']); ?>
  207. <?php global $wp_query; $wp_query->in_the_loop = true; ?>
  208. <?php if ($videos->have_posts()) : ?>
  209.  
  210. <div class="box_a" id="widget_V">
  211.  
  212. <?php while ($videos->have_posts()) : $videos->the_post(); ?>
  213. <h2><?php the_title(); ?><a href="#minimize" class="Sminimize"></a><?php if ($comfy['closewidget'] == 1) : ?><a href="#close" class="Sclose"></a><?php endif; ?></h2>
  214. <div>
  215. <?php show_video(304,204); ?>
  216. <p><a href="<?php print get_category_link($comfy['videos']); ?>"><strong><?php _e('See all videos','cmfy'); ?></strong></a></p>
  217. </div>
  218. <?php endwhile; ?>
  219.  
  220. <span class="foot"></span>
  221. </div>
  222.  
  223. <?php endif; ?>
  224. <?php endif; ?>
  225.  
  226. <ul class="widgets">
  227. <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
  228.  
  229. <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>
  230. <ul><?php wp_get_archives('type=postbypost&limit=5'); ?></ul>
  231. <span class="foot"></span></li>
  232.  
  233. <?php endif; ?>
  234. </ul>
  235.  
  236. <div class="clear"></div>
  237.  
  238. <ul class="widgetsl">
  239. <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
  240.  
  241. <li><h2><?php _e('Popular Tags','cmfy'); ?></h2>
  242. <ul><li><?php wp_tag_cloud('smallest=8&largest=22&number=22'); ?></li></ul>
  243. <span class="foot_s"></span></li>
  244.  
  245. <?php endif; ?>
  246. </ul>
  247.  
  248. <ul class="widgetsr">
  249. <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(3) ) : else : ?>
  250.  
  251. <li><h2><?php _e('Archives','cmfy'); ?></h2>
  252. <ul><?php wp_get_archives('type=monthly&limit=12'); ?></ul>
  253. <span class="foot_s"></span></li>
  254.  
  255. <?php endif; ?>
  256. </ul>
  257.  
  258. <div class="clear"></div>
  259.  
  260. </div><div class="clear"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement