Advertisement
Guest User

whatthefuckdoidowithallthisshit

a guest
Apr 30th, 2010
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. <div id="primary" class="sidebar">
  2. <ul>
  3. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : // Begin Widgets for Sidebar 1; displays widgets or default contents below ?>
  4.  
  5. <?php global $wpdb, $r; $r = new WP_Query("showposts=5"); if ($r->have_posts()) : // Custom recent posts for Simplr ?>
  6. <li id="simplr-recent-entries">
  7. <h3><?php _e('Recent Entries', 'simplr') ?></h3>
  8. <ul><?php while ($r->have_posts()) : $r->the_post(); ?>
  9.  
  10. <li class="hentry" onclick="location.href='<?php the_permalink() ?>';">
  11. <span class="entry-title"><a href="<?php the_permalink() ?>" title="Continue reading <?php get_the_title(); the_title(); ?>" rel="bookmark"><?php get_the_title(); the_title(); ?></a></span>
  12. <span class="entry-summary"><?php the_content_rss('', TRUE, '', 10); ?></span>
  13. <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s', 'simplr'), the_date('F jS, Y', false)) ?></abbr></span>
  14. <span class="entry-comments"><?php comments_popup_link(__('No comments', 'simplr'), __('One comment', 'simplr'), __('% comments', 'simplr')) ?></span>
  15. </li>
  16. <?php endwhile; ?>
  17.  
  18. </ul>
  19. </li>
  20. <?php endif; ?>
  21.  
  22. <?php global $wpdb, $comments, $comment; // Custom recent comments for Simplr
  23. $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, SUBSTRING(comment_content,1,65) AS comment_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"); ?>
  24. <li id="simplr-recent-comments">
  25. <h3><?php _e('Recent Comments', 'simplr') ?></h3>
  26. <ul id="recentcomments"><?php
  27. if ( $comments ) : foreach ($comments as $comment) :
  28. echo '<li class="recentcomments" onclick="location.href=\''. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '\';">' . sprintf(__('<span class="comment-author vcard"><span class="fn n">%1$s</span> wrote:</span> <span class="comment-summary">%2$s ...</span> <span class="comment-entry">On %3$s</span>'),
  29. get_comment_author_link(),
  30. strip_tags($comment->comment_excerpt),
  31. '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '" title="">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
  32. endforeach; endif; ?></ul>
  33. </li>
  34. <?php endif; // End Widgets ?>
  35.  
  36. </ul>
  37. </div><!-- #primary .sidebar -->
  38.  
  39. <div id="secondary" class="sidebar">
  40. <ul>
  41. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : // Begin Widgets for Sidebar 2; displays widgets or default contents below ?>
  42. <li id="search">
  43. <h3><label for="s"><?php _e('Search', 'simplr') ?></label></h3>
  44. <form id="searchform" method="get" action="<?php bloginfo('home') ?>">
  45. <div>
  46. <input id="s" name="s" type="text" value="<?php the_search_query() ?>" size="10" />
  47. <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'simplr') ?>" />
  48. </div>
  49. </form>
  50. </li>
  51. <li id="categories">
  52. <h3><?php _e('Categories', 'simplr'); ?></h3>
  53. <ul>
  54. <?php wp_list_categories('title_li=&orderby=name&use_desc_for_title=1&hierarchical=0') ?>
  55.  
  56. </ul>
  57. </li>
  58. <li id="tag-cloud">
  59. <h3><?php _e('Tags', 'simplr'); ?></h3>
  60. <p><?php wp_tag_cloud() ?></p>
  61. </li>
  62. <li id="archives">
  63. <h3><?php _e('Archives', 'simplr') ?></h3>
  64. <ul>
  65. <?php wp_get_archives('type=monthly') ?>
  66.  
  67. </ul>
  68. </li>
  69. <li id="simplr-rss-links">
  70. <h3><?php _e('RSS Feeds', 'simplr') ?></h3>
  71. <ul>
  72. <li><a href="<?php bloginfo('rss2_url') ?>" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> RSS 2.0 Feed" rel="alternate" type="application/rss+xml"><?php _e('All posts', 'simplr') ?></a></li>
  73. <li><a href="<?php bloginfo('comments_rss2_url') ?>" title="<?php echo wp_specialchars(bloginfo('name'), 1) ?> Comments RSS 2.0 Feed" rel="alternate" type="application/rss+xml"><?php _e('All comments', 'simplr') ?></a></li>
  74. </ul>
  75. </li>
  76. <?php if ( is_home() || is_paged() ) { ?>
  77. <li id="meta">
  78. <h3><?php _e('Meta', 'simplr') ?></h3>
  79. <ul>
  80. <?php wp_register() ?>
  81. <li><?php wp_loginout() ?></li>
  82. <?php wp_meta() // Do not remove; helps plugins work ?>
  83. </ul>
  84. </li>
  85. <?php } ?>
  86. <?php endif; // End Widgets ?>
  87.  
  88. </ul>
  89. </div><!-- #primary .sidebar -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement