Hi guys.
I'm not an old hand at this Drupal thing, and in all honesty I'm more of a Photoshop, HTML and CSS kinda guy (actually WAAAY more of a Canon EOS kinda guy... ;->), but I've certainly dived in as deeply as I could in the time I've been using your handiwork.
I've scoured the forums and gone through all the handbooks, and I'm all googled out...
So, please forgive me if this feature request has been taken up elsewhere, or if I'm out of line in any way. You guys are doing a fantastic job and I don't want to be wasting your time, as you carry on (and please do!) with it.

Now, to my request:
Could we build the OG forums module in such a way that it would be possible to stipulate a default set of containers and forums?
For instance, I create a set of containers, sub-containers, and forums within them, which I can then set as a default (automatic) configuration for use for every new group.
Presently, each new group is created with the "General Discussion" forum, and that's it.

As you can imagine this creates an administrative nightmare for someone who has to administer the creation of 1000's of new groups, and their containers and forums (unfortunately we cannot allow the og moderators to be responsible for this).

Again, please accept my apologies if I'm out of line.
If not, please accept my best wishes as you tackle this request.

God bless!

Paul

Comments

rconstantine’s picture

I suppose you don't just mean that you want to change the names of the default forum since you could just either hack the module file or use a translation since the name is t-ified. I assume you want a complex structure consisting of however many containers and forums you want and in any combination.

I don't think this is an easy thing to do within the og_forum module. It may be easier to do another module that responds to group creation and then drupal_executes the relevant og_forum forms or it could execute functions directly. Such a module would make a good companion module to og_forum and could be included in the tarball.

Did I describe what you're after accurately enough?

darren oh’s picture

Status: Active » Postponed (maintainer needs more info)
rconstantine’s picture

In rereading this, I still think that this would be a good add-on module.

rconstantine’s picture

Version: 5.x-1.3 » 5.x-2.x-dev
Status: Postponed (maintainer needs more info) » Postponed

In my last message I failed to note that the default forum name can now be set. So if you don't like "General discussion" as the default, you can change it. This does not address the need to create whole generic forum structures with multiple containers and forums in a single group; like I said above, this should be an add-on module to this project. I'm setting this to postponed because I may actually get around to doing it.

mightyiam’s picture

