Salut
tu as une table qui s’appelle normalement blogs (avec un préfixe)
Cette requête te permet de séléctionner les 10 derniers blog crée :
SELECT * FROM `wp_blogs` order by registered DESC LIMIT 0,10
Pour la photo illustrant le blog, j’ai pris le partie de créer une nouvelle table contenant l’id du blog, une description et une vignette.
Sinon si tu souhaite voir les dix derniers articles posté sur tes blogs c’est encore différents. Voici une fonction que j’ai trouvé sur internet qui est pas mal :
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, post_content, ID
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 && ($thispost[0]->ID !=1) ) {
echo ‘<p><a>guid
.' »>’.$thispost[0]->post_title.’</a><span style="font-size:12px"> sur le blog </span><span style="font-size:12px;font-weight:bold"><a>option_value.' »>’
.$options[1]->option_value. »</a></span></p><br />« ;
$counter++;
}
// don’t go over the limit
if($counter >= $how_many) {
break;
}
}
}
}
Enfin va sur ce site http://wpmudev.org. Il y a des fonctionnalités cross-blog intéressante.