4

Wordpress MU List Blogs

Posted by Eric Juden on Aug 31, 2009

I recently had to make a list of all the active blogs for the university’s blog site running Wordpress MU. Here’s the code to do so:

<?php if(is_front_page()){?>
    <h1>Blog Directory</h1>
 
<?php
    global $wpdb;
    $query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' AND blog_id != '1' ORDER BY path";
    
    $blogs = $wpdb->get_results($query);
    
    echo '<ul>';
    foreach($blogs as $blog){
        $blog_details = get_blog_details($blog->blog_id);
        echo '<li><a>siteurl .'">' . $blog_details->blogname .'</a></li>';
    }
    echo '</ul>';
}
?>

You’ll notice the query is set to filter out blogs that are marked as archived, spam, private. Also, it hides the main blog from the list.


0

Newsletter Converter 1.0.6 Released

Posted by Eric Juden on Aug 10, 2009

Not sure if anyone has noticed, but the Newsletter Converter for Wordpress has been updated to version 1.0.6. Hopefully this release fixes a lot of the timeout issues people were experiencing. You also have the ability to use cURL instead of php’s file_get_contents() function, which is apparently not enabled on a lot of web hosts…go figure.

If you are happy with it, feel free to buy me a beer (in the sidebar).