zappoman (@zappoman)

Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)

  • zappoman
    Member

    @zappoman

    Looks like my problems come from Worpresses desire to add slashes to _POST (around line 527 of wp-settings, look for add_magic_quotes())… and bbPresses desire to do the same (calls to bb_global_sanitize() around like 140ish of bb-settings.php).

    I can work around this with a hack to either detecting if WP_BB is defined, is there a better way to do this?


    zappoman
    Member

    @zappoman

    An update: I got this working by doing “complex” integration of bbPress+Wordpress and now I run bbPress mounted at /forum/ but inside of bbPress it has access to all the WP functions and so my theme is able to run wp plugins, widgets, etc.

    I wrote a plugin (that happens to live in wp, but really it’s all the same now).. that hooks ‘bb_template’, ‘bb_get_forum_bread_crumb’, ‘get_forums’, ‘bb_index.php_pre_db’, ‘bb_forum.php_pre_db’, and a couple others.

    My plugin alows you to specify with “sub forum” is associated with a blog, and when you go to the forum page for that blog, it shows a fully functioning bbPress for that forum and below. It’s actually running bbPress, and this plugin, with access to the wordpress themes, widgets, etc.

    What’s cool about this is that my main bbPress site, which includes all of the forums, including these blog forums, shows all the forum content as well.


    zappoman
    Member

    @zappoman

    I am also looking for such a thing.

    I’ve been hacking on a WP plugin that will embed a forum into a page, but it’s not working yet.

    I’d love to find out if someone else has already built this.

    I am looking to embed a full fledged forum not just a feed. I want posting, navigation etc.

    So, let’s say you had wordpress at:

    http://example.com/

    And you made a wordpress page call /forum/

    And you wanted to embed bbPress there.

    Why is not not the same as running bbPress at /forum/?

    Well, I want wp to handle the rendering of the header, footer, sidebar, etc. I just want the page content to be bbPress.

    This may be related to this bug…

    https://trac.bbpress.org/ticket/934

    Basically if you have any template functions that depend on bb_get_forums_hierarchical() then you can’t have more than one of them on a page… so for example, any pages that show the hierarchical forums list and then also show bb_new_topic_forum_dropdown() will fail.

    Diff to fix included in the ticket.

    I’m actually seeing this happen where on the HOME page it doesn’t show the drop down, but on New Topic it does…

    This appears to happen in the 0.8.x codebase as well. I just never noticed it till now.

    I’m still digging deeper.

    In reply to: Redirecting Login

    I was seeing something similar and I found it relates to ADMIN_COOKIE_PATH in wp, and $bb->wp_admin_cookie_path in bbPress.

    In my case, I had bbPress located at domain.tld/forum/ for a wp install at domain.tld. If I set the wp ADMIN_COOKIE_PATH to /wp-admin/ as usual, then I got this behavior… but if instead I set it to “/” then things work fine.

    This may or may not be related to the issue you are seeing.

    This is new to the trunk… it is introduce by the function…

    function backpress_convert_object( &$object, $output ) {}

    Which was new since the alpha drop.

    (sorry for the duplicate ticket, I just deleted mine)

    Thanks Chris, I have filed a ticket on another issue I found, and I will file a ticket for this. But I’m more curious to find out if I’m really the only one seeing this issue. It seems like a pretty obvious issue, so I’m surprised no one else has noticed it… which leads me to believe that I must have done something wrong.

    As a developer, I hate when people file bugs before looking for a minimal reproduce case… and so I was just trying to ask if someone else has seen this before I file a bug ticket.

    Ok, more of a clue here…

    It looks like the insert into term_taxonomy is failing during the upgrade process.

    it appears as if, bb_term_taxonomy has a ‘description’ field which is NOT NULL in the schema:

    // term_taxonomy
    $bb_queries['term_taxonomy'] = "CREATE TABLE IF NOT EXISTS $bbdb->term_taxonomy (
    term_taxonomy_id bigint(20) NOT NULL auto_increment,
    term_id bigint(20) NOT NULL default 0,
    taxonomy varchar(32) NOT NULL default '',
    description longtext NOT NULL,
    parent bigint(20) NOT NULL default 0,
    count bigint(20) NOT NULL default 0,
    PRIMARY KEY (term_taxonomy_id),
    UNIQUE KEY term_id_taxonomy (term_id, taxonomy)
    );";

    but the upgrade code…

    $bbdb->insert( $bbdb->term_taxonomy, array(
    'term_id' => $term_id,
    'taxonomy' => 'bb_topic_tag'
    ) );

    does not set a description, so this insert is failing.

    Not sure how this could be working for anyone else…

    Am I really the only one seeing this?

    digging deeper…

    looks like something went wrong in the upgrade process… and tags didn’t get migrated properly into the new term_taxonomy structure.

    bb_terms appears to have been filled.

    bb_term_relationships has a bunch of rows.

    But… bb_term_taxonomy is empty…

    by the way, an even better way to implement this is to use the args of bb_forums() properly… namely if you change your theme to call bb_forums(“depth=1”) you will only get 1 level of forums on the page.

    This change can be made to the front-page or forum of your theme. If your theme calls bb_forums($forum_id) then it is asking for the child forums of the existing forum and you need to change the code to something like this… bb_forums(“depth=1&child_of=$forum_id”)

    In reply to: Integration questions

    Well, assuming I succeed in what I’m attempting, I will release it as an open source plugin for wordpress…

    But since I’ve had to make one hack to the bbPress core, it will unfortunately require one small bbPress core change.

    So, I’ll keep working on it, and post more here once I’ve made more progress.

    In reply to: Integration questions

    In the interest of sharing what I’ve learned so far, let me describe what I want to do, and what I’ve accomplished so far.

    1) I want to have a stand alone instance of bbPress running on my site that shows ALL the forums.

    2) I want to embed a single forum into a wordpress blog (actually a wordpressmu blog– but there’s nothing mu specific about my work so far)

    3) I want the forums to share the same DB, so if a topic is updated inside of my blog, I also see it updated in the standalone Forum.

    4) I want to be able to essentially allow the bbPress template functions to work inside of a wp page or post… ideally I’d like to implement a simple function like “embedd_bbpress_forum()” on a page template and have it display a fully functioning bbPress instance in the page.

    5) I want to use the chrome/theme from wordpress for the header, sidebar, footer, etc… but I also want to support the basic bbpress template structure as well.

    So far I have this working about 90%…

    What I’ve done is build a WP-plugin, that “includes” bbpress/bb-load.php. And implements a couple functions for embedding the bbpress instance in a page or post or where ever you call the embed functions.

    Things that are working:

    * forum home page

    * topic pages

    * new topic

    * comments

    * profile pages

    * favorites

    Things that aren’t working yet:

    * ajax — none of the ajax stuff is working properly yet…

    * some pages that use wp_redirect – because of how I’m embedding in wordpress, the headers are already sent before I have a chance to do the redirect, so… some functions that rely on this are reporting errors.

    How I did this so far:

    * declare GOBALS!!! – This is the biggest “sneaky trick” – basically, most of bbPress is implemented outside of a function or class context, and so the “local” variables on the bbPress pages are actually global in context. Since I’m wrapping these into a wp-pluing, I need to declare them as explicitly global. If I get all the globals right, then bbPress just works.

    * turn off mod_rewrite support in bbPress… since I want my pages to get handled by WordPress, the URL needs to end at the same location of the wordpress page, this means that my forum page has a url something like:

    http://mydomain.com/blog/forumpage/?command=topic.php&id=1

    Notice I introduced the concept of the “command” parameter, that my plugin then uses as a dispatcher to “load” (include) the right bbPress file. MOSTLY bbPress will do the rest of it’s work from the URL params.

    * Lots of filters – I’ve implemented several filters for URL remapping so that bbPress will override the standard link formation to point to my new embedded page urls

    * A COUPLE HACKS – the only hard part I’ve had to hack so far relates to bbPress’s get_bb_location() function. This function appears to be a bit of bbPresses standard “dispatcher” which tells the rest of bbPress what type of page it’s supposed to be rendering. The only problem with this approach is that in my instance of the code base it does all this logic based on PHP_SELF, SCRIPT_FILENAME, or SCRIPT_NAME… which will be pointing to my wordpress files. I made a small change to add a new filter that allows me to pull out my command param and do the bb_location determination from that.

    Has anyone else attempted this? Have they gotten further? Is there an easier way?

    Mostly this isn’t a lot of code, it’s just discovering how to make it work and testing that everything works as planned.

    In reply to: Integration questions

    triipriit,

    WOW! This is awesome, I’m looking at this EXACT SAME QUESTION!!!

    I’ve been playing around for a couple days on this, and have made some progress, but I’m not 100% there yet…

    drop me an email at bradh at konamoxt dot com if you are interested in collaborating on this…

Viewing 15 replies - 1 through 15 (of 15 total)