well it looks like you'll need to hack the plugin to include an offset for example you have:
<?php mdv_most_commented(10, '', '', true, 1000, true); ?>
and
<?php mdv_most_commented(10, '', '', true, 7, true); ?>
the "10" is the number to show. So if you call the plugin the same way twice both having 10 results, you'll get the same 10 results both times.
So if you're showing the top 10 out of each of the date ranges you're asking for you are basically saying:
<?php mdv_most_commented(20, '', '', true, 1000, true); ?>
so basically you need a way to add another option to the string like:
<?php mdv_most_commented(10, '', '', true, 1000, 30, true); ?>
Where "30" in the back end would be an offset on days.
I'm using a popular post code myself not sure if it's the same as your's but here some hacked code to achiebve what you want:
Put this where you want the result to display:
<h2>past 30 days</h2>
<ul>
<?php most_popular_posts_past30(); ?>
</ul>
<h2>past 1000 days</h2>
<ul>
<?php most_popular_posts_past1000(); ?>
</ul>
Put this in your functions.php:
/* most_popular_posts_past30 */
function most_popular_posts_past30($no_posts = 5, $before = '<li>', $after = '</li>', $show_pass_post = false, $duration='') {
global $wpdb;
$date = date('Y-m-d', strtotime('-1 months'));
$days = (strtotime($date) - strtotime(date("Y-m-d"))) / (60 * 60 * 24);
$days = str_replace("-", "", $days);
$duration = $days;
$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'";
if(!$show_pass_post) $request .= " AND post_password =''";
if($duration !="") { $request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date ";
}
$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);
if (($comment_count)>1){
$numcoms = " comments";
}
else{
$numcoms = " comment";
};
$output .= $before . '<a href="' . $permalink . '" title="' . $post_title.'">' . $post_title . '<span><small> (' . $comment_count. $numcoms .')</small></span></a>' . $after . "\n";
}
} else {
$output .= $before . "None found" . $after;
}
echo $output;
}
/* end most_popular_posts_past30 */
/* most_popular_posts_past1000 */
function most_popular_posts_past1000($no_posts = 5, $before = '<li>', $after = '</li>', $show_pass_post = false, $duration='') {
global $wpdb;
$date = date('Y-m-d', strtotime('-1 months'));
$date2 = date('Y-m-d', strtotime('-1000 days'));
$days = (strtotime($date2) - strtotime($date)) / (60 * 60 * 24);
$days = str_replace("-", "", $days);
$duration = $days;
$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'";
if(!$show_pass_post) $request .= " AND post_password =''";
if($duration !="") { $request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date ";
}
$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);
if (($comment_count)>1){
$numcoms = " comments";
}
else{
$numcoms = " comment";
};
$output .= $before . '<a href="' . $permalink . '" title="' . $post_title.'">' . $post_title . '<span><small> (' . $comment_count. $numcoms .')</small></span></a>' . $after . "\n";
}
} else {
$output .= $before . "None found" . $after;
}
echo $output;
}
/* end most_popular_posts_past1000 */
and here it is working on my test page:
http://tugbucket.net/list-sample/#mostComm