Andrea -- I noted that your plugin (http://atypicalhomeschool.net/wordpress-plugins/ah-recent-posts-mu.txt) too output's the slash. I have fixed that as well. Here is the modified version (NOTE THAT I HAVE ADDED THE CLASS "boldfora" TO OUTPUT THE HEADLINE IN BOLD. Users can remove the css reference or create one in their CSS.)
/*
Plugin Name: WordPress MU Recent Posts
Plugin URI: http://atypicalhomeschool.net/wordpress-plugins/
Description: Retrieves a list of the most recent posts in a WordPress MU installation. Based on (Andrea - fill this in)
Version: 0.3
Author: Ron Rennick
Author URI: http://atypicalhomeschool.net/
Use this by pasting the following wherever you want it to show:
<?php ah_recent_posts_mu(10) ?>
*/
function ah_recent_posts_mu($how_many = 10) {
global $wpdb;
$counter = 0;
// get a list of blogs in order of most recent update
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE
last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
ORDER BY last_updated DESC");
if ($blogs) {
foreach ($blogs as $blog) {
// we need _posts and _options tables for this to work
$blogOptionsTable = "wp_".$blog."_options";
$blogPostsTable = "wp_".$blog."_posts";
$options = $wpdb->get_results("SELECT option_value FROM
$blogOptionsTable WHERE option_name IN ('siteurl','blogname')
ORDER BY option_name DESC");
// we fetch the title and link for the latest post
$thispost = $wpdb->get_results("SELECT post_title, guid
FROM $blogPostsTable WHERE post_status = 'publish'
AND post_type = 'post' AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
ORDER BY id DESC LIMIT 0,1");
// if it is found put it to the output
if($thispost) {
echo '
guid
.'">'.$thispost[0]->post_title.' from <a href="'
.$options[0]->option_value.'">'
.stripslashes ($options[1]->option_value)."
";
$counter++;
}
// don't go over the limit
if($counter >= $how_many) {
break;
}
}
}
}
?>