Skip to:
Content
Pages
Categories
Search
Top
Bottom

How I got my WPMU 2.7.1 / BuddyPress 1.0 / BBPress Alpha 6 to behave.

  • @jsonb123

    Participant

    I’m marking this as ‘not resolved’ because I’m sure there is a better way to do this…and I’m simply astounded that so many people are having issues with this same installation pattern within different environments. It’s really obnoxious.

    With that said, I got my setup working using the instructions found here: http://theeasybutton.com/blog/2009/04/30/integrating-buddypress-10-wpmu-and-bbpress/ and downloading the Alpha 6 version of BBPress from the same site, since it’s not available (at least I couldn’t find it) on the BBPress site since their new release of RC-1.

    Now, after following these instructions, and I’ve installed several of these again from scratch to make sure I did everything correctly…I was having backslashes appear in my BBPress forum. They were showing up in different cases, here’s a break down:

    These cases below are specific to the Topic Name, not the actual content within the post.

    1. Creating a new topic in BBPress would result in NO slashes appearing on the charcters ‘ ” and (meaning it worked perfectly). On the BuddyPress groups side of things it also rendered correctly. I checked the database and the records contained no slashes as well.
    2. Creating a new topic on the BuddyPress side (in groups -> forums) showed perfectly on the BuddyPress side. However, on the BBPress side I would see for the following topic title: "Testing" 'single-quotes' / and stuff!

      BuddyPress: "Testing" 'single-quotes' / \ and stuff!

      BBPress: \\\"Testing\\\" \\\'single-quotes\\\' / \\\ and stuff!

    This was a huge annoyance. I managed to band-aid it with the help of Chris at the Easy Button site I referenced above. You can scroll down and see the back-and-forth in the comments (I’m Jason).

    Here’s the fix, and it’s ugly and definitely not the best solution, as it now strips out characters entirely, even ones I’ve intentionally typed in. Go to the directory that contains BBPress->bb-includes->defaults.bb-filters.php

    In this file I first changed this chunk of code:

    <br />
    // Strip, trim, kses, special chars for string saves<br />
    $filters = array( 'pre_term_name', 'bb_pre_forum_name', 'pre_topic_title' );<br />
    foreach ( $filters as $filter ) {<br />
    add_filter( $filter, 'strip_tags' );<br />
    add_filter( $filter, 'trim' );<br />
    add_filter( $filter, 'bb_filter_kses' );<br />
    add_filter( $filter, 'wp_specialchars', 30 );<br />
    }<br />

    to

    <br />
    $filters = array( 'pre_term_name', 'bb_pre_forum_name', 'pre_topic_title' );<br />
    foreach ( $filters as $filter ) {<br />
    add_filter( $filter, 'strip_tags' );<br />
    add_filter( $filter, 'trim' );<br />
    add_filter( $filter, 'bb_filter_kses' );<br />
    add_filter( $filter, 'wp_specialchars', 30 );<br />
    add_filter( $filter, 'stripslashes' ); // <-- this is the new line I added<br />
    }<br />

    This strips out the slashes for me down to one. So in the above topic title, on the BBPress side, I would now see: \"Testing\" \'single-quotes\' / \ and stuff!

    At this point I was pretty much like WTF…but then I poked around a bit more within the same file and changed this chunk of code:

    <br />
    // Format Strings for Display<br />
    $filters = array( 'get_forum_name', 'topic_title', 'bb_title', 'bb_option_name' );<br />
    foreach ( $filters as $filter ) {<br />
    add_filter( $filter, 'wp_specialchars' );<br />
    }<br />

    to

    <br />
    // Format Strings for Display<br />
    $filters = array( 'get_forum_name', 'topic_title', 'bb_title', 'bb_option_name' );<br />
    foreach ( $filters as $filter ) {<br />
    add_filter( $filter, 'wp_specialchars' );<br />
    add_filter( $filter, 'stripslashes' ); // <-- this is the new line I added<br />
    }<br />

    I haven’t tested this very deeply but so far it seems to fix my problem, it removed all the slahses…including any I type in purposefully. What worries me is that Chris was only seeing a single slash and just the first chunk of code fixed it for her. We followed the exact same steps for installing.

    Here’s some more info in case it’s needed about my PHP / MySQL set up:

    I’m using MAMP on Mac OS X. I have it set up to work with my local host, which I reference not by ‘localhost’ but by an IP address. E.G.: http://192.168.1.1/my-site-name

    MySQL charset: UTF-8 Unicode (utf8)

    MySQL connection collation: utf8_unicode_ci

    PHP Version 5.2.6

    magic_quotes_gpc On On

    magic_quotes_runtime Off Off

    magic_quotes_sybase Off Off

Viewing 2 replies - 1 through 2 (of 2 total)
  • @jsonb123

    Participant

    Okay, so it seems your content areas are stripping out my backslashes that I’m trying to show as an example, even with the code tag around them. :-(

    The first BBPress example should be:

    triple-backslashes for every single-backslashes that shows in my post above

    The one after my FIRST fix should show a single backslash before each of these characters ” ‘ and (back-slash character)

    @jsonb123

    Participant

    UPDATE: I just installed it online at http://bp.jason-boyle.com. You can access the forums at http://bp.jason-boyle.com/forums…I haven’t put the button in the navigation yet.

    I am still experiencing this problem…however I will not fix it here in case anyone wants to check it out. Just look at the topics I’ve posted in Groups on BuddyPress and the same topics reflected on the BBPress side at http://bp.jason-boyle.com/forums.

    If no one responds to this in the next day or so though I’m going to put my crappy fix on it. Let me know if you want to poke around a bit on it, maybe I could set up a temporary FTP for just that folder so you can see my code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How I got my WPMU 2.7.1 / BuddyPress 1.0 / BBPress Alpha 6 to behave.’ is closed to new replies.
Skip to toolbar