'sidebar', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); register_sidebar(array('name'=>'bottom', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); /* loads legacy.comments.php as comment file when using a Wordpress version pre-2.7 */ add_filter( 'comments_template', 'legacy_comments' ); function legacy_comments( $file ) { if ( !function_exists('wp_list_comments') ) $file = TEMPLATEPATH . '/legacy.comments.php'; return $file; } /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Plugin Name: WP-PageNavi Plugin URI: http://www.lesterchan.net/portfolio/programming.php */ function wp_pagenavi($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) { global $request, $posts_per_page, $wpdb, $paged; if(empty($prelabel)) { $prelabel = '« Previous'; } if(empty($nxtlabel)) { $nxtlabel = 'Next »'; } $half_pages_to_show = round($pages_to_show/2); if (!is_single()) { if(!is_category()) { preg_match('#FROM\s(.*)\sORDER BY#siU', $request, $matches); } else { preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches); } $fromwhere = $matches[1]; $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); $max_page = ceil($numposts /$posts_per_page); if(empty($paged)) { $paged = 1; } if($max_page > 1 || $always_show) { echo "$before $after"; } } } /* Plugin Name: Recent Comments Plugin URI: http://mtdewvirus.com/code/wordpress-plugins/ */ function dp_recent_comments($no_comments = 10, $comment_len = 43) { global $wpdb; $request = "SELECT * FROM $wpdb->comments"; $request .= " JOIN $wpdb->posts ON ID = comment_post_ID"; $request .= " WHERE comment_approved = '1' AND post_status = 'publish' AND post_password ='' AND comment_type = ''"; $request .= " ORDER BY comment_date DESC LIMIT $no_comments"; $comments = $wpdb->get_results($request); if ($comments) { foreach ($comments as $comment) { ob_start(); ?>
  • : comment_content), 0, $comment_len)); ?>...
  • No comments"; } } function dp_get_author($comment) { $author = ""; if ( empty($comment->comment_author) ) $author = __('Anonymous'); else $author = $comment->comment_author; return $author; } /* Plugin Name: Most Commented Plugin URI: http://mtdewvirus.com/code/wordpress-plugins/ */ function mdv_most_commented($no_posts = 10, $before = '
  • ', $after = '
  • ', $show_pass_post = false) { global $wpdb; $request = "SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS 'comment_count' FROM $wpdb->posts, $wpdb->comments"; $request .= " WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND post_type = 'post'"; if(!$show_pass_post) $request .= " AND post_password =''"; $request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts"; $posts = $wpdb->get_results($request); $output = ''; if ($posts) { foreach ($posts as $post) { $post_title = stripslashes($post->post_title); $comment_count = $post->comment_count; $permalink = get_permalink($post->ID); $output .= $before . '' . $post_title . '' /*. $comment_count */.'' . $after; } } else { $output .= $before . "None found" . $after; } echo $output; } /* custom comment design */ function sepcomments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="comment-">
    $depth, 'max_depth' => $args['max_depth']))) ?>
    comment_approved == '0') : ?>

  • id="comment-"> :