Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbsync broken – plugin like it? BB 1.0


  • benzilla069
    Member

    @benzilla069

    As per title, bbsync is now dead with the 1.0 release, is there a working plugin with roughly the same features?

    When I go to publish the post(does not matter if I have set it to post to it or not)

    Fatal error: Call to a member function on a non-object in /bbpress/bb-includes/functions.php on line 20

Viewing 6 replies - 1 through 6 (of 6 total)
  • bbSync is very, very broken right now.

    But the good news is it’s broken for me, too, so I’ll try to fix it – in september.

    bbSync has always had its (not inconsiderable) problems, so don’t let that stop someone else writing a new implementation for what bbSync tried to do – or stop them from just fixing bbSync themselves.


    benzilla069
    Member

    @benzilla069

    Yeah I’m currently just messing about with it at the moment, I’ve stripped it down to what I believe are the bare essentials… please note I don’t have any PHP experience but I do have other languages like C under my belt so I’m getting the hang of it ok.

    <?php
    /*
    Plugin Name: WordPress to BBPost hacked by Ben
    */

    add_action('publish_post', 'bensyncpost', 999 );

    /* CORE */
    function load_bb() {
    global $bb, $bbdb, $bb_current_user, $page, $bb_cache,
    $posts, $bb_post, $post_id, $topics, $topic, $topic_id,
    $forums, $forum, $forum_id, $tags, $tag, $tag_name, $user, $user_id, $view,
    $del_class, $bb_alt;
    }

    function bensyncpost( $post_id ) {
    global $bbdb, $wpdb, $current_user;

    $post = wp_get_single_post( $post_id );

    if( !load_bb() )
    return false;

    bb_set_current_user( $current_user->ID );

    $post_title = $bbdb->escape( $post->post_title );
    $post_text = benprepposttext( $post->post_content, get_post_meta( $post_id ) );

    if( !$link_exists ) {
    bennewtopic( $post_id, $post_title, $post_text );
    }
    }

    function bennewtopic( $post_id, $post_title, $post_text ) {

    $topic_id = bb_new_topic( $post_title, 2, $tags );
    $reply_id = bb_new_post( $topic_id, $post_text );

    /* if( $topic_id && $reply_id ) {
    felmetalink( $post_id, $topic_id );
    $r = true;
    }*/

    return $r;
    }

    function benprepposttext( $post_text) {

    remove_filter('pre_post', 'encode_bad');
    remove_filter('pre_post', 'bb_encode_bad');
    remove_filter('pre_post', 'bb_filter_kses', 50 );
    remove_filter('pre_post', 'allow_images_encode_bad', 9 );
    remove_filter('pre_post', 'allow_images', 52 );

    return $post_text;
    }

    ?>

    I got rid of the error, but it’s not propogating to the correct forum(I used the forum ID of 2 and I also tried just plain old “Site Posts” as the forum) need to debug some more, fel do you recognise anything plainly wrong with my hacked up code?


    benzilla069
    Member

    @benzilla069

    Ok, the only thing not working is getting the $bbdb is there a way to access the database from outside the bbpress directory?


    benzilla069
    Member

    @benzilla069

    I’m just trying ghetto solutions at the moment just to see if I can actually get something to work.

    $SQLtopic_id = 3;

    $SQLtopic_title = 'Test';

    $SQLtopic_slug = 'topic-test-slug';

    $SQLtopic_poster = '1';

    $SQLtopic_poster_name = 'admin';

    $SQLtopic_last_poster = 1;

    $SQLtopic_last_poster_name = 'admin';

    $SQLtopic_start_time;

    $SQLtopic_topic_time;

    $SQLtopic_forum_id = 1;

    $SQLtopic_topic_status = 0;

    $SQLtopic_open = 1;

    $SQLtopic_last_post_id = 1;

    $SQLtopic_topic_sticky = 0;

    $SQLtopic_posts = 1;

    $SQLtopic_tag_count = 0;

    //$SQLtopic_id, $SQLtopic_title, $SQLtopic_slug, $SQLtopic_poster, $SQLtopic_poster_name, $SQLtopic_last_poster, $SQLtopic_last_poster_name, $SQLtopic_start_time, $SQLtopic_topic_time, $SQLtopic_forum_id, $SQLtopic_topic_status, $SQLtopic_open, $SQLtopic_last_post_id, $SQLtopic_topic_sticky, $SQLtopic_posts, $SQLtopic_tag_count

    // set database server access variables:

    $host = “”;

    $user = “”;

    $pass = “”;

    $db = “”;

    // open connection

    $connection = mysql_connect($host, $user, $pass) or die (“Unable to connect!”);

    // select database

    mysql_select_db($db) or die (“Unable to select database!”);

    mysql_query(“INSERT INTO bb_topics (topic_id, topic_title, topic_slug, topic_poster, topic_poster_name, topic_last_poster, topic_last_poster_name, topic_start_time, topic_time, forum_id, topic_status, topic_open, topic_last_post_id, topic_sticky, topic_posts, tag_count)

    VALUES ($SQLtopic_id, $SQLtopic_title, $SQLtopic_slug, $SQLtopic_poster, $SQLtopic_poster_name, $SQLtopic_last_poster, $SQLtopic_last_poster_name, $SQLtopic_start_time, $SQLtopic_topic_time, $SQLtopic_forum_id, $SQLtopic_topic_status, $SQLtopic_open, $SQLtopic_last_post_id, $SQLtopic_topic_sticky, $SQLtopic_posts, $SQLtopic_tag_count)”);

    mysql_close($connection);

    Adds nothing to the database.

    this plugin is great!

    please, any updates for WP 2.6+ 1.0 Alpha?

    It worked for us, mostly. Using BBPress 0.9.0.2 and bbSync 0.94 gave us integration, and comments and users over to the BBPress site. We just lost comments on the WP side, and didn’t get permalinks back and forth.

    Would LOVE to have this working, as it was almost good enough even “broken.”

    How can we help, Felix?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar