Topic: Integrating PunBB with Article-posting CMS ?

Hello,

I have a CMS that manages article posting, and I would like to integrate a forum into it. This is how I want to integrate it :

/////////// BEGIN ARTICLE PAGE ///////////

Article Title

Blah Blah Blah
Blah Blah Blah
Blah Blah Blah
Blah Blah Blah

Link : "Discuss Article In Forum" <---- When a first user clicks this, a new thread is created on the forum with an identical thread name as the article. ( or if another user already started the discussion, he/she is just taken to the already existing thread ). The thread needs to be displayed both in the forum itself, and right under the Article itself.

Article Discussion

John_Doe : This article suxxors!
Kaiser_Sose : Rulz!
Castor_Troy : Yaaay!

/////////// END ARTICLE PAGE ///////////

So essentially I am using external webpage to write to the forum ( create new thread ), as well as import particular thread from the forum and display on the webpage. Is this possible? Im more or less grounded in PHP and if PunBB has certain variables for threads and posts I can use externally, this could probably be achieved.

Your comments?

peace,

Magomed

2

Re: Integrating PunBB with Article-posting CMS ?

Check this out: http://punbb.org/forums/viewtopic.php?id=6278

3 (edited by Riklaunim 2005-07-27 19:19)

Re: Integrating PunBB with Article-posting CMS ?

I have my RkCMF integrated with punBB, RkCMF is a CMF/CMS for managing text data and "Add a comment" for articles and news uses forums for that smile
article: http://www.cms.rk.edu.pl/art_222.html
comments in: http://www.cms.rk.edu.pl/forum/viewtopic.php?id=262
Topic is "Created" by admin but with user name art_ARTID or news_NEWID smile and it is used to search/locate topic for comments. Currently I've released RkCMF 2005.07 Test 1 and stable is the next release which will have english installer (punBB installer is lang-hardcoded) and It will have an english support site smile

a part of a class
///
function create_comment($message, $poster, $subject)
    {
    global $config;
    $posted = time();
    $last_post = $posted;
    $forum_id = $config['comment_forum'];
    IF(!punapi::query('INSERT INTO '.$this->db_prefix.'topics (poster, subject, posted, last_post, last_poster, forum_id) VALUES(\''.$poster.'\', \''.$subject.'\', \''.$posted.'\', \''.$last_post.'\', \''.$poster.'\', \''.$forum_id.'\')'))
        {
        echo 'error1<BR>';
        }
    $topic_id = punapi::insert();
    IF(!punapi::query('INSERT INTO '.$this->db_prefix.'posts (poster, poster_id, message, posted, topic_id) VALUES(\''.$poster.'\', 2, \''.$message.'\', \''.$posted.'\', \''.$topic_id.'\')'))
        {
        echo 'error2<BR>';
        }
    $post_id = punapi::insert();
    IF(!punapi::query("UPDATE ".$this->db_prefix."topics SET last_post_id='".$post_id."' WHERE poster = '".$poster."'"))
        {
        echo 'error3<BR>';
        }
    }
function are_comments($poster)
    {
    $result = punapi::query('SELECT id FROM '.$this->db_prefix.'posts WHERE poster=\''.$poster.'\'');
    IF(count($result) > 1)
        {
        $result = punapi::query('SELECT id FROM '.$this->db_prefix.'topics WHERE poster=\''.$poster.'\' LIMIT 1');
        foreach($result as $res)
            {
            return $res->id;
            }
        }
    else
        {
        return false;
        }
    }
function get_comment_id($poster, $message = false, $subject = false)
    {
    $result = punapi::query('SELECT id FROM '.$this->db_prefix.'topics WHERE poster=\''.$poster.'\' LIMIT 1');
    IF(count($result) == 1)
        {
        foreach($result as $res)
            {
            return $res->id;
            }
        }
    else
        {
        punapi::create_comment($message, $poster, $subject);
        return punapi::get_comment_id($poster);
        }
    }
My site [PHP, Python, Linux]