Skip to:
Content
Pages
Categories
Search
Top
Bottom

[p] showing up in group forums and activity, with bp 1.0.2 and latest php+libxml


  • plrk
    Participant

    @plrk

    (I started a new thread because the old one is marked as “Resolved”. This is not resolved.)

    I have psuedo-bbCode – really HTML tags with [ instead of < – showing up in my Activity and in my Group Forums. It only affects forum posts in the activity feeds, the other stuff is fine. The “bbPress side” of the group forums also look fine.

    I am running:

    – BuddyPress 1.0.2

    – WordPress MU 2.7.1

    – bbPress 1.0.1 (with buddypress-enable.php from BuddyPress 1.0.2)

    – PHP 5.2.9

    – libxml 2.7.3

Viewing 13 replies - 1 through 13 (of 13 total)
  • I’m assuming you’re using a bbCode plugin of sorts? Which one? Are you using one on the forums as well?


    Burt Adsit
    Participant

    @burtadsit

    Plrk you don’t need the buddypress-enable.php plugin anymore. It was a fix for the libxml issue. Disable that.


    Burt Adsit
    Participant

    @burtadsit

    plrk noticed that with the bp enable bbpress plugin disabled that we lost usernames and avatars in group forums. This patch works for me with bp trunk and bbpress 1.0 in group forums.

    https://trac.buddypress.org/ticket/848


    plrk
    Participant

    @plrk

    Unfortunately, the patch does not work for me. I am however not running from the trunk, I am running 1.0.2. I suppose something differs that affects this issue…

    ipstenu: no, I am not running any bbCode plugins.


    Burt Adsit
    Participant

    @burtadsit

    I installed 1.0.2 and then the patch. That works as well. Perhaps the difference is in the bbpress versions. Are you running v1.0 or v1.0.1 of bbpress?


    plrk
    Participant

    @plrk

    Burt was told via IRC that I am running 1.0.1 (as it says in my starting post).

    However, we weren’t able to squash the bug. I am working on a “fulhack” (a Swedish programming term that is very useful – literally “ugly hack”) that will work around it.


    plrk
    Participant

    @plrk

    The hack:

    <?
    // Fulhack for fixing obscure [p] bug: see
    // https://buddypress.org/forums/topic/p-showing-up-in-group-forums-and-activity-with-bp-102-and-latest-phplibxml

    function fulhack_for_fixing_p_bug($string) {
    $string = preg_replace("#\[a href=\"([^<]+)\"\]([^<]+)\[/a\]#i", "<a href=\"\\1\" target=\"_blank\">\\2</a>", $string);
    $string = str_replace("[p]", "<p>", $string);
    $string = str_replace("[/p]", "</p>", $string);
    $string = str_replace("[ol]", "<ol>", $string);
    $string = str_replace("[/ol]", "</ol>", $string);
    $string = str_replace("[ul]", "<ul>", $string);
    $string = str_replace("[/ul]", "</ul>", $string);
    $string = str_replace("[li]", "<li>", $string);
    $string = str_replace("[/li]", "</li>", $string);
    $string = str_replace("
    ", "<br />", $string);
    return $string;
    }
    add_filter( 'bp_get_the_topic_post_content', 'fulhack_for_fixing_p_bug' );
    ?>


    plrk
    Participant

    @plrk

    The regex is missing some slashes though… if someone needs help figuring the proper regex out, contact me (through writing a reply to this topic, par example) and I’ll give it to you.


    Burt Adsit
    Participant

    @burtadsit

    I was just talking about this issue with jjj on irc. This bp helper plugin provides data that isn’t normally sent over to bp as well as escaping the html <> brackets. plrk is right. The patch only works in the forum templates not the topic templates. I can’t patch the topic templates because it’s not getting user id info without the bp helper plugin activated.


    Burt Adsit
    Participant

    @burtadsit

    In 1.0.2 the support for the bbpress helper plugin was pulled out. This ticket: https://trac.buddypress.org/ticket/853 has the essentials for re-enabling the helper plugin support in 1.0.2.

    I stuck the ticket’s attached code into bp-custom.php and it works from there fine. I don’t see any need to hack up a bunch of core files. This is going to be a temporary situation.

    We need to still run the bbpress helper plugin and the support code in bp 1.0.2. Nothing is gonna work right otherwise.


    plrk
    Participant

    @plrk

    My hack above should also go into a bp-custom.php (or similar), but I’d use Burt’s code snippet instead.


    Burt Adsit
    Participant

    @burtadsit

    All I did was hunt down the filters and functions that used to be in bp to support the helper plugin. Let me know if I missed any spot. I tested activity and the group forums templates.


    thebloghouse
    Participant

    @thebloghouse

    Which code snippet addresses this issue on bp 1.02 then as I am confused?

    If you can post your final code Plrk I am happy to give that a try :)

    EDIT – just tried adding Burt’s into my bp-custom.php (using 1.0.1) and got a white screen of death…

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[p] showing up in group forums and activity, with bp 1.0.2 and latest php+libxml’ is closed to new replies.
Skip to toolbar