Re: new free theme: “The Hybrid” (formerly “Kakumei Too”)
View counts in the forum section require part of “my-views” plugin to be installed (my-views-most-least-views.php) or just make this a mini-plugin:
add_filter('get_forums','forums_views_append');
function forums_views_append($forums) {
if (is_front() || is_forum()) {
global $bbdb, $forums_views; $sum_meta_value="SUM(meta_value)";
if (!isset($forums_views)) {
$forums_views = $bbdb->get_results("SELECT DISTINCT forum_id, $sum_meta_value FROM $bbdb->topicmeta LEFT JOIN $bbdb->topics ON $bbdb->topicmeta.topic_id = $bbdb->topics.topic_id WHERE $bbdb->topics.topic_status=0 AND $bbdb->topicmeta.meta_key='views' GROUP BY $bbdb->topics.forum_id");
} foreach ($forums_views as $forum_views) {
if ($forum_views->forum_id) {$forums[$forum_views->forum_id]->views=$forum_views->$sum_meta_value;}
}
}
return $forums;
}