Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 sr_erick's Sub-forums MOD
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 7

AnonJr
Moderator

United States
5768 Posts

Posted - 02 February 2006 :  17:19:34  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.<

Edited by - AnonJr on 27 February 2006 19:46:10

AnonJr
Moderator

United States
5768 Posts

Posted - 02 February 2006 :  22:17:34  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.<
Go to Top of Page

Bassman
Junior Member

Netherlands
256 Posts

Posted - 03 February 2006 :  09:22:00  Show Profile  Visit Bassman's Homepage  Reply with Quote
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)<

Edited by - Bassman on 03 February 2006 09:23:14
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 03 February 2006 :  09:44:33  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
Demo anywhere ?<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 03 February 2006 :  09:57:25  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Bassman, I'll check out the new layout this afternoon. I'm always looking for ways to spruce up the design.

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?<
Go to Top of Page

Bassman
Junior Member

Netherlands
256 Posts

Posted - 03 February 2006 :  10:04:49  Show Profile  Visit Bassman's Homepage  Reply with Quote
I don't have a live demo, a screenshot maybe?


AnonJr, deleting is working fine as far is I can see.<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 03 February 2006 :  10:33:48  Show Profile  Visit MarcelG's Homepage  Reply with Quote
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 ?<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 03 February 2006 :  11:44:35  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.<
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 03 February 2006 :  13:51:30  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
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?
<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 03 February 2006 :  14:06:31  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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? )

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...<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 05 February 2006 :  09:46:29  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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 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.<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 07 February 2006 :  23:22:25  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Added Bassman's fix to the download. Thanks.

Also noticed another problem - If a post is made in a sub-forum it doesn't change the icon in either the sub-forum or the parent forum. The sub-forum icon should be a simple issue when I get a chance...

[edit]
Made a small oops when uploading the updated Zip... its fixed now.
[/edit]<

Edited by - AnonJr on 08 February 2006 06:36:07
Go to Top of Page

Bassman
Junior Member

Netherlands
256 Posts

Posted - 27 February 2006 :  09:39:15  Show Profile  Visit Bassman's Homepage  Reply with Quote
quote:
Microsoft VBScript runtime error '800a0006'
Overflow: 'cint'

/default.asp, line 549




Response.Write "<td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""top"">" & _
"<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & 0 + cInt(arrSubInfo(2)) & "</font></td>" & vbNewLine
else
Response.Write "<td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""top"">" & _
"<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & cInt(ForumCount) + cInt(arrSubInfo(2)) & "</font></td>" & vbNewLine
end if 
If ForumLastPost <> "" And (arrSubInfo(3) = "none" Or ForumLastPost > arrSubInfo(3)) Then



Red is sepose to be line 549, no idea way.

Anyway, it happens after more the 8 forums are added

Link to forum
http://wj.scoutingforum.nl/<

Edited by - Bassman on 09 December 2007 10:10:43
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 27 February 2006 :  10:53:33  Show Profile  Visit AnonJr's Homepage  Reply with Quote
huh... I've got 9 subforum in a couple of places on the server at work (behind a firewall...) and it shares the server with a bunch of other programs...

I don't have quite that many over at Warsong Records...

Got a text version of default.asp?


Edit - Just took a second look, and I bet that Int is too small for the number of combined posts that you have. Try changing all instances of CInt() to CLng().

Let me know if it works and I'll update the package.<

Edited by - AnonJr on 27 February 2006 11:57:05
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 27 February 2006 :  12:01:19  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Now that I really look at it, I bet the problem is that Int isn't big enough.

I noticed that the forum above has 30582 posts... the largest number you can stuff in an Int is 32767 and I'll bet the combined post count for the forum causing the trouble is larger than that.

Changing to Long should fix it. There's 6 places in default.asp to change cInt to cLng; and two places in inc_subforum.asp.

I'll send myself an email to update the source tonight.<

Edited by - AnonJr on 27 February 2006 12:09:06
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 27 February 2006 :  12:10:56  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Oh, and for those who don't know, max value for a Long is 2,147,483,647.

If you hit problems with post counts being larger than that, please let me know how you got that much traffic. <
Go to Top of Page
Page: of 7 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07