sidebar.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. </div><!--content end-->
  2. <div id="sidebar">
  3. <?php
  4. $options = get_option('philna_options');
  5. if( $options['showcase_content'] && (
  6. ($options['showcase_registered'] && $user_ID) ||
  7. ($options['showcase_commentator'] && !$user_ID && isset($_COOKIE['comment_author_'.COOKIEHASH])) ||
  8. ($options['showcase_visitor'] && !$user_ID && !isset($_COOKIE['comment_author_'.COOKIEHASH]))
  9. ) ) :
  10. ?>
  11. <?php if(!is_bot()):?>
  12. <div class="sidebar-top sidebar_notice">
  13. <?php if($options['showcase_caption']) : ?>
  14. <?php if($options['showcase_title']){ echo "<h3>";echo($options['showcase_title']);echo "</h3>";}?>
  15. <?php endif; ?>
  16. <div id="sidebar_notice">
  17. <?php echo($options['showcase_content']); ?>
  18. </div>
  19. </div>
  20. <?endif;?>
  21. <?endif;?>
  22. <div class="sidebar-top widget_ posts">
  23. <!-- posts -->
  24. <?php
  25. if (is_single()) {
  26. $posts_widget_title =_e('<h3>Recent Posts</h3>','philna');
  27. } else {
  28. $posts_widget_title =_e('<h3>Random Posts</h3>','philna');
  29. }
  30. ?>
  31. <?php echo $posts_widget_title; ?>
  32. <ul>
  33. <?php
  34. if (is_single()) {
  35. $posts = get_posts('numberposts=5&orderby=post_date');
  36. } else {
  37. $posts = get_posts('numberposts=5&orderby=rand');
  38. }
  39. foreach($posts as $post) {
  40. setup_postdata($post);
  41. echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
  42. }
  43. $post = $posts[0];
  44. ?>
  45. </ul>
  46. </div>
  47. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('north_sidebar')):?>
  48. <?php if(!is_home()):?>
  49. <?php if (function_exists('yinheli_most_commented')) : ?>
  50. <div class="widget">
  51. <h3><?php _e('Most commented','philna')?></h3>
  52. <ul id="yinheli_most_commented">
  53. <?php yinheli_most_commented(8,30);?>
  54. </ul>
  55. </div>
  56. <?php endif;?>
  57. <?php endif;?>
  58. <div class="widget">
  59. <h3><?php _e('Recent Comments','philna')?></h3>
  60. <?php if(function_exists('wp_recentcomments')) :?>
  61. <ul id="recentcomments">
  62. <?php wp_recentcomments('limit=8&length=16&post=false&smilies=true&trackback=false'); ?>
  63. </ul>
  64. <?php else:?>
  65. <?php if(function_exists('yinheli_recentcomments')) :?>
  66. <ul id="yinheli_recentcomments">
  67. <?php yinheli_recentcomments();?>
  68. </ul>
  69. <?php endif; endif;?>
  70. </div>
  71. <?php endif;//north_sidebar?>
  72. <div class="widget">
  73. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('east_sidebar')):?>
  74. <div class="widget_right">
  75. <h3><?php _e('Categories','philna')?></h3>
  76. <ul>
  77. <?php wp_list_categories('orderby=name&show_count=0&depth=1&title_li='); ?>
  78. </ul>
  79. </div>
  80. <?php endif;//east_sidebar?>
  81. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('west_sidebar')):?>
  82. <div class="widget_left">
  83. <h3><?php _e('Archives','philna')?></h3>
  84. <ul>
  85. <?php wp_get_archives('type=monthly'); ?>
  86. </ul>
  87. </div>
  88. <?php endif;//west_sidebar?>
  89. <div class="fixed"></div>
  90. </div>
  91. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('south_sidebar')):?>
  92. <div class="widget widget_tag_cloud">
  93. <h3><?php _e('Tag Cloud','philna')?></h3>
  94. <?php wp_tag_cloud('smallest=10&largest=16'); ?>
  95. </div>
  96. <?php if(is_home() && is_first_page()):?>
  97. <div class="widget">
  98. <h3>Links</h3>
  99. <ul id="widget-links">
  100. <?php wp_list_bookmarks('title_li=&categorize=0&orderby=rand&limit=8'); ?>
  101. </ul>
  102. <div class="fixed"></div>
  103. </div>
  104. <?php endif;?>
  105. <div class="widget">
  106. <h3><?php _e('Meta','philna')?></h3>
  107. <ul>
  108. <?php wp_register(); ?>
  109. <li><?php wp_loginout(); ?></li>
  110. </ul>
  111. </div>
  112. <?php endif;//south_sidebar?>
  113. </div>