helenw
Member
Posted 15 years ago #
On my main admin blog I showing a list of updated blogs. This list should only show public blogs and blogs that are active.
I deleted the test blogs and they are still on the list. And I am seeing private blogs listed as well.
This is the code I am using - Can anyone suggest a solution?
Thanks!
Helen
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE domain!='beblogger.com' AND last_updated!='0000-00-00 00:00:00' ORDER BY last_updated DESC LIMIT 10");
foreach ($blogs as $blog) :
$blog = "wp_".$blog."_options";
$opt = $wpdb->get_col("SELECT option_value FROM $blog WHERE option_name='siteurl'");
$opt2 = $wpdb->get_col("SELECT option_value FROM $blog WHERE option_name='blogname'");
print "
".ucfirst($opt2[0])."";
endforeach;
You need to add something like 'AND public == 1' to your WHERE clause... You might also want to consider filtering out spam and mature... but that's up to your administrative policies I guess.
helenw
Member
Posted 15 years ago #
Thanks - the blogs haven't launched so I am not sure how bad spam is so that is a good suggestion for the front end.
If you don't mind me asking - where do I go to look for this kind of information, to add to the code (spam, mature and your suggestion of public ==1. I am NEW NEW NEW to blogging and MU and have been fast tracking to learn as much as I can to get things going knowing that I have to continue learning. I will most definately have to learn more about plugins so any tips and URLs you can offer would be very much appreciated.
Helen