function init() { remove_action('bb_init', 'bb_register_default_views'); bb_register_view('no-replies', __('Without Replies'), array('post_count' => 1, 'started' => '<' . gmdate('YmdH', time() - 7200))); bb_register_view('untagged', __('Without Tags'), array('tag_count' => 0)); add_filter('style_loader_src', array(&$this, 'style_loader_src')); add_action('bb_head', 'wp_print_styles'); add_filter('bb_get_theme_uri', array(&$this, 'bb_get_theme_uri')); wp_enqueue_style('guangzhou', bb_get_stylesheet_uri(), array(), $this->version(), 'all'); wp_enqueue_style('guangzhou-skin', bb_get_active_theme_uri() . 'skins/brown/style.css', array('guangzhou'), $this->version(), 'all'); }
function bb_register_default_views() { // no posts (besides the first one), older than 2 hours bb_register_view('no-replies', __('Topics with no replies'), array('post_count' => 1, 'started' => '<' . gmdate('YmdH', time() - 7200))); bb_register_view('untagged', __('Topics with no tags'), array('tag_count' => 0)); }
} if ($best_answer['display_first']) { add_filter('get_post_link', 'best_answer_post_link', 255, 2); } if (is_topic()) { add_action('bb_topic.php', 'best_answer_init'); } elseif (!is_bb_feed()) { add_filter('topic_title', 'best_answer_title', 255); } add_action('bb_head', 'best_answer_head'); add_action('topicmeta', 'best_answer_meta'); if ($best_answer['add_views']) { // doing it this way hides them from the default view list $query = array('started' => '>0', 'append_meta' => false, 'sticky' => false, 'topic_status' => 'all', 'order_by' => 1, 'per_page' => 1); bb_register_view("best-answer", "Questions with a best answer", $query); bb_register_view("no-best-answer", "Questions without a best answer", $query); add_action('bb_custom_view', 'best_answer_views'); } function best_answer_init() { global $best_answer, $topic, $bb_current_user, $posts, $page; if (!empty($best_answer['forums']) && !isset($best_answer['forums'][$topic->forum_id])) { return; } add_action('best_answer', 'best_answer'); add_action('best-answer', 'best_answer'); add_filter('best_answer_class', 'best_answer_class'); if ($best_answer['automatic']) { add_filter('post_author_title', 'best_answer_filter', 300); add_filter('post_author_title_link', 'best_answer_filter', 300); }