[wp-hackers] bbPress integration: merge forum topics into Wordpress Loop

Stephen Rider wp-hackers at striderweb.com
Sat May 10 17:10:54 GMT 2008


Chanpory --

I think you would want to filter $wp_posts->get_posts  (in wp-includes/ 
query.php)

The filter at the end of that function is the_posts

This sounds like a good plugin idea.  Good luck with it.

Stephen

-- 
Stephen Rider
<http://striderweb.com/>

On May 9, 2008, at 7:10 PM, Chanpory Rith wrote:

> Do you have any suggestions on which Wordpress functions I should  
> hook into, in order to convert this into a plugin?
>
> On May 6, 2008, at 9:18 PM, Stephen Rider wrote:
>
>> Another approach might be to edit the WordPress functions to look  
>> at the bbpress data and grab topics with the right meta-tag on it.   
>> Then any time the regular WordPress loop is called, it is filtered  
>> to include the bbpress "posts".
>>
>> That might be a cleaner approach with regards to themes, etc.   
>> Probably a plugin-able system too.
>>
>> Or... Regarding using WordPress functions in bbpress, there is a WP  
>> file that you would include in the bbpress plugin.  Forgetting what  
>> it is -- wp-header.php or something like that?
>>
>> On May 6, 2008, at 6:21 PM, Chanpory Rith wrote:
>>
>>> Do you mean having bbPress publish a post directly to Wordpress?  
>>> I'm not exactly sure how to use Wordpress functions in bbPress.  
>>> Also, I want to bring in only select posts from bbPress to  
>>> Wordpress and not all posts. I also don't like the idea of  
>>> duplicating the entries in two different places.
>>>
>>> I share your worry about the custom loops, however.
>>>
>>> On May 6, 2008, at 3:47 PM, Andre SC wrote:
>>>
>>>> Would it make sense to publish (wp_insertpost I think) the topic  
>>>> (or it's excerpt etc) to WordPress, and update the post (and/or  
>>>> publish a new post) when the topic is updated?
>>>>
>>>> Just a google-php-er myself but off of the top of my head if you  
>>>> want to go the plugin route it would make sense to elliminate the  
>>>> need for custom loops in theme files.
>>>>
>>>> Chanpory Rith wrote:
>>>>>
>>>>> I'm new to this list and a novice PHP coder, but I wanted to  
>>>>> share some code I've been working on.
>>>>>
>>>>> The goal is to enable bbPress moderators to "promote" a topic to  
>>>>> show up in a Wordpress loop. Clicking on the permalink of the  
>>>>> bbPress topic within the Wordpress loop, will take you directly  
>>>>> to bbPress topic page. Any changes made to topic on the bbPress  
>>>>> side would also show up automatically in the loop. (There is a  
>>>>> similar functionality in Drupal, and I was considering migrating  
>>>>> my Wordpress blog to Drupal, but it turned out to be huge pain.)
>>>>>
>>>>> My approach was to take advantage of the "sticky" functionality  
>>>>> in bbPress. The idea is to retrieve "super sticky" topics from  
>>>>> the bbPress database tables, and merge it into an array of  
>>>>> Wordpress posts. Then, use foreach to create a custom loop which  
>>>>> displays the combined list of Wordpress and bbPress posts. From  
>>>>> a user's perspective, you would simply click the "Stick topic  
>>>>> (to front)" in bbPress to promote the topic to Wordpress.
>>>>>
>>>>> So far, I've been successful in modifying the index.php file for  
>>>>> the Classic theme to achieve this functionality. There is some  
>>>>> pagination issues, but it seems to be working fairly well so far.
>>>>>
>>>>> I'm not sure if it could be turned into a plugin or not. I've  
>>>>> attached what I have so far as a text file. The code assumes the  
>>>>> latest versions of bbPress and Wordpress, and that bbPress was  
>>>>> installed with Wordpress integration enabled. Also, the tables  
>>>>> for bbPress and Wordpress are in the same database.
>>>>>
>>>>> Any suggestions for streamlining or improving this would be  
>>>>> greatly appreciated:
>>


More information about the wp-hackers mailing list