diff --git a/bin/noblogs.in b/bin/noblogs.in index d93f49770d1ebe25a4c40962175714bbe5f10805..0a8ae8fdba678675490f2db8f1d336eec77aa119 100755 --- a/bin/noblogs.in +++ b/bin/noblogs.in @@ -186,6 +186,25 @@ function do_set_theme($args) { } } +// 'theme-stats': Prints statistics on theme usage for all local blogs. +function do_theme_stats($args) { + $counters = array(); + foreach (noblogs_get_local_blog_objects() as $blog) { + switch_to_blog($blog->blog_id); + $theme = get_option('template'); + if ($theme) { + if (in_array($theme, $counters)) { + $counters[$theme]++; + } else { + $counters[$theme] = 1; + } + } + } + foreach ($counters as $theme => $n) { + echo("{$theme} {$n}\n"); + } +} + // 'dump-shards': Print a JSON dictionary representing the full map // of backend -> blogs database mappings. function do_dump_shards($args) {