Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bbPress – using bb_top_topics()


_ck_
Participant

@_ck_

Total shot in the dark here as I can’t debug this code but try replacing in your routine above:

<?php // $top_topics = bb_top_topics(); ?>

with

<?php // $top_topics = bb_top_topics();
global $bbdb;
$where = apply_filters('get_latest_topics_where','WHERE topic_status=0');
$query = "SELECT * FROM $bbdb->topics LEFT JOIN $bbdb->meta ON object_id=topic_id $where AND object_type='bb_topic' AND meta_key='avg_rating' ORDER BY cast(meta_value as UNSIGNED) DESC LIMIT 10";
$top_topics = bb_append_meta($bbdb->get_results($query),'topic');
?>

Skip to toolbar