Gossamer Forum
Home : Products : Gossamer Forum : Discussion :


Quote Reply
I want to import some old "News" stuff into my "Announcements" forum, but I don't want my users to notice that straight away. So I was thinking of just manually adding posts to the "Post" table (with the dates when the "News" were actually new...).

In order to to that, I need a way to compute "post_unique_id", so what is the algorithm used for this?

Would there be any other things I have to do? (Probably also update the "forum_total" and "forum_total_threads" fields in the "Forum" table.

Thanks for your help.

Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] post_unique_id In reply to

Easiest thing to do is:

my $post_db = $DB->table('Post');
my $fields;
$fields->{post_username} = 'USERNAME';
$fields->{user_id_fk} = 123;
$fields->{forum_id_fk} = 456;
$fields->{post_root_id} = 0;
$fields->{post_father_id}= 0;
$fields->{post_depth} = 0;
$fields->{post_time} = time;
$fields->{post_subject} = 'subject';
$fields->{post_style} = 2; # Markup
$fields->{post_message} = 'message body';
$fields->{post_ip} = '';
$post_db->insert($fields) or warn "can't insert: $GT::SQL::error";

will insert a post for you and handle all extra tables properly.


Gossamer Threads Inc.