In phpmyadmin to view the most used themes? Or how can I write a small php file that will show me how many users are using what themes. I currently have 20 skins and I'd like to know how many users use which skin.
Is this possible?
In phpmyadmin to view the most used themes? Or how can I write a small php file that will show me how many users are using what themes. I currently have 20 skins and I'd like to know how many users use which skin.
Is this possible?
This is just rough, but I've been using it:
<?php
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs
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";
$opt = $wpdb->get_results("SELECT option_value FROM
$blogOptionsTable WHERE
option_name IN ('template','blogname') ORDER BY option_name DESC");
echo '<li class="page_item">'
.$opt[0]->option_value.' - '
.$opt[1]->option_value."</li>";
}
?>
It's just a light mod of our get-last-updated. All it does is spew out a list of users and what theme they are using.
Please note that that's a php file and not something you can drop into phpMyAdmin. You have to put it with your WPMU files. :)
Nice idea. Thanks andrea :) I am using it too now. There is a curly brace missing in the code posted above. Here it is w/the brace:
<?php
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs
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";
$opt = $wpdb->get_results("SELECT option_value FROM
$blogOptionsTable WHERE
option_name IN ('template','blogname') ORDER BY option_name DESC");
echo '<li class="page_item">'
.$opt[0]->option_value.' - '
.$opt[1]->option_value."</li>";
}
}
?>
Doh, yeah Mike. Forgot to mention I just placed this within an unused theme enabled for just a test blog. Someday we'll make it snazzy so it shows up in admin and stuff.
I added it to the wpmu-admin.php (site admin page - right before the closing div tag for the wrap div) since there was so much room on it. When I have some time, I would like to play around with it and try to get a list of each theme and how many people are using it.
Probably better to just put it on its own page though so it is easier to update the files.
Yeah, and sorted or grouped by theme would be nice too. I bet AndrewBillets would suggest a nice bar graph. :)
Thanks for that, but I dont think I will be counting 550+ blogs one by one :P
Would be nice if you could just show something like:
Kubrick: 231
Classic: 12
K2: 2314
And so on. Is that not possible?
It should be.
I know nearly nothing about php but I will try to have something tommorow or saturday. I promise nothing tho :P
Just thinking quick about it here, it need a quite bit more code in it, to stuff each user's theme in an array, then sort it and THEN spit it out.
I know there's a few guys around here quite fond of arrays. ;) Maybe soemone else will tackle it for a quick brain exercise.
Konstan: Did you figure it out? :-)
I have a plugin that does that, which I wrote for internal use. I'll post it later if anyone's interested?
release it man - we're waiting ;-)
Here we go :)
stutley, can I adopt you? :) Nice mod to our code there.
Hehe. Sure :) Gotta talk to my dad first, though :)
Very nice :) Thanks!