Log in

View Full Version : Automatic Thread Creation?


Ian Cunningham
04-16-2004, 10:14 AM
I currently use my forums as an article system, and I would love a feature whereby my users can comment on the article in another thread.

Is there an automated way to make a secondary thread created in a new forum using the title from the origional post? This way, I could add a "discuss this here" link at the bottom of my article and users can comment on it.

I'm not sure how to start this, but I have a few thoughts. If the second thread is created almost instantly afterwards, then the threadid should be +1, making it very easy to link to automatically from the origional thread (As I can add a link in the templates).

Can anyone point me in the right direction?

Xenon
04-16-2004, 11:14 AM
well, just call the build_new_post function twice in newthread.php instead of just once
with different parameters of course ;)

Ian Cunningham
04-16-2004, 02:15 PM
The only instance I can see of that function is :

build_new_post('thread', $foruminfo, array(), 0, $newpost, $errors);

Is that the line I need to duplicate?

Is there any way to make it post everything into forum x, and only duplicate it if the origional thread is posted in a forum with parentid z or z?

Xenon
04-16-2004, 03:19 PM
exactly thats the line :)

so take that line and after it add:
if ($foruminfo['forumid'] == z OR $foruminfo['parentid'] == z)
{
$foruminfo = fetch_foruminfo(x);
build_new_post('thread', $foruminfo, array(), 0, $newpost, $errors);
}

that should work i think

Ian Cunningham
04-16-2004, 03:36 PM
excellent - got it working fine now :D

Thanks!

Xenon
04-16-2004, 03:40 PM
:)
you're welcome :)