if (!($topics = get_latest_topics())) { die; } $posts = array(); foreach ($topics as $topic) { $posts[] = bb_get_first_post($topic->topic_id); } $title = esc_html(sprintf(__('%1$s » Recent Topics'), bb_get_option('name'))); $link = bb_get_uri(); $link_self = bb_get_topics_rss_link(); break; // Get latest posts by default // Get latest posts by default case 'all-posts': default: if (!($posts = bb_get_latest_posts(35))) { die; } $title = esc_html(sprintf(__('%1$s » Recent Posts'), bb_get_option('name'))); $link = bb_get_uri(); $link_self = bb_get_posts_rss_link(); break; } } bb_send_304($posts[0]->post_time); if (!($description = esc_html(bb_get_option('description')))) { $description = $title; } $title = apply_filters('bb_title_rss', $title, $feed); $description = apply_filters('bb_description_rss', $description, $feed); $posts = apply_filters('bb_posts_rss', $posts, $feed);
function get_latest_posts($limit = 0, $page = 1) { bb_log_deprecated('function', __FUNCTION__, 'bb_get_latest_posts'); return bb_get_latest_posts($limit, $page); }
// Get just the first post from the latest topics case 'all-topics': $topics = get_latest_topics(); $posts = array(); foreach ((array) $topics as $topic) { $posts[] = bb_get_first_post($topic->topic_id); } $title = sprintf(__('%1$s » Recent Topics'), bb_get_option('name')); $link = bb_get_uri(); $link_self = bb_get_topics_rss_link(); break; // Get latest posts by default // Get latest posts by default case 'all-posts': default: $posts = bb_get_latest_posts(35); $title = sprintf(__('%1$s » Recent Posts'), bb_get_option('name')); $link = bb_get_uri(); $link_self = bb_get_posts_rss_link(); break; } } if (!$posts) { /* We do typecasting in the template, but all themes don't have that! */ $posts = array(); } else { /* Only send 304 if there are posts */ bb_send_304(gmdate('D, d M Y H:i:s \\G\\M\\T', strtotime($posts[0]->post_time))); } if (!($description = bb_get_option('description'))) { $description = $title;