Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Forum creation via script or command

Quote Reply
Forum creation via script or command
Jason,

We would like to use Gossamer Forum for discussions not appropriate for our regular email system. We are looking for a way to create a forum via a script or command so we can give the user the option of creating a forum and then a script will do the work for them behind the scenes.

Thanks, Norm.
Quote Reply
Re: [Sutekh] Forum creation via script or command In reply to
I use a script to make a forum when a person wants to discuss an article. The real trick is to have it check for a prior thread first before creating it and then changing the link that was used to create the thread into a direct link to the newly created thread.

It works great but requires InteractiveTools Article Manager to work.

I am sure that GT or the other fine developers here could put something together for an alternate application though.



Good luck!Smile
Quote Reply
Re: [Sutekh] Forum creation via script or command In reply to
A command line script to do this is fairly simple; basically:

perl -I/path/to/admin -e 'use GForum qw/$DB/; GForum::init("/path/to/admin"); my $i = $DB->table("Forum")->add({ forum_name => "Forum Name", cat_id_fk => 24 })'

That will use the defaults for everything other than forum name - take a look at the other columns in the gforum_Forum table to see other values you can pass in. Note that you'll have to specify the bits in red - the forum name, and the category in which to create the forum.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Forum creation via script or command In reply to
Jason,

Where would you put this code? If users are adding forums, is there a way for the sort order to constantly update alphabeticly?

To put some control on the situation, is it possible for you to add a link, like REQUEST A FORUM. The resulting page takes the data that you are looking for and holds it, notifies the admin that there is a pending request, and allows them to officially authorize the new forum?

I currently have a forum for REQUEST NEW BOARDS HERE - and have to manually enter the info into the admin console - this looks like a way to automae that process.
Quote Reply
Re: [shiner] Forum creation via script or command In reply to
Jason
Do you have a one liner that will add a post (character string) to a forum ?

Bob