1

Topic: 1.2

Rickard,

Sorry if this is already posted somewhere, but do you have an expected release date for PunBB 1.2?

dmz

Re: 1.2

Soon :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: 1.2

I'm looking forward to 1.2 and yet fearing it. I've put a lot of effort into hacking punbb to bits, and I'm not really looking forward to doing it again. However, some of the new features (such as user groups) look so very enticing...

I like soup.

4 (edited by dmz 2004-11-23 05:33)

Re: 1.2

I downloaded and installed the dev version to play around with last night.  I was getting some wacky errors in some of the display fields of the admin forms, but now I don't recall where exactly.  Overall, its a marked improvement to the existing version, though.  Pretty cool stuff.

I want to hack PunBB/MovableType so my most recent MT post auto-generates a thread topic in PunBB, but didn't want to mess with it until the next release is available.  Or has someone already done something similar?  This way, I can disable comments in MT (and avoid comment spam), and have an excuse to use Rickard's software.  wink

Re: 1.2

dmz wrote:

I downloaded and installed the dev version to play around with last night.  I was getting some wacky errors in some of the display fields of the admin forms, but now I don't recall where exactly.

If you encounter them again, don't hesitate to send the errors to me.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6

Re: 1.2

dmz wrote:

I want to hack PunBB/MovableType so my most recent MT post auto-generates a thread topic in PunBB, but didn't want to mess with it until the next release is available.  Or has someone already done something similar?  This way, I can disable comments in MT (and avoid comment spam), and have an excuse to use Rickard's software.  ;)

That's been my idea also, disable commenting, pass it over to PunBB.

There was a plugin written to do the same for Blog:CMS and ported over to Nucleus.

You can see it at my .net site using PunBB 1.1.5 as the backend forum.

The plugin has been enhanced in Blog:CMS for PunBB 1.2, showing you the replies at the forum for said topic among other enhancements.

7

Re: 1.2

Sweet.  I'll check it out tonight after work.

dmz

Re: 1.2

dmz wrote:

I want to hack PunBB/MovableType so my most recent MT post auto-generates a thread topic in PunBB, but didn't want to mess with it until the next release is available.  Or has someone already done something similar?  This way, I can disable comments in MT (and avoid comment spam), and have an excuse to use Rickard's software.  wink

Just raising this thread up. Has anyone done this yet? Any mod for it? Looks like a comments mod for MT and WP would be very popular?

9 (edited by dmac 2005-06-07 23:39)

Re: 1.2

Ok, I have attempted to do this and have been partially successful.  I have written a PHP script that will make a post in punBB from outside the punBB folder on the server.  It is as follows:


<?


define('PUN_ROOT', './forum/'); require PUN_ROOT.'/include/common.php';
require PUN_ROOT.'/include/search_idx.php';
// require PUN_ROOT.'/botlogin.php';

$now = time();
$message = "this is a test";
$subject = "this is a test";
$fid = 13;
$username = "username";
$hide_smilies = isset($_POST['hide_smilies']) ? 1 : 0;
$email = "email@email.com";


// Create the topic

    $db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, last_poster, forum_id) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', '.$now.', \''.$db->escape($username).'\', '.$fid.')') or error('Unable to create topic', __FILE__, __LINE__, $db->error());

    $new_tid = $db->insert_id();

// Create the post ("topic post")

    $email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
   
    $db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', 12, \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
    $new_pid = $db->insert_id();

    $db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', 12, \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\'');
    $db->query('UPDATE '.$db->prefix.'topics SET last_post_id='.$new_pid.' WHERE id='.$new_tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());



    update_search_index('post', $new_pid, $message, $subject);



    update_forum($fid);

    $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';

    $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());

?>


The only task now is to incorporate it into MT.  Since the script can be used outside the punBB folder then MT tags can be used for the title of the thread and so on.  Any suggestions on integrating it so that the script will be ran once and only once when a new MT post is published?