sr_erick's Sub-forums MOD - Posted (9697 Views)
Forum Moderator
AnonJr
Posts: 5768
5768
sr_erick's Sub-forums v0.2.2b
This MOD will allow you to add one level of sub-forums to your forums.
Ever since sr_erick was kind enough to share his work on this with me, I've been working to clean it up for release. I know that a few people have been interested in something like this and I'd like to put something back into the community... for a change.
This has only been tested with the base code and SBII, using Access on both.
As for the zip, it contains an updated readme and a new version of the subforum code.
I'll try to keep a link to the most current code in this post.
If you would like to see it in action, go over to the Warsong Records forum.
Enjoy!
------------------------------------------
  • 07 Feb 2006 - Added the display fix Bassman made for the Standard Code version
  • 27 Feb 2006 - Fixed a problem with post counts over what an Int can handle (as noted in post 14)
------------------------------------------

You can download a copy here.
You can see the original discussion here.<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
In the original thread there had been some problems noted with MySQL and possibly Image's forum - I'm not sure which it is....
I could really use some help testing the MySQL since my home web server is being cannibalized for other projects.
There are still a few other bugs to work out (aren't there always), hence the beta designation. I'm currently using this at work on a production forum and haven't had to worry about too much.
Right now I need to set it up so that deleting a parent forum will either delete all child forums or promote them so they show under the parent's category.
I also need to set it up so that hidden forums aren't listed on default.asp in the parent's description.
I'll try to get this up on the Warsong Records forum this weekend. Before I install this I need to finish some custom work.<
Posted
Junior Member
Bassman
Posts: 256
256
Thanks AnonJr for the mod. Installing on a new forum within 10 min.
Just one thing, can I suggest a better layout for the sub forums? I made the changes to inc_subforum.asp to fit the Snitz forum looks.
Download it here (Right mouse button, save target as)<
Posted
Support Moderator
Podge
Posts: 3776
3776
Demo anywhere ?<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Bassman, I'll check out the new layout this afternoon. I'm always looking for ways to spruce up the design. bigsmile
Podge, I plan on installing this on the Warsong Records forum this weekend. I've got to finish some custom coding that Bobby wants done first.
Any suggestions on the problem related to deleting parent forums?<
Posted
Junior Member
Bassman
Posts: 256
256
I don't have a live demo, a screenshot maybe?

AnonJr, deleting is working fine as far is I can see.<
Posted
Retired Support Moderator
MarcelG
Posts: 2625
2625
Nice work! Regarding the parent forums deletion ; I think you should block the possibility to delete a parent forum, if there are non-empty subforums within that parent forum.
Can you btw move a subforum from one parent-forum to another ?<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
You can move a subforum from one parent to another. You edit the forum properties just like any other forum. The "Category" dropdown is replaced by "Parent Location" which can be a Category or a Forum.
As to deleting, you can delete a subforum without problems. The issue comes when you delete a parent forum, any child forums become orphaned and inaccessible unless you type the URL by hand. If you've moved a top-level forum to a child position, its not an issue. But, if you create the forum as a child from the start it never gets a category designation and will therefore not show up if the parent is deleted.
I hadn't thought of simply blocking the deletion of parent forums (who have children). I was actually considering figuring out a way to ask if you wanted to delete or promote all child forums, and act accordingly.... I think your idea is going to be easier to implement this time around.<
Posted
Support Moderator
Podge
Posts: 3776
3776
The way I see it, you have two choices.
1. If you delete a parent forum, all topics in it and set immediate child forums F_PARENT_ID to null the children of the parent forum you just deleted should appear on default.asp with all topics and sub forums intact.
2. Use a "recursive join" to find all sub forums - http://www.4guysfromrolla.com/webtech/sqlguru/q120899-1.shtml
Delete all subforums & topics.
I think the second option would be more in line with present Snitz behaviour (you delete a forum and all topics are deleted too).
Third option which I haven't fully thought out yet.
Have a "deleted stuff" forum which appears on default.asp. All topics or forums with a forum_id or f_parent_id of 0 could go here e.g. if you delete a subforum you just set its f_parent_id to 0. All topics & sub_forums would immediately appear in the "deleted stuff" forum on default.asp. If you delete a sub forum in the "deleted stuff" forum you would iterate through all subforum & topics and delete them.
How do other forums handle this? <
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
hmmm. I'll have to think on that one.

On the one hand, I'd like to keep the behavior as consistent with the rest of the forum as possible.
On the other hand, I'm sure that there will be a fair number of occasions where people will want to delete just the parent forum, and making the promotion of the child forums automatic will help act as a fail-safe for those lovely "oops" moments. (But everybody backs up first, right? wink)

BTW, which ever way I go I'm glad you passed along that link to "Recursive Joins" - that's something I'd been wondering about and had never found a good enough answer... of course it helps to use the right terms when searching...<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Bassman, thanks for the fix in the standard code. I'll get it in the download on Monday.
With the cable out when I got home Monday sad I wasn't able to get the custom work I'd wanted to get done done. However, I did install the subforums this morning on the Warsong Records site. If you're looking for a demo, go there.<
You Must enter a message