<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress Showcase Topic: Plug-in Idea: Show bbPress forum topic in Wordpress Loop?</title>
<link>http://bbshowcase.org/forums/</link>
<description>bbPress Showcase Topic: Plug-in Idea: Show bbPress forum topic in Wordpress Loop?</description>
<language>en</language>
<pubDate>Thu, 24 May 2012 16:40:55 +0000</pubDate>

<item>
<title>yesanswer on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-1552</link>
<pubDate>Sat, 01 Aug 2009 09:44:39 +0000</pubDate>
<dc:creator>yesanswer</dc:creator>
<guid isPermaLink="false">1552@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;hi&#60;br /&#62;
if i puplish my &#60;a href=&#34;http://www.yesanswer.com&#34;&#62;feed&#60;/a&#62; on bbpress, and i add many text for example in 10 min, can google take it for spamm?
&#60;/p&#62;</description>
</item>
<item>
<title>exchequer598 on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-353</link>
<pubDate>Thu, 29 May 2008 01:37:00 +0000</pubDate>
<dc:creator>exchequer598</dc:creator>
<guid isPermaLink="false">353@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;I'd like to implement this feature too! Have you got it to work? I'm sorry, but I'm a bit new with all this. Please help. Thanks!
&#60;/p&#62;</description>
</item>
<item>
<title>mrhoratio on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-296</link>
<pubDate>Tue, 06 May 2008 11:49:10 +0000</pubDate>
<dc:creator>mrhoratio</dc:creator>
<guid isPermaLink="false">296@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;Looks like I've got something working. The basic idea is to retrieve topics from bbPress tables and merge them into an array of Wordpress posts, which can then be turned into a custom Loop using foreach. &#60;/p&#62;
&#60;p&#62;The only issue is that the number of posts per page won't match the &#34;Blog pages show at most&#34; in your admin settings, if there are retrieved bbPress topics on that page. Here's what the code looks like:&#60;/p&#62;
&#60;blockquote&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
&#38;lt;?php&#60;/p&#62;
&#60;p&#62;//Put Wordpress posts into an array;&#60;br /&#62;
$wp_posts = $posts;&#60;/p&#62;
&#60;p&#62;if (!is_single()){&#60;/p&#62;
&#60;p&#62;	//Retrieve first post of previous page (we need this post's date to query bbPress topics&#60;br /&#62;
	$offset=$paged*$posts_per_page+$posts_per_page;&#60;br /&#62;
	$first_post_of_previous_page = get_posts('numberposts=1&#38;#38;offset='.$offset);&#60;/p&#62;
&#60;p&#62;	//First set the start and end dates to limit the query to the bbPress table&#60;br /&#62;
	$startdate=(date('YmdHis',strtotime($first_post_of_previous_page[0]-&#38;gt;post_date_gmt)));&#60;br /&#62;
	$enddate=(date('YmdHis',strtotime($wp_posts[0]-&#38;gt;post_date_gmt)));&#60;/p&#62;
&#60;p&#62;	//Retrieve &#34;Super Sticky&#34; topics from bbPress tables.&#60;br /&#62;
	//This assumes your bbPress and Wordpress tables are in the same database.&#60;br /&#62;
	$bb_topics = $wpdb-&#38;gt;get_results(&#34;SELECT * FROM bb_topics WHERE topic_sticky = 2 AND topic_start_time BETWEEN $startdate AND $enddate ORDER BY topic_start_time DESC&#34;);&#60;/p&#62;
&#60;p&#62;	//Map bbPress topics to WordPress posts structure.&#60;br /&#62;
	foreach($bb_topics as $bb_topic){&#60;br /&#62;
		$bb_first_post = $wpdb-&#38;gt;get_results(&#34;SELECT post_text FROM bb_posts WHERE post_position = '1' AND topic_id = $bb_topic-&#38;gt;topic_id&#34;, ARRAY_A);&#60;br /&#62;
		$bb_post-&#38;gt;ID = &#34;00000&#34;.$bb_topic-&#38;gt;topic_id;&#60;br /&#62;
		$bb_post-&#38;gt;post_author = $bb_topic-&#38;gt;topic_poster;&#60;br /&#62;
		$bb_post-&#38;gt;post_date = $bb_topic-&#38;gt;topic_start_time;&#60;br /&#62;
		$bb_post-&#38;gt;post_content = $bb_first_post[0][post_text];&#60;br /&#62;
		$bb_post-&#38;gt;post_title = $bb_topic-&#38;gt;topic_title;&#60;br /&#62;
		$bb_post-&#38;gt;post_status = &#34;publish&#34;;&#60;br /&#62;
		$bb_post-&#38;gt;comment_status = &#34;open&#34;;&#60;br /&#62;
		$bb_post-&#38;gt;ping_status = $bb_topic-&#38;gt;post_id;&#60;br /&#62;
		$bb_post-&#38;gt;post_name = &#34;forums/topic/&#34;.$bb_topic-&#38;gt;topic_slug;&#60;br /&#62;
		$bb_post-&#38;gt;post_type = &#34;post&#34;;&#60;br /&#62;
		$bb_post-&#38;gt;comment_count = $bb_topic-&#38;gt;topic_posts-1;&#60;/p&#62;
&#60;p&#62;		//add bbPress topic to Wordpress posts array.&#60;br /&#62;
		$wp_posts[] = $bb_post;&#60;/p&#62;
&#60;p&#62;	};&#60;/p&#62;
&#60;p&#62;	//Create function to sort array of posts by date&#60;br /&#62;
	function compare($x, $y){&#60;br /&#62;
		if ( $x-&#38;gt;post_date == $y-&#38;gt;post_date )&#60;br /&#62;
			return 0;&#60;br /&#62;
		else if ( $x-&#38;gt;post_date &#38;lt; $y-&#38;gt;post_date )&#60;br /&#62;
			return 1;&#60;br /&#62;
		else&#60;br /&#62;
			return -1;&#60;br /&#62;
	}&#60;/p&#62;
&#60;p&#62;	//Sort array&#60;br /&#62;
	usort($wp_posts,'compare');&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;?&#38;gt;&#60;/p&#62;
&#60;p&#62;&#60;/code&#62;
&#60;/p&#62;&#60;/blockquote&#62;</description>
</item>
<item>
<title>mrhoratio on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-291</link>
<pubDate>Sun, 04 May 2008 11:26:12 +0000</pubDate>
<dc:creator>mrhoratio</dc:creator>
<guid isPermaLink="false">291@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;I tried unsetting $topics, but it just removed all of the topics from the page, since super stickies are also topics.&#60;/p&#62;
&#60;p&#62;I tried another approach and was able to retrieve the list of super stickies by putting this code in before a bbPress loop:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$topics = $bbdb-&#38;gt;get_results(&#38;quot;SELECT * FROM $bbdb-&#38;gt;topics WHERE topic_start_time BETWEEN $startdate AND $enddate ORDER BY topic_start_time DESC&#38;quot;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I was also able to get stickies within a specific date range:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$startdate=&#38;quot;20080500223740&#38;quot;;
$enddate=&#38;quot;20080502223740&#38;quot;;

$topics = $bbdb-&#38;gt;get_results(&#38;quot;SELECT * FROM $bbdb-&#38;gt;topics WHERE topic_sticky = 2 AND topic_start_time BETWEEN $startdate AND $enddate ORDER BY topic_start_time DESC&#38;quot;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This has a couple of issues:&#60;/p&#62;
&#60;p&#62;1. Query doesn't retrieve the topic's first entry, just topic title.&#60;br /&#62;
2. Pagination is a little weird and doesn't respect what you have set for &#34;Items per page&#34; bbPress admin. &#60;/p&#62;
&#60;p&#62;I'll try to see if I can work these out. &#60;/p&#62;
&#60;p&#62;After that, the next step I want to do is to figure out how to run this query within Wordpress. Then, map the topic structure to a post structure (ie &#34;topic_title&#34; becomes &#34;post_title&#34;).  Then, merge the query into a Wordpress loop. I suspect there will be pagination issues also in Wordpress. But one step at a time.
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-290</link>
<pubDate>Sat, 03 May 2008 01:13:48 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">290@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;You'd have to do a few plugin tricks but it could be done.&#60;/p&#62;
&#60;p&#62;Either I'd create a new custom view of just super-stickies (a front page sticky is called a super-sticky I think in bbPress) or I'd probably approach it by adding a variable to the end of a url (ie. forum.com/feed/?onlysticky=1 ) and hook &#60;code&#62;bb_index.php&#60;/code&#62; and then &#34;destroy&#34; any regular posts in the list by unsetting $topics.&#60;/p&#62;
&#60;p&#62;ie. (and this is very rough, completely untested code)&#60;br /&#62;
&#60;font color=&#34;blue&#34;&#62;&#60;br /&#62;
function onlysticky() {global $topics; if (isset($_GET['onlysticky'])) {unset($topics);}}&#60;br /&#62;
add_action( 'bb_index.php', 'onlysticky');&#60;br /&#62;
add_action( 'bb_rss.php', 'onlysticky' );&#60;br /&#62;
&#60;/font&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>mrhoratio on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-289</link>
<pubDate>Sat, 03 May 2008 00:54:39 +0000</pubDate>
<dc:creator>mrhoratio</dc:creator>
<guid isPermaLink="false">289@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;Ah I see, that would be a great plugin. &#60;/p&#62;
&#60;p&#62;I was just now tinkering with the bbPress template to make a page that displays only Front Page stickies. Unfortunately, I couldn't figure out how to get it to paginate. &#60;/p&#62;
&#60;p&#62;Is there a way for bbPress to make an RSS of only Front Page stickies?  That way I can use an RSS aggregator plugin to bring it into Wordpress. Or is there a way in Wordpress to query a bbPress database for all the front page stickies, bypassing RSS altogether?
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-288</link>
<pubDate>Sat, 03 May 2008 00:08:47 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">288@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;No the idea was to make a special front page instead of the regular latest discussions that holds the promoted topics with custom summaries for what they are about, including their own RSS feed. It would replace the regular front page.
&#60;/p&#62;</description>
</item>
<item>
<title>mrhoratio on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop/page/2#post-287</link>
<pubDate>Fri, 02 May 2008 20:12:54 +0000</pubDate>
<dc:creator>mrhoratio</dc:creator>
<guid isPermaLink="false">287@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;Hey _ck_, I just noticed that bbPress now has a &#34;promote to front page&#34; functionality in the form of a &#34;Stick to front&#34; link in every topic. Here's a couple of threads on the bbPress site which discusses it:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://bbpress.org/forums/topic/stick-to-front-removes-topic-from-forum&#34; rel=&#34;nofollow&#34;&#62;http://bbpress.org/forums/topic/stick-to-front-removes-topic-from-forum&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://bbpress.org/forums/topic/categories-in-0901&#34; rel=&#34;nofollow&#34;&#62;http://bbpress.org/forums/topic/categories-in-0901&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;There's no support for Wordpress integration with this feature, but perhaps it will come in a future version.
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop#post-286</link>
<pubDate>Thu, 01 May 2008 21:01:13 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">286@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;You can get RSS feeds for almost any page in bbPress by putting `/feed/` after it. In fact the front page has two different feeds, one for topics and one for individual posts. You'll probably want the topics one.&#60;/p&#62;
&#60;p&#62;With some clever programming, even though the feeds might only contain the last 10-20 topics, you can make the front page tool cache them and therefore go back into the hundreds.
&#60;/p&#62;</description>
</item>
<item>
<title>mrhoratio on "Plug-in Idea: Show bbPress forum topic in Wordpress Loop?"</title>
<link>http://bbshowcase.org/forums/topic/plug-in-idea-show-bbpress-forum-topic-in-wordpress-loop#post-285</link>
<pubDate>Thu, 01 May 2008 12:11:54 +0000</pubDate>
<dc:creator>mrhoratio</dc:creator>
<guid isPermaLink="false">285@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;Hey _ck_, I love the RSS feed idea. I'll check Eter RSS out.  I'm not totally sure how bbPress feeds work, but I'm assuming I'd need to create an RSS feed in bbPress that always contains every single forum topic, in order for changes to reflect in Wordpress realtime?&#60;/p&#62;
&#60;p&#62;From my understanding, RSS feeds generally include only the most recent subset of all posts. For example, a bbPress feed might only contain the last 30 recent forum topics. Let's assume I can get Wordpress to aggregate a bbPress feed and mix it into the loop. Does it mean that stories fall out of the Wordpress loop, when they disappear off the bbPress feed (because they are old, not because they are deleted from the forums) as well? &#60;/p&#62;
&#60;p&#62;So if we go back to our scenario: Ideally, Peggy could go to the front page of the blog and use the pagination links at the bottom to go back several pages and see posts from 2 months ago. On this page, Peggy would still be able to see &#34;promoted&#34; forum topics mixed in with blog posts from 2 months ago, even though the forum topic may have disappeared from the bbPress feed because it's old.&#60;/p&#62;
&#60;p&#62;I also wonder what the performance issues are with having a feed that contains every single topics. &#60;/p&#62;
&#60;p&#62;We seem so so close to a solution!
&#60;/p&#62;</description>
</item>

</channel>
</rss>

