WordPress.org

Ready to get started?Download WordPress

Forums

Punbb (3 posts)

  1. joshmac
    Member
    Posted 9 years ago #

    I am using punbb message board and I am wanting to connect it to my wordpress blog that when I post an entry in the blog, it is also posted in the forum for comments. Sort of what NP_PunBB does for nucleus. Does anyone know of a plugin that that might do the trick? If I new how to begin I would try to write a plugin, but I would not even know where to begin.

  2. Denis de Bernardy
    Member
    Posted 9 years ago #

    start like this:

    function wp2punbb( $id )
    {
    global $wpdb;

    /*
    * fetch and process wp data
    **/
    $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID = '$id'");

    if ( !$posts )
    return $id;

    $post = $posts[0];
    $title = apply_filters('the_title', $post->post_title);
    $content = apply_filters('the_content', $post->post_content);

    /*
    * insert into punbb as appropriate
    */

    // likely a simple insert query

    return $id;
    }

    add_filter('post_publish', 'wp2punbb');

  3. joshmac
    Member
    Posted 9 years ago #

    Thank you very much. I will start working on this and hopefully come out with something good.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags