Set up bbPress as WP Plugin: Convert from bbPress standalone

We went live with new bbPress plugin on January 28, 2013.

 

bbPress as a plugin for WordPress

I started preparing for series of upgrades to the latest WP version (3.5), and Theme and all the plugings.  It was immediately obvious that among other things, I would have to look into migrating from integrated bbPress to a bbPress as a WP plugin.

So far my experience was pretty intense.  I will try to log my progress here as I am moving forward preparing a production roll-out on my test site.

Migrate your bbPress data from “bb_” tables into your “wp_” database

I was able to migrate all the content from old tables into WP tables (Tools – Forums – Import Forums).  Then I manually went to My_SQL workbench and deleted all the table with prefix “bp_”.  This was a easy and smooth operation.

First Problems

Some  links are broken.  They bring you back you your main WP site instead of expected Forum-related pages. What is wrong? After several hours (1h and 54 min) I found that problem is in bbPress default Theme Package.  If switch to Twenty Ten (bbPress) Theme Package, then most of the problems would go away except for some formatting issues.

Style Sheet Adjustments

Next, I need to start fighting with clashes between WP theme style.css and bbPress.css.  One item in particular I need to mention right away.

I had to remark out ” float: left;” from WP theme style.css to make bbPress posts look somewhat acceptable on a page:

 .ind-post, .hentry
{
/* float: left; */

Also, I had to remark out one line in iestyles.css:

img.avatar {
	margin-left: -65px;
	}

This particular style messes up location of avatar on a topic line, and causes text and links to overlap.

Add Menu Link to Forums Home

To add a quick access to your Forums, add a menu link to all of your Forums – /?post_type=forum
Also, you can create a new page and place these meta tags on it:

This will display 15 most recent topic-posts at the beginning of the page, and a complete tree of your forums on the bottom of the page.

Fix truncated Forum pages

This was the toughest problem to solve. Under default themes (Twenty Ten and others) forum user profile page and forum home page would look good, but under my theme – Magazine Basic – it would be very short and it would loose all its formatting. It will be just an ugly formatted raw  text.

Using debug I traced the problem to the theme loop.php page and Excerpt feature.  If post type  is defined as  ‘forum’ it always must be treated a single page.  Also, if variable $bbp_user is defined – this situation also must be sonsidered as a single page (not a collection of post, pages or articles.

Open file “loop.php” and scroll near line 150.  Find a line

if(is_singular()) {

and replace it with this one:

if(is_singular() || $post_type == 'forum' || $bbp_user > 0) {

Now, your theme will treat the forum post types same as a single post type, and will stop applying function

pbt_theme_excerpt($wordlimit);

Similar logic applies to removing unneeded pagination at the very bottom of  loop.php:

//if ( ! is_single() )
if ( ! is_single() && $post_type != 'forum')
pbt_pagination();

Here we are appending one more condition, when there is no need to display theme pagination.

 

Next Steps – these were harder to resolve

Only few more problems with bbPress as a WP plugin remain to solve:

=01= Integrate bbPress SEARCH – integrate bbPress topics into WP site search – RESOLVED 2012-12-27 TH  09:55

[ Add code to the end of your theme functions.php or get a plugin.  The real trick here is to customize the author link in search results. WP post authors should link to WP post for the author, and BB posts authors should link to BB topics and links.]

 

=02= TAG CLOUD – integrate bbPress tags into WP tag cloud

[  pending ]

 

=03= Control bbPress TAG CLOUD – RESOLVED 2013-01-20 SU 20:02

[ Locate file shortcodes.php in \wp-content\plugins\bbpress\includes\common.  Find function display_topic_tags(). Customize three first parameters: smallest font size – 10, largest font size – 26, number of tags -40. ]

 

=04= Latest topics ONE-LINE FORMAT – output recent topic-posts in one-line format  (nice, clean format as it was before) – RESOLVED 2013-01-19 SA

[ Hide element #bbpress-forums p.bbp-topic-meta  in file bbpress.css located in wp-content\plugins\bbpress\templates\default\css]

 

=05= Highlight currently selected row – HOVER (just like before) – RESOLVED 2013-01-19 SA

[Add this element #bbpress-forums li.bbp-body ul:hover{ background-color:  rgb(228, 243, 225); } to bbpress.css]

 

=06= Output child forums  one per line. Do not list child forums inline – RESOLVED 2013-01-20 SU 20:47

[ Remark out   display: inline;   from tag #bbpress-forums .bbp-forums-list li  in file bbpress.css]

 

=07= Add new topic link and disclaimer link in the title row of recent topics –

[ Copy loop-topics.php from  \wp-content\plugins\bbpress\templates\default\bbpress into your custom child theme and modify as needed.  Rename original loop-topics.php to prevent it from executing.]

 

 

 

WordPress 3.5 Specific Problems

Try updating your plugins under WP 3.5. You might receive an error message, and plugin will not be updated. You need to add a new line of code in your wp-config.php file:

define( 'WP_TEMP_DIR', ABSPATH . 'wp-content/etc/');

Normal upgrade pass doesn’t touch your wp-config.php, so you need to do all version-related upgrades perform  yourself.

(Visited 221 times, 1 visits today)

1 Comment

Your question, correction or clarification Ваш вопрос, поправка или уточнение