Welcome to Zenkai
fallback to your custom forum tables if present */
if (function_exists(‘bbp_get_total_topic_count’)) {
$topic_total = (int) bbp_get_total_topic_count();
} else {
$threads_table = $wpdb->prefix . ‘zo_forum_threads’;
$maybe_threads = $wpdb->get_var($wpdb->prepare(“SHOW TABLES LIKE %s”, $threads_table));
if ($maybe_threads === $threads_table) {
$topic_total = (int) $wpdb->get_var(“SELECT COUNT(*) FROM {$threads_table}”);
}
}
if (function_exists(‘bbp_get_total_reply_count’)) {
$reply_total = (int) bbp_get_total_reply_count();
} else {
$posts_table = $wpdb->prefix . ‘zo_forum_posts’;
$maybe_posts = $wpdb->get_var($wpdb->prepare(“SHOW TABLES LIKE %s”, $posts_table));
if ($maybe_posts === $posts_table) {
$reply_total = (int) $wpdb->get_var(“SELECT COUNT(*) FROM {$posts_table}”);
}
}
if (function_exists(‘bp_groups_get_total_group_count’)) {
$group_total = (int) bp_groups_get_total_group_count();
} else {
$bp_groups_table = $wpdb->base_prefix . ‘bp_groups’;
$maybe_groups = $wpdb->get_var($wpdb->prepare(“SHOW TABLES LIKE %s”, $bp_groups_table));
if ($maybe_groups === $bp_groups_table) {
$group_total = (int) $wpdb->get_var(“SELECT COUNT(*) FROM {$bp_groups_table}”);
}
}
/** Vikinger settings fallback */
if (!isset($vikinger_settings) || !is_array($vikinger_settings)) {
$vikinger_settings = [
‘users_can_register’ => $users_can_register
];
}
?>
Zenkai Online
+
Zenkai Online
Avatar Social Universe
Profiles โข World โข Forums โข Streaming