benzilla069 (@benzilla069)

Forum Replies Created

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

  • benzilla069
    Member

    @benzilla069

    Hi Chris, I also usually get this problem. I’ve been meaning to document it to the developers but I found a quick fix if you are comfortable in phpmyadmin, unfortunately I’m about to leave for the night so I can’t whip up a PHP script for you.

    The problem is, as it’s mentions that the forum in the database cannot be created and when you try to visit the site it tries to keep finding the first database which is not there and it keeps redirecting forever.

    To fix it, goto the bb_forums table and just insert a record of any data you please(forum_id needs to be 0 iirc or it might be 1) the rest can just be dummy data.

    That will fix it.

    In reply to: bbSync

    benzilla069
    Member

    @benzilla069

    Hi I do have a version working(I downgraded bbpress to the last version bbsync worked because I was tired of using a alpha version of bbpress) it’s completely new code, but it’s very basic on the feature set and a bit hacked together, as I could never get the bbpress functions to work in a wordpress plugin.

    I’m at a public library at the moment so I don’t have the code with me but I can work on the code a little bit when I get home.

    Also please note, this was just made for me and I probably have different needs to what you needed, for example I wanted all wordpress posts to make a new topic so there isn’t options on a per post basis to post to a forum. Also comments don’t replicate between bbpress and wordpress(I was just going to disable commenting and make all users use the topic) but depending on how much time I have tonight I might add this functionality as I don’t see the difficulty in it.

    Also F.Y.I. if anyone is interested I do it the úber ghetto way and manually manipulate the database and don’t go through any of the wordpress or bbpress functions so use at your own risk, but I haven’t run into any problems on my test site.

    In reply to: Permalinks Not working

    benzilla069
    Member

    @benzilla069


    benzilla069
    Member

    @benzilla069

    Ah sorry I explained what I want wrong.

    I already have the wikipost section sorted out, when someone puts something in [wiki]pagename[/wiki] I wan’t it to create a new topic that will be wiki enabled. Just like in mediawiki when you use the pagename and it creates a new page.


    benzilla069
    Member

    @benzilla069

    Well I just want it to detect when [wiki]pagename[/wiki] is used so I can run a bit of code(I’m currently modifying your wikipost script to be more of a wiki system.) I want it to create a new post and link to that post.

    Looking at the code again I’m starting to wrap my head around what’s going on.

    $simple = array('b' => 'strong',); // cut and copied example

    Turns all instances of into the html equivalent <center></center> but I just want it to recognise all instances of [wiki]wikipagename[/wiki] and then allow me to run code. I’ve been tinkering with the code most of the day but most of the time it seems to want to run the code I’ve written for all the posts and not just one 😡


    benzilla069
    Member

    @benzilla069


    benzilla069
    Member

    @benzilla069

    Try logging in and out, I sometimes get this problem and that fixed it.


    benzilla069
    Member

    @benzilla069

    Weird, it works for me. What seems to be the problem with it?


    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.


    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

    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

    This is completely out of left field with this suggestion, but I had similar problems with the redirection errors like you but I don’t use WPMU so this might not apply.

    I honestly can’t remember if I changed any of the chmod settings, I think I might of changed them all the files to 777.

    But also in the setup when it asks you in the wordpress integration stage when it asks you to fill in the xxx_xxx_salt settings from the wordpress just leave them blank.

    Might help for you.

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