rconstantine, on the development side of things, it may be, as you say (i don't program), better to make this a separate module. On the user side of things, I fear this
could make the setting up process somewhat more complicated, if two modules are involved.

In whichever way you should choose to implement this feature, which I'm all for, btw, please keep this in mind.

PaulPhoto, welcome to Drupal! You have chosen wisely, my firend.

The path of reading documentation is a graceful one.

In this world of free software, the users, in this case you and I, play the important part of experiencing the developer's code. Supplying feedback in the form of bug reports, feature requests and support requests in an encouraging manner is appropriate and accepted with gratitude.

See you around - come and play with us in #drupal-support in freenode

rconstantine’s picture

@dawnlight - in case I've confused you, let me be clear in stating that I would create a separate module as a part of this project, similar to how CCK comes with several different modules which you have the option to use or not. Often, people refer to modules and projects interchangeably, but they are different.

I seem to recall confusing you elsewhere as well. Perhaps I need to be more verbose in my postings.

joshua_cohen’s picture

Status: Postponed » Postponed (maintainer needs more info)

Having a default template would be a greatly needed/appreciated add-on. I think a simpler solution than creating a whole separate module would be to make use of the default forum name field. Allow the user to type the name in as a seperated list, e.g. General Discussion 1;General Discussion 2;General Discussion 3. Then when the trigger is fired to create a new forum for the group, check this field and iterate through the list. I agree that long term a separate module may be the better solution, but coding wise this seems a bit easier. Obviously this would only have the capability of setting up the top level containers as well. If I get a chance I might take a whack at it. I'm changing the status just so this shows back up in the list of active items, feel free to set it back to postponed.

Thanks,

Josh

nath’s picture

Creating multiple forums with each new group would be something that would save us a lot of work too. Thanks for looking into this.

joshua_cohen’s picture

I have a working piece of code, will post later.

Josh

joshua_cohen’s picture

Title: Automatic Duplication of user-configured, default OG Forum setup, for each new group. » Patch
StatusFileSize
new67.83 KB
new2.5 KB

Well here goes. This is the first time I have created a patch file in Windows, so if anyone can confirm it works ok that would be great. I've also attached the entire module, just rename og_forum.txt to og_forum.module.

To use the new functionality, enter a semicolon delimited list in the default forum name field of the OG Forum administration page e.g. Forum1;Forum2;Forum3. When a new group is created, it will use the list of values to generate X number of forums. There is currently no limitation to the number of groups that can be created.

This patch is meant to be run against the 5.x-2.x-dev release. I've only done limited testing, but it seems to be working well for me.

Josh

joshua_cohen’s picture

Status: Postponed (maintainer needs more info) » Needs review

As it stands now, this will only allow the automatic creation of multiple forums under a single container. For my purposes, this works fine, but perhaps there is a need to be able to add multiple containers as well. Please let me know if anyone needs this functionality, I'd be happy to add it in. I might just do it anyway.

Josh

rconstantine’s picture

Title: Patch » Automatic Duplication of user-configured, default OG Forum setup, for each new group.

Do not change the title of the thread to something not describing the issue! Especially when there is the 'Status' that marks this as a patch.

Other than that, thanks for the patch. I'll review it this next week.

joshua_cohen’s picture

My apologies about the title. I thought I was changing a comment title, low and behold comments don't have titles. I'm going to spend some time today working on the ability to add multiple containers.

Josh

nath’s picture

Status: Needs review » Needs work

Your patch is the wrong way around (you switched old and new version). Apart from that, it seems ok. At least, when creating a new group, the forums are created. Thanks!

joshua_cohen’s picture

Oops, sorry about that! I also noticed I left a drupal_set_message line in there that should have been removed. On that note, I have created an entirely new version that allows for multiple containers and sub containers. I will attempt to get it released today.

Thanks,
Josh

joshua_cohen’s picture

Status: Needs work » Needs review
StatusFileSize
new70.15 KB
new4.71 KB

Ok here goes. This patch is a much more substantial change than the previous, and allows for multiple forums and containers/sub containers using nothing more than the default forum name field found in the OG_Forum admin page. There are now three variables to describe how to structure the forums.

C = New Container - The next value in the list will be used as the Container Name
P = Go back to the previous container
R = Go back to the root container

Here are a few examples of the output using this syntax in the default_forum_name field:

Forum1;Forum2;Forum3

Group Container
Forum1
Forum2
Forum3

Forum1;C;Container1;Forum2;Forum3;C;Container2;Forum4;R;Forum5

Group Container
Forum1
Container1
..Forum2
..Forum3
..Container2
....Forum4
Forum5

Forum1;C;Container1;Forum2;C;Container2;Forum3;C;Container3;Forum4;P;Forum5;R;Forum6

Group Container
Forum1
Container1
..Forum2
..Container2
....Forum3
....Container3
........Forum4
....Forum5
Forum6

As you can see the possibilities are endless. The one issue I have, is that in order to keep the forums displayed in the order they were entered in the default_forum_name field, I had to set the weight on each forum/container. This works great, but if there are more than 21 items, the weight will be driven past 10. I believe it will still work as advertised, however if there is ever a need to alter the forums afterward that have a value greater than 10, the forum administration page will only list weight values up to 10. They could manually be fixed in the db, but I'm not sure what the best solution is for this. I think in most cases this won't be an issue anyway.

So please test this patch out and report back any errors.

Again, I've attached both a patch and the entire module file just in case the patch doesn't work properly.

Josh

joshua_cohen’s picture

Just curious if anyone has had a chance to test this patch out?

Thanks,

Josh

rconstantine’s picture

Not yet. I'm working on updates for CCKTSSU and will get to og_forum next.

nath’s picture

Haven't tested the new patch as the old one does what we need.

joshua_cohen’s picture

No problem, thanks for replying.

Josh

Max_Headroom’s picture

Joshua
I've tested it on my Scratch Patch and it works like a charm. Just some polishing up of the ACP to make thinks more clear.
I'll vote this one up to be included in the future.
Suggestions: Creating and loading of template files with preset forums and containers (different templates for different type groups).
Better layout for the admin page (than using a single text box).

joshua_cohen’s picture

Great! Thanks for testing the patch. I agree that this isn't the best way to implement this feature, and at some point it would be nice to have a better way to implement multiple Forum templates. It's certainly not a "Drupaly" way to do things. This just seemed like the easiest way to gain the functionality without putting it off for months due to the complexity of creating a whole default Forum management module.

Josh

nath’s picture

We would also need a way to set a description for the automatically generated forums, wouldn't we?
That is not meant to keep this patch from going in, though. But when we redesign the UI for this, we should go all the way.

joshua_cohen’s picture

Adding that functionality to my patch should not be too big of a big deal. I'll take a look.

Josh

joshua_cohen’s picture

StatusFileSize
new5.7 KB

Here ya go. So now it's possible to add a description to a Forum or Container by separating the name by a comma followed by the description.

e.g. Forum1,This is the first forum;Forum2,This is the second forum;Forum3,This is the third forum

Group Container
Forum1
This is the first forum
Forum2
This is the second forum
Forum3
This is the third forum

I only tested this briefly but it seems to work as designed.

Josh

nath’s picture

That sounds great, thanks. I will test your patch.

rconstantine’s picture

@Paul

This seems like a valuable couple of patches. Consider adding these to 5 before the D6 conversion if they're easy enough.

Anonymous’s picture

Assigned: Unassigned »
Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

Hey Joshua,

The patch works a treat . We will get this pushed out in our next release.

@Ryan
Added to my working copy

Anonymous’s picture

Status: Reviewed & tested by the community » Fixed
joshua_cohen’s picture

Hey glad to hear this code is going to be used! It will definitely require a quick "how to" documented somewhere to be useful though.

Thanks,

Josh

Anonymous’s picture

Status: Fixed » Closed (fixed)

Thankyou Joshua for your contribution to the project .

Please download the latest development snapshop to get the above features , thanks.

kompressaur’s picture

Would it be possible to use a token in this syntax to give each forum an automatic title from the group? Something like-

General [groupname] Chit Chat;[groupname] Musicians Wanted, etc etc

thanks.