Posts Tagged ‘wordpress’

How to integrate bb-press into your wordpress theme

Thursday, February 11th, 2010

If you run a wordpress blog bb-press is the forum of choice since it integrates so well with WordPress. The only thing it lacks is the ability to integrate into your wordpress theme nicely, there is however a rather simple hack that makes a tighter integration possible. For the general setup and integration of bb-press please checkout this guide.

Functional integration

I want to focus on the theme part of it, which I think is just as important. So once you have your blog and your forum running you need to add a few lines of code to your bb-config.php file.

 * bbPress Database Table prefix.
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
$bb_table_prefix = 'bb_';


note: PATH_TO_WORDPRESS has to be the absolute path to the root folder since it will be called from different files within bb-press and a relative path might throw an error.

Theme header

Ok now we can use all of the wordpress theme tags in the bb-press theme. I recommend building uppon the “kakumei” that you already have but you can start from scratch as well.

In most cases you will want to have the same header and footer used in your blogs theme. You basically have three options

You can call the get_header() method directly inside header.php file in the bb-press theme:

  • remove all bb-press html code or you will end up with two html headers and a huge mess
  • this has the advantage that you only have to change the header file and you do not have to alter the other files

You can remove all calls of bb_get_header() and replace it with get_header() inside every file in bb-press theme

  • straight forward, you only have to deal with the wordpress theme header from then on
  • many bb-press plugins rely on scripts to be included in the header. With this technique you loose some functionality

You can leave your bb_press header and simply alter it by adding specific wordpress theme tags like wp_list_pages() to create the menu.

  • its the most complicated option since you have to deal with two header files and two style sheets
  • it offers the greatest flexibility. I used it to integrate my support forum

A word on CSS

If you choose to use the third option you will have to manually add the wordpress themes stlye.css to the header.php in the bb_press theme. The included bb_press css file is standalone and complete but you probably want your own theme to take the lead. I recommend throwing out the entire global settings part of the bb_press style sheet. I ended up deleting half of the styles and only leaving the styles that apply to elements of the forum. Everything else should come from your wordpress stylesheet. Its just easier to maintain that way.

And there you go – you run a solid forum that fits nicely into your wordpress blog.

mozconcept – file management in online applications

Monday, August 11th, 2008

More and more web 2.0 applications reach a level of sophistication usually only found in native desktop apps. One of the biggest topics right now is cloud computing and cloud storage. So I got my docs in google docs and I got my pictures in flickr and so on. Many apps by now already offer the possibility to import files from your local computer and some even are capable of taking stuff from other 2.0 web apps. The problem with this development is that each web app offers an API to make use of the data stored with the service. Now that would mean that every web app that wants to allow the user to user data from other web apps would have to implement all the APIs of each of those web apps. It is obvious that this will lead to chaos, poor connectivity and poor performance.

each line represents a API connection between a web service

each line represents a API connection between a web service

A possible solution:

The next generation browser becomes a hub for all this data APIs. The APIs are implemented within the browser and the browser can then provide the data to web apps as if they were either stored locally or via a unified API. Lets take the simple example of pictures. I have a picasaweb account with google and a flickr account. boot use the same type of data – Image Data – but they are not compatible. both flickr und picasa offer the ability to upload local files. If the browser knows this as well he could then take the picture from my picasa account using the given API and then present it to the flickr account as if it was a local file. This is the most simple implementation of this idea.

The dream would be that all Web apps offer an API that fulfills predefined standards for different types of data. If I then have a webapp like google docs or this wordpress blog and I am asked to upload a picture I do not only get to browse my local pictures but also all the pictures from all of my webservices like google and flickr.

each webservice my use their own API for sending data but will recieve data from the browser if it were local

each webservice may use their own API for sending data but will receive data from the browser if it were local

advantages of this concept:

  • so all the APIs only need to be implemented once in the browser and not by every webserice
  • future APIs can be built directly to this framework which will increase connectivity even more
  • the cloud becomes real as it really does not matter any more where the data is stored

kpicasa wordpress plugin

Tuesday, January 15th, 2008

I spent almost half a day trying to find a working plugin in order to embed my picasa galeries into my blog. I did not want another gallery management system or anything because I use Iphoto and via the iphoto/picasa plugin i can simply publish my galleries to picasaweb. I dont want to upload my pictures more than once so I was looking for a plugin that dynamically grabs the galleries from my picasa account and then displays them on my blog. There are many plugins out there that promise to do so. I used Ajax-Gallery but it stopped working when I updated to version 3.0 plus it is only in spanish. So I ran over the kpicasa plugin, which seemed the most promising to me. I tried to install it but it would not work since it requires php5. My webspace rendered .php files with php 4. I solved this problem by adding these lines to my .htaccess file.

AddHandler x-httpd-php5 .php 
AddType application/x-httpd-php5 .php

That way all your php files will be rendered using php 5. Note: if your webspace does not support php5 this won’t solve the problem. After doing so I still got an error that looked like this:

Error: your PHP configuration does not allow kPicasa Gallery to connect to Picasa Web Albums. Please ask your administrator to enable allow_url_fopen or cURL.

This can mean either what it says, or the author told me it can also mean that your username is spelled the wrong way. Anyhow check if the features are enabled by using the phpinfo() command. If they are disabled talk to your webspace host. I found them to be enabled but it still did not work. The reason was that my webspace host blocked these features externally from the php.ini . I had them unlock the google domain and now it is working.  The Author(Authors Blog) was very helpful in this process and I got quick support. Thanks a lot for this great plugin.

 Plugin Download from WordPress