Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/60885?pagenum=1
05 November 2025, 02:34
Topic
AnonJr
sr_erick's Sub-forums MOD
02 February 2006, 17:19
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)
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.<
Bassman
03 February 2006, 09:22
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)<
Podge
03 February 2006, 09:44
Demo anywhere ?<
AnonJr
03 February 2006, 09:57
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?<
AnonJr, deleting is working fine as far is I can see.<
MarcelG
03 February 2006, 10:33
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 ?<
AnonJr
03 February 2006, 11:44
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.<
Podge
03 February 2006, 13:51
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?
<
AnonJr
03 February 2006, 14:06
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...<
AnonJr
05 February 2006, 09:46
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.<
AnonJr
07 February 2006, 23:22
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]<
Bassman
27 February 2006, 09:39
Microsoft VBScript runtime error '800a0006' Overflow: 'cint'
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.<
AnonJr
27 February 2006, 12:01
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.<
AnonJr
27 February 2006, 12:10
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. <
Bassman
27 February 2006, 13:11
AnonJr, that cInt to cLng works fine Thanks<
AnonJr
27 February 2006, 13:17
Good. I've sent myself an e-mail so I'll remember to update the files over at SnitzBitz.<
Karel Bata
27 February 2006, 18:04
Sorry for just leaping in here without reading everything that's so far been written about this subject, but I've got a simple question / suggestion:
Will it be possible to make individual forum members moderators of their own sub-forum? Without being able to 'intefere' with anybody else's sub-forum?
Very cool mod BTW it really opens up the possibilities.<
AnonJr
27 February 2006, 18:42
To be honest, I haven't really played with moderators and individual sub-forums... I would imagine that since the sub-forums are treated like regular forums in every respect but listing, that you would be able to make individuals the moderators for individual sub-forums.
Thanks for the kudos, but I can't take full credit. I took the original code put together by sr_erick and cleaned it up a bit and added a few fixes.<
Jezmeister
27 February 2006, 18:50
I don't know if anyones done it yet but I'll try and get it working on MySql in the next few days when I have time and let you know how it goes.<
AnonJr
27 February 2006, 19:43
Updated the download over at SnitzBitz.
Jezmeister, please let me know how things turn out with the MySQL test. I don't have a way to readily test it since I sold my testing server...<
Jezmeister
27 February 2006, 20:18
Ok most problems were in post.asp and I've taken the liberty of also replacing all FORUM_'s with " & strTablePrefix & " - it gave me numerous issues because i was using the same database as another of my forums that was using the prefix FORUM_... anyway heres the fixes you need to make - all tested - I've highlighted my changes for all intents and purposes
Post.asp
Replace the original code with this:
Code:
if strRqMethod = "Forum" or _ strRqMethod = "URL" or _ strRqMethod = "EditURL" or _ strRqMethod = "EditForum" then Response.Write "<tr>" & vbNewLine & _ "<td bgColor=""" & strPopupTableColor & """ nowrap valign=""top"" align=""right"">" & _ "<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & _ "<b>Parent Location:</b></font></td>" & vbNewLine & _ "<td bgColor=""" & strPopupTableColor & """>" & vbNewLine 'Forum Parent!
'Find out if this forum is a sub-forum!
If strRqForumID = "" Then strRqForumID = 0 '---Beginning of change for MySql compatibility if strDBType = "mysql" then strSQL = "SELECT F_PARENT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strRqForumID strSQL = strSQL & " LIMIT 1 " set rsFindSub = my_Conn.Execute(strSQL) if rsFindSub.eof then strSubForum = NULL else strSubForum = rsFindSub("F_PARENT") end if set rsFindSub = Nothing elseif strDBType <> "mysql" then strSQL = "SELECT TOP 1 F_PARENT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strRqForumID set rsFindSub = my_Conn.Execute(strSQL) if rsFindSub.eof then strSubForum = NULL else strSubForum = rsFindSub("F_PARENT") end if set rsFindSub = Nothing End If '---End of change for MySql compatibility 'Print out the select with the properly selected parent (Category or Forum) strsParentQL = "SELECT * FROM " & strTablePrefix & "CATEGORY ORDER BY CAT_ORDER, CAT_NAME ASC" set rsParent = my_Conn.Execute(strsParentQL) if not rsParent.eof then Response.Write "<select name=""Parent"" class=""ForumTextBoxDropDown"" size=""1"">" & vbNewLine do until rsParent.eof Response.Write "<option " if isnull(strSubForum) = TRUE then if strRqCatID = rsParent("CAT_ID") then Response.Write "selected " end if end if Response.Write "value=""C" & rsParent("CAT_ID") & """>" & rsParent("CAT_NAME") & "</option>" & vbNewLine strsParentQL2 = "SELECT * FROM " & strTablePrefix & "FORUM " & _ "WHERE CAT_ID = " & rsParent("CAT_ID") & " " & _ "AND F_PARENT IS NULL " & _ "AND FORUM_ID <> " & strRqForumID & " " & _ "ORDER BY F_ORDER, F_SUBJECT" set rsParent2 = my_Conn.Execute(strsParentQL2) if not rsParent2.eof then do until rsParent2.eof Response.Write "<option " if strSubForum = rsParent2("FORUM_ID") then Response.Write "selected " end if Response.Write "value=""F" & rsParent2("FORUM_ID") & """>- - - " & rsParent2("F_SUBJECT") & "</option>" & vbNewLine rsParent2.movenext loop end if rsParent.movenext loop Response.Write "</select>" & vbNewLine end if set rsParent = Nothing set rsParent2 = Nothing Response.Write "<a href=""Javascript:openWindow3('pop_help.asp?mode=options#category')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _ "</tr>" & vbNewLine end if
Also a non-MySql change: forum.asp
Line 369, replace:
Code:
strSQL = "SELECT FORUM_ID, F_SUBJECT FROM FORUM_FORUM WHERE FORUM_ID = " & Forum_Parent
With:
Code:
strSQL = "SELECT FORUM_ID, F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Forum_Parent
And thats fixed it for mysql and anyone using a non FORUM_ prefix <
Gizmo3
28 February 2006, 01:06
I installed this mod and it worked great. Hope everyone has the same luck i did <
Karel Bata
28 February 2006, 04:30
Any chance of seeing a demo?
<
Bassman
28 February 2006, 04:39
Here is my forum incl this mod:
http://wj.scoutingforum.nl/<
Karel Bata
28 February 2006, 06:13
Ah... Thanks.
That's not what I expected to see at all. To be honest I was a bit confused at first. I expected a tree-like structure with what are now individual posts being replaced by threads with their own posts. This mod is more like a branch going off to one side.
Is it possible to switch the regular forum off (and have it not display at all) and to leave only the sub-forums on? That could reduce the clutter. Your page here http://2007.scoutingforum.nl/forum.asp?forum_id=69 would benefit from that.
My suggestion would switch the empty forum at the bottom off.
It would be nice to be able to re-name 'sub-forum' too.
<
Bassman
28 February 2006, 07:30
A switch off for this emty forum (*link offline) is indeed a good idea.
It would be nice to be able to re-name 'sub-forum' too.
In what for example?<
Karel Bata
28 February 2006, 08:18
For instance, I want to create a forum where UK filmakers can post their trailer or short (see the "Using video/flash in topics?" thread here) and also have a (sub)forum to go with it, rather than just the one thread. In that case it would be better if on the level above it said 'films' rather than 'sub-forums' and a list of films would then be underneath which would link to the subforums. Maybe it's easier if I post a pic:
Clicking on a film's title would lead to a sub-forum about that film. It would be ideal if I could make each filmaker a moderator of their own forum (hell, I don't want to spend my time deleting malicious posts that say "your film is crap!" ) <
AnonJr
28 February 2006, 10:37
Jezmeister, thanks for the MySQL stuff. I'll get that up tonight or tomorrow.
I'd noticed the 'FORUM_' bit the first time through and it looks like I missed a few. Thanks for the heads up.
It would be nice to be able to re-name 'sub-forum' too.
I hadn't thought of putting the parent's title in there... I'll look into that.
And I'll look into adding the switch to show the empty list if the parent itself doesn't have any topics. Not sure how well that will play out...
A little higher up on the list is the fact that it isn't always obvious when new topics have been posted by looking at the front page... if you live on the Active Topics page its not an issue. But I've heard from some of the people over at Warsong Records (which I've been using as a guinea pig for this) that some topics weren't replied to because he didn't know they existed. Also I've still got to work out the problem with deleting a parent forum noted early in the first page.
Let me see what I can come up with between now and the LAN party this weekend.<
Karel Bata
28 February 2006, 11:08
Nice forum at Warsong. <
AnonJr
28 February 2006, 12:01
Originally posted by Karel Bata Nice forum at Warsong.
Thanks. <
Karel Bata
03 March 2006, 06:55
I'm just so brim-full of ideas. Like this one...
Wouldn't it be nice if a user starting their own sub-forum was able to redefine the background color? Or at least of (as I imagine it) the background of the one sticky post they put up top when they create the sub-forum inviting other posts?
Did that make sense? or should I do another pic
<
AnonJr
03 March 2006, 10:41
Makes sense, but I think that's getting into a whole other mod. While I don't want to discourage, I think some of the more fundamental issues of the subforums need to be worked out... that's not to say you couldn't take it and run. Wouldn't be the first time one mod led to another.<
rabufo
19 March 2006, 10:07
Very good MOD, I've installed it and works fine. Just one question: should it be possible to add another subforum level?
Category --Forum ----Subforum ------Sub-suborum<
AnonJr
19 March 2006, 10:52
Originally posted by rabufo Very good MOD, I've installed it and works fine. Just one question: should it be possible to add another subforum level?
Thanks. I'm glad you enjoy it.
With this MOD, no. I agree with the conclusion of the MOD's originator in that there should only be one level of sub-forums since it cuts down on the potential for confusion.
If your interested in the beginnings of that debate, check out the first page or so of this thread.
I'm still interested in your opinion on this. Also keep in mind that this MOD is still a "work-in-progress" and as such there are some updates coming. Namely better MySQL support, and some bug fixes... due as soon as I can finish them. <
rabufo
19 March 2006, 12:37
Originally posted by AnonJr If your interested in the beginnings of that debate, check out the first page or so of this thread.
oh yes, Anonjr, I've already that 3d in my bookmarks because I was very interested....that's why I've to say "thanks" to you again
Do you think it'd be very difficult to add another subforum level?
<
AnonJr
19 March 2006, 14:39
Depends. You'd probably have to start at the beginning again. This MOD uses the "Parent" field to determine if its a sub-forum or not. You might add a second check to see if the parent is a child of another forum, but now we're starting to talk about a lot of hits to the database.... something to avoid if you're on a shared-host or using Access.
It's probably do-able. And it can probably done with the existing code. I'm just not sure if its worth the effort. I've already run into problems with people understanding the concept of 1 level of sub-forums... but in their defense it has more to do with the current code not changing the parent's icon to reflect a new post in a child forum.... something I've been working on.
I guess that when all is said and done, the best answer I can give is "it depends".... it might be easier to start from the beginning again.<
rabufo
20 March 2006, 08:47
Hope you can help me in this, AnonJr....how can I make the titles text of subforums wrapping, like titles of the Snitz main pages? I must used long titles, so I need they wrap......<
AnonJr
20 March 2006, 09:07
Are you using the SB2 code or the base code?<
rabufo
20 March 2006, 13:40
Originally posted by AnonJr Are you using the SB2 code or the base code?
oh oh...I fear I don't know what you mean when you say "SB2 code"...<
AnonJr
20 March 2006, 15:31
Just about all the work I do with Snitz these days is with the Speed Ball 2 code (aka SB2). Thats the big reason why you see two versions of the code in the download - one for those using SB2, and one for those using the base code (or close enough to it ). I know there are some quirks with the base code simply because I'd forgotten to add back some things that I'd moved to CSS with SB2.
That's why I asked. Also it helps to know which version of the code I ought to be looking at.<
rabufo
20 March 2006, 18:12
I'm using the base code, AnonJr...<
AnonJr
20 March 2006, 18:44
My fault, I should have asked even earlier... got a link so I can see what you mean?
Also, are you referring to the title near the top of topic.asp? Like where you see "All Forums -> Category -> Forum -> Sub-Forum -> Thread Title"?
Assuming the above, you're probably going to need to edit the <td ...> in topic.asp around line 400(ish).
In a clean file it looks kinda like: " <td width=""50%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
I would guess that since there is now a new level, your text is larger than the 50% originally alloted. You can change that to something a little higher (remembering that whatever you do will probably affect the links to the right of it) or you can remove the 'nowrap' attribute (remembering that the wrapping will almost certainly look ugly since there are a bunch of spacers that are being used to indent the tree).
Hope this helps.<
rabufo
22 March 2006, 14:01
posting 2 screenshots to clear what I mean, AnonJr...
This is the Forum main page....
(sorry, forum is in Italian... )
Category A Agricoltura, caccia e Silvicoltura --Forum 01 Agricoltura, caccia e relativi servizi
as you see, I've removed the sub-forum titles below the forum title containing them...
Title of Forums (Agricoltura, caccia e relativi servizi and others in the main page) wrap normally, but if I click on "01 Agricoltura, caccia e relativi servizi" link to see the subforums it contains, forum.asp appears so:
----Sub-Forum 01.11.1 Coltivazione di cereali ...and so on
All titles don't wrap...is there a way to make they wrap automatically? Please consider I need very long title (if I remember well, I've set up 100 the text lenght in topic.asp)
Thank you for any help....
<
AnonJr
22 March 2006, 14:26
ahhh... got it.
I can't see why its not wrapping... unless it has to do with the fact that it fits in the space available as is...
Got a link to the forum? (Which I might add is very spiffy looking from those screen shots. )<
rabufo
23 March 2006, 02:18
sure...
www.italyworldtrade.it/iwtdba<
AnonJr
23 March 2006, 08:49
I can't be certain, but I suspect that the real culprit is the table near the top that holds your tree navigation (the part with the folders and all). I suspect that because it's set to "nowrap" and only a third of the table, its pushing the rest of the table out. Since that table is increasing the available screen width, the rest of the tables are taking advantage of it. Notice how the regular forum table is also stretched out.
Its the same problem I have with the sub forums over at Warsong Records. As a matter of fact, since I edited the table, the only time its a problem is on monitors set to 800x600 and if they are actually in a sub-forum.
In topic.asp forum.asp (probably somewhere around line 400ish depending on the modifications you made) your outputting this:
<td width="33%" align="left" nowrap>
and I bet that is where the problem is.
There is an "empty" table cell in the same row:
I'd get rid of that, span the first one over and it should solve the problem.
As always, make backups first. BTW, I love the slick look you've got there. Now I've got to go home and work on my icons and gradients etc.
(It wasn't until after the third cup of coffee that I realized I was thinking "forum.asp" and typing "topic.asp" ... guess I should wait until at least the second cup before answering here eh?)
Now that I really think about it, the problem is probably going to be the same in both...<
rabufo
24 March 2006, 02:43
Thank you very much for your help, AnonJr, you're very kind...
I've tried to make the changes you suggest, but nothing happens...or very probably I just misunderstood what you suggested....
This is the forum.asp file, can you please take a look at it?
www.italyworldtrade.it/forum_asp.txt
Thank you....<
AnonJr
24 March 2006, 14:01
I think the problem is around line 425 in forum.asp. You'll see the line that looks like this:
The part in red is telling the text to not wrap, and the part in blue is saying that that portion of the table needs to be 33% in width. A little further down you have lines 459 and 460 that give an empty table cell that is also going to be 33% in width. For reference:
And line 489 sets up the third table row to also be 33%.
" <td width=""33%"">" & vbNewLine & _
I think the problem is that the long titles combined with the nowrap in the first <td> are causing that table to be so large that it effectively pushes the outer boundary of the page, and the table with the subforums, which is set to 100% is using the new boundary instead of the actual window size.
I think if you change line 425 to look like this:
and comment out lines 459 and 460 it should stop the table that holds the tree structure from 'pushing' the boundaries of the page larger than the window, and allow the table that holds the subforums to use the correct width.
Oh, and don't forget to keep a backup of the page handy just in case. You may need to do the same or something similar to topic.asp as well since the extra tree level with the long titles will likely push the table out there too.<
rabufo
25 March 2006, 14:24
I've made the changes in forum.asp you suggest, AnonJr, but title don't wrap automatically yet
BTW, I need also to delete Topics, Read and Replies columns (leaving the "Last Post" oneonly) both in default.asp and in forum.asp pages...I found this 3d about this topic http://forum.snitz.com/forum/topic.asp?TOPIC_ID=33661 do you think I could implement it easily with your sub-forums MOD?
Again, thanks a lot for your help...<
rabufo
26 March 2006, 06:19
Well, Mark, I've solved the not-wrapping titles prob: the cause was in the position of inc_jump_to.asp include in forum.asp, relating to the extreme width of titles. I've simply moved the include just below the WriteFooter (line 819) and now titles wrap normally, please take a look at www.italyworldtrade.it/iwtdba/forum.asp?forum_id=10 to see.
<
AnonJr
26 March 2006, 15:23
Looks good. One minor detail though, on the table at the bottom (for the parent forum's topics) it looks like you're missing a couple of headers.
As to your other question, I don't think it would be too hard. Are you wanting to remove those columns for everybody or everybody but admins?<
Jezmeister
27 March 2006, 02:26
if anyones interested im gonna expand this mod in the next few weeks to allow individual members to have and moderate their own subforums (not just being made moderator of that forum as normal), if anyone wants it I'll post the code when I'm done<
Bassman
27 March 2006, 03:03
Originally posted by Jezmeister if anyones interested im gonna expand this mod in the next few weeks to allow individual members to have and moderate their own subforums (not just being made moderator of that forum as normal), if anyone wants it I'll post the code when I'm done
That sounds like a nice idea. <
rabufo
27 March 2006, 10:34
Originally posted by AnonJr As to your other question, I don't think it would be too hard. Are you wanting to remove those columns for everybody or everybody but admins?
Oh yes, thank you very much! I need to remove for anybody but admins...<
Karel Bata
28 March 2006, 16:23
if anyone wants it
What a silly question... <
AnonJr
29 March 2006, 09:20
Sorry rabufo, I haven't forgotten about you (or the updates I still need to make to this MOD)... Its been kinda hectic here at the hospital. I'll try to have something up tonight.
Jezmeister that sounds like a neat idea. Are you thinking of having like a "Members Area" forum, with each member having his/her own sub-forum therein?<
Jezmeister
29 March 2006, 17:08
That's pretty much the idea, I want to give them a "control panel" too though, so they can edit the name of their forum, choose their forums moderators (without granting the members they give moderation powers to moderator level... if ya get what I mean), maybe skins etc... it shouldn't really be too much work... I'm a little snowed under with other stuff atm tho so it might be a few weeks til I get it finished<
AnonJr
29 March 2006, 17:11
Most of that shouldn't be too bad. I think you might be in for more work than you realize with allowing them to choose moderators for their own sub-forum and the skins.
Good luck and let us know how it goes.<
rabufo
31 March 2006, 09:24
Originally posted by AnonJr Sorry rabufo, I haven't forgotten about you (or the updates I still need to make to this MOD)... Its been kinda hectic here at the hospital. I'll try to have something up tonight.
Thank you, AnonJr...
BTW...at the hospital!?? I'm a doc....you too?<
AnonJr
31 March 2006, 10:40
Not a doctor. Just a computer programmer for the hospital's Training and Development department.
We're trying to drag the staff into the 21st century with computer charting etc. and we're getting a lot of resistance. When you add that we have a little over 4,000 employees and the new training takes me away from my regular work to teach classes, things get interesting.
Because I know I'm going to be pulled from my regular work sometime around July or so I've been killing myself with 12hr days to get my "regular" stuff done. Hopefully I'll be out on time today and can work on it... it is my birthday after all. <
Karel Bata
31 March 2006, 19:04
Happy Birthday! <
AnonJr
31 March 2006, 19:18
Originally posted by Karel Bata Happy Birthday!
Thanks. I actually got out of work at 17:00 which has been early for me. Too bad I'm salaried and don't qualify for overtime pay. I've made the MySQL changes and I'm trying to fix a couple of other minor bugs. I hope to have some updates up this weekend. Since the birthday party is tomorrow, the updates will go up either tonight or Sunday. <
rabufo
01 April 2006, 05:34
Happy birthday, Mark!<
AnonJr
05 April 2006, 09:52
rabufo, I went to work on your question about hiding the topic/reply counts this morning and noticed that you've solved it. While I'm glad you got it working, I am truly sorry I didn't get to your problem promptly. <
Bassman
06 April 2006, 09:57
When edit a catagory I get this error:
Microsoft JET Database Engine error '80004005'
You cannot add or change a record because a related record is required in table 'FORUM_CATEGORY'.
/post_info.asp, line 1516 <
AnonJr
06 April 2006, 10:07
What are you trying to do with the category? I'd like to try to repeat it on my test forum here at work. Also, do you have any web links in that category or the forums in that category?
<edit>I guess a link to a txt version of post_info.asp would be helpful too... make sure we're looking at the same lines and all. </edit><
Bassman
06 April 2006, 12:01
You right, a txt is of more help...sry. Found the problemen already, the poll mod code was bugging the sub forums code. I made the post_info from scratch with all the code and it works fine. I gess I made a error somewhere.
Link with subforum running: http://www.wjforum.nl Edit: poll mod is giving a error:
I thought I'd register to look around and see what you've done (very nice what i can see of it). I selected 'register', got to the 'Registration Rules and Policies Agreement' page (http://www.wjforum.nl/policy.asp) selected 'agree' and was taken straight back to the 'Registration Rules and Policies Agreement' page. A loop...
I use Firefox
Just tried with IE - same prob.<
Karel Bata
06 April 2006, 16:49
In the 'Cluster zuid' section, where the sub-forums are I can see the 'Moderator(s)' column. Is that intentional or a bug of the mod?
Ah, I can see it all working in 'World Jamboree [2003]'. You have all the sub forums listed on the main page. Is it possible to switch that facility off in the mod?
<
AnonJr
06 April 2006, 20:54
Bassman, I hate to say this, but I just can't seem to figure out where the problem is. I'm watching my mother's house while she and my step-father are away, so I don't have much more that trusty ole Notepad... but I just can't see what's missing. Have you tried doing a Response.Write and looking at the actual SQL Statement?
Karel Bata, you wouldn't happen to be using Norton Security would you? I know that's caused that problem in the past.
As to your other question, technically no - there is no "switch" to automatically turn off the listing of sub-forums on the main page. I can show you what to comment out as soon as I get to work tomorrow if you're interested. I may have to think about adding some sort of control panel and make some other options....<
Bassman
07 April 2006, 06:30
@ Karel Bata, registration is fixed.
Response.Write and looking at the actual SQL Statement?
Hmmm, I will go and do a check.
Don't worry about the time, I'm not in a hurry and this still is a beta version so I really can't complain <
Bassman
07 April 2006, 07:57
old
set rsCatIDCheck = my_Conn.execute(strSql) bolCatIDChanged = (cSTr(rsCatIDCheck("CAT_ID")) <> ChkString(Request.Form("Category"), "SQLString")) rsCatIDCheck.Close set rsCatIDCheck = Nothing
'## Forum_SQL - Do DB Update strSql = "UPDATE " & strTablePrefix & "FORUM " strSql = strSql & " SET CAT_ID = " & cLng("0" & Request.Form("Category")) '############################ Poll Mod ########################### if Request.Form("PollAuth") <> "" then strSql = strSql & ", F_POLLS = " & chkString(Request.Form("PollAuth"),"SQLString") & "" end if '#################################################################
No more error's poll works, still one problem when trying to alow polls in a cat. And whats this? 'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!? Change what where to what.<
AnonJr
07 April 2006, 18:24
Originally posted by Bassman And whats this? 'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!? Change what where to what.
That is from the original readme that sr_erick sent. I've added those places in the new readme, I just forgot to remove my reminder.
And I do worry about time... I just wish I had more. When I started with the public work on this it looked like I was going to have more time than I've had lately. I'm hoping that will change soon.<
Karel Bata
07 April 2006, 20:03
there is no "switch" to automatically turn off the listing of sub-forums on the main page. I can show you what to comment out as soon as I get to work tomorrow if you're interested.
Not at that stage yet. Just watching what you guys are up to, and trying to be a little helpful. This is a useful mod and I hope to be using it eventually. Keep up the good work. <
Classicmotorcycling
03 June 2006, 23:32
Has anyone managed to get this working with the Active Users MOD? In particular with active_users.asp! I know there is a conflict with the WhatPage function and have not had the time to look at it fully, but if someone else has already done it, then it would save me some more time.. Thanks in advance...
<
AnonJr
04 June 2006, 09:36
Which conflict with the WhatPage function?
As to the AU MOD, I haven't tested it yet. It is on my list of MODs for the Warsong Records Forum, but I won't be able to do much until the new mother board for my file server comes in next week.... <
Classicmotorcycling
04 June 2006, 18:34
AnonJr,
This is the error I am getting:
Code:
Microsoft JET Database Engine error '80040e14' Syntax error (missing operator) in query expression 'FORUM_ID==23'.
/forums/active_users.asp, line 570
And this is the code that relates to line 570 is in red:
Code:
strSql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & fForum_ID set rst = my_conn.execute(strSql)
if rst.EOF or rst.BOF then strPage = fscript & "?" & fquery' fLang(strLangMOD_Ls3kAU_01270) else
It is called on by this:
Code:
" & WhatPage(strLastPage,strQS) & "
I will have a play around with it in the mean time and let you know if I get it sorted.<
AnonJr
05 June 2006, 14:39
Have you done a response.write of the SQL Statement before it executes?<
Classicmotorcycling
05 June 2006, 15:09
Yes, I have done the response.write of the sql statement. It shows the forum ID, which is why it is confusing me.. I have got it to show the forum ID in the AU screen, but there is no link with it, and the name of the forum is not showning up on any of the categories, apart from the parent with sub forums. Real strange I know..<
AnonJr
06 June 2006, 10:58
Hmm. The error you posted seems to indicate that there's an extra "=" in the query...
As to the rest, I've not worked with AU yet so I'm not very familiar with the ins and outs of it. Since the forums are almost pulled the same as regular forums and the Active Topics page doesn't seem to have a similar problem, I'm not sure where to start.
Got a link to the site so I can see it in action?<
AnonJr
29 June 2006, 16:31
Managed to track down and fix a couple of other little bugs. New posts in sub forums weren't changing the icons to indicate that a new post was made. Half the problem was a stupid mistake on my part, and the other half is another story... I'll get to that in a minute.
First - to fix the error you need to make two minor changes.
Change #1: In inc_subforum.asp around line 136 change:
Code:
Response.Write(ChkIsNew(Topic_LastPost))
To:
Code:
Response.Write(ChkIsNew(ForumLastPost))
Change #2: In default.asp* go to "sub ChkIsNew(dt)" near the bottom of the page. Find (should be the third line in the sub):
Code:
if dt > Session(strCookieURL & "last_here_date") and (ForumCount > 0 or ForumTopics > 0) then
And change it to:
Code:
if dt > Session(strCookieURL & "last_here_date") and ((ForumCount + arrSubInfo(2)) > 0 or (ForumTopics + arrSubInfo(1)) > 0) then
*(My line numbers are so far off on that page it'd be impossible to give an accurate number...)
Oh, and for the record I was greatly frustrated trying to figure out the second fix because ChkIsNew() is a function in inc_func_chknew.asp as well and that was where I was making all my initial changes... and pulling my hair out trying to figure out why it wasn't making any difference whatsoever. I hope to update the download this weekend... things have been quite busy. Bobby wants the Jesus Joshua 24:15 site and the Warsong Records site to have a new look by Sept. when the new CD comes out. --- Edit: there was one more change in default.asp
Find:
Code:
if ForumFType = 0 then ChkIsNew(ForumLastPost) else
And change it to:
Code:
if ForumFType = 0 then If ForumLastPost <> "" And (arrSubInfo(3) = "none" Or ForumLastPost > arrSubInfo(3)) Then ChkIsNew(ForumLastPost) ElseIf arrSubInfo(3) <> "none" Then ChkIsNew(arrSubInfo(3)) Else ChkIsNew(ForumLastPost) End If else
<
Jezmeister
03 October 2006, 17:47
Hey guys question, its not majorly important, im sure if I come back to it later I can find a workaround but I'm having a slight issue, I'm trying to make editing the forums properties possible to done by the "SubAdmin" (basically just another member level assigned to a maximum of one member per forum), all is fine except I don't want the subadmin to be able to change the parent forum and if I change the post.asp code to this:
Code:
Response.Write "<select name=""Parent"" class=""ForumTextBoxDropDown"" size=""1""" & vbNewLine if (sLev = 4) and (mLev <> 4) then Response.Write "disabled>" Else Response.Write ">" End if
Upon submitting the forum is deleted... any quick fixes for this?
EDIT: On second thoughts it may be easiest for me simply to restrict database changes in post_info.asp... I'll have a look tomorrow fixed using an excessive amount of if sLev <> 4's in post_info.asp meh<
Jezmeister
28 November 2006, 18:19
Originally posted by Jezmeister if anyones interested im gonna expand this mod in the next few weeks to allow individual members to have and moderate their own subforums (not just being made moderator of that forum as normal), if anyone wants it I'll post the code when I'm done
a few of you seemed interested in the idea so: http://forum.snitz.com/forum/topic.asp?whichpage=1&TOPIC_ID=62904<
modifichicci
07 October 2007, 08:40
From the read me:
Known Bugs:
* This code has not been tested with MySQL.
* Deleting a parent forum deletes any references to the Sub-Forums. They still exsist, but can not be edited or viewed unless you type the ID in the URL.
* Hidden Sub-Forums still show up on the list. Access is denied to those who aren't suposed to have it, but it is visible to all.
MySql working well after changes posted in this thread Hidden subforums fixed: in inc_subforums at line 280 strSQL = "SELECT F.FORUM_ID, F.F_SUBJECT, F.F_TOPICS, F.F_COUNT, F.F_LAST_POST, F.F_LAST_POST_TOPIC_ID, " & _ add F.F_PRIVATEFORUMS, F.F_PASSWORD_NEW, after F.F_COUNT so it looks like: strSQL = "SELECT F.FORUM_ID, F.F_SUBJECT, F.F_TOPICS, F.F_COUNT, F.F_PRIVATEFORUMS, F.F_PASSWORD_NEW, F.F_LAST_POST, F.F_LAST_POST_TOPIC_ID, " & _
at line 316 strSubList = strSubList & "<a href=""forum.asp?FORUM_ID=" & rs("FORUM_ID") & """>" & chkString(rs("F_SUBJECT"),"display") & "</a>"
MembroId = getMemberID(strDBNTUserName) if MembroID = 0 then membroID = -1 if chkDisplayForum(forumprivato,parolaprivata,IDForum,MembroId) then strSubList = strSubList & getCurrentIcon(strIconBar,"","align=""absmiddle""") & " " &"<a href=""forum.asp?FORUM_ID=" & rs("FORUM_ID") & """>" & chkString(rs("F_SUBJECT"),"display") & "</a><size=""1""> (" & rs("F_TOPICS") & "/" & rs("F_COUNT") & ")" end if
That adds also number of Topic/post in subforums
Deleting:
fixed adding a message if there are subforums in forum delting, asking to delete or move them before deleting parent forum.
Deleting cannot be performed if subforums are present.
pop_delete
line 712 -713 case "Forum" Response.Write("Only Administrators can delete Forums.")
add below
strSql = "SELECT FORUM_ID FROM " & strTablePrefix & "FORUM " strSql = strSql & " WHERE F_PARENT = " & Forum_ID set rsdel = my_Conn.Execute (strSql)
if rsdel.BOF or rsdel.EOF then Response.Write("<b>No subforums in this forum.</b>") cancellaforum=0 else Response.Write("<b><font color=""" & strHiLiteFontColor & """>ATTENTION: </font>There are subforums in this forum.<br /> Delete or move them before deleting this forum!</b>") cancellaforum = 1 end if rsdel.close set rsdel = nothing
after line 718 before Response.Write "</font></p>" & vbNewLine & _ " <form action=""pop_delete.asp?mode=" add if cancellaforum = 0 then
and before the end select of line 769
add
end if <
modifichicci
07 October 2007, 11:37
to complete mysql compatibility, I have an error setting moderators and going in forum.asp
to avoid error add dim rsCount in inc_subforums.asp after if (strShowModerators = "1") or (mlev = 4 or mlev = 3) then <
bitwise2000
20 February 2008, 20:19
Has anyone modified 1nc_subforum.asp to correctly hide private forums from display on default.asp? No matter how you set a forum, it always displays if its parent is visible.
I'd like a visible parent and hidden subforums.<
Bassman
21 February 2008, 05:37
Noting wrong with the inc_subforum.asp as far as I can see. It works fine for my forum http://wj.scoutingforum.nl/ In there are hidden forums in all cats. Check if all the code for subforums in corect in default.asp.<
AnonJr
21 February 2008, 06:21
I'll ditto Bassman, it shouldn't be showing if its a hidden forum. I have had a problem where it shows the Sub Forum text (but no links) if there is only one sub forum and its hidden.
In case the age of this thread wasn't a hint, I haven't had much time lately to fix it up and move it closer to production-level code. <
bitwise2000
21 February 2008, 12:55
This is still listed as an issue in the readme; "Hidden Sub-Forums still show up on the list. Access is denied to those who aren't suposed to have it, but it is visible to all." Member modifichicci addresses it in his post above too, by directly querying F_Privateforums, but I was looking for a solution which uses chkDisplayForum from inc_func_secure.
I don't think I've missed any code mods in default.asp. There is no reference in there to F_PrivateForum or chkDisplayForum anyway, so how would the private forums not display unless it was in inc_subforums?
Look at the bottom forum "Product Reviews" here: http://www.penturners.org/forum/default.asp?CAT_ID=4
That subforum is set hidden. Clicking on it generates the expected error message, but I'd rather it not show up.
Here's another issue: The hidden forums table header still shows when the forum is hidden.
http://www.penturners.org/forum/forum.asp?forum_id=58
Overall a great mod!<
AnonJr
21 February 2008, 14:11
It may have been part of an update I was working on then... unfortunately, my file server is down and I don't have access to said files.
I'll try to take a look at this when I get home tonight. If you could, please post a link to a *.txt copy of default.asp, forum.asp, and inc_subforums.asp<
bitwise2000
21 February 2008, 16:06
Here's the original: http://content.penturners.org/inc_subforum.txt
Here's my modified version to hide subforums based on the value of F_PrivateForums and strDBNTUserName.
http://content.penturners.org/inc_subforum-new.txt
I added some code to the loop that builds the list of subforums. That works.
What doesn't work is restricting access based on password. So if you set the forum to members only password protected, you don't get the challenge for the forum pswd before you get access. That's a separate issue that has to be addressed in forum.asp. I don't use password protected hidden forums, so it's not an issue for me, but it should be addressed to work correctly.<
modifichicci
21 February 2008, 16:36
there is not an option for hidden forum with password..
my modification use chkDisplayForum from inc_func_secure.
it works as the forum is hidden to users not allowed.
(I don't see the forum hidden you post.. and the link bring me to default)<
bitwise2000
21 February 2008, 17:33
Here's my quick and very dirty workaround for the subforum column headers being displayed in the parent forum when all the subforums are invisible to the user. The right way is of course to rewrite the sub ListSubForums so that it doesn't write the column headers right off the bat, only if there's at least one subforum visible to the user.
I didn't want to rewrite the entire ListSubForums sub so I just wrote a function to check to see if there are any subforums visible to the user and if not to exit that sub.
Code:
Function OneVisibleForum(FORUM_ID) ' Is there at least one visible forum under this parent?
OneVisibleForum = false strSQL = "SELECT F.FORUM_ID, F.F_PRIVATEFORUMS, F.F_PASSWORD_NEW " & _ "FROM " & strTablePrefix & "FORUM F " & _ "WHERE F.F_PARENT = " & FORUM_ID & " AND F.F_TYPE = 0;" set rs = my_Conn.Execute(strSQL) if not rs.eof then do until rs.eof intPrivateForum = rs("F_PRIVATEFORUMS") strPasswordNew = rs("F_PASSWORD_NEW") intForumID = rs("FORUM_ID") intMemberID = getMemberID(strDBNTUserName) if intMemberID = 0 then intMemberID = -1 if chkDisplayForum(intPrivateForum, strPasswordNew, intForumID, intMemberID) then OneVisibleForum = true exit do end if rs.movenext loop end if set rs = nothing end Function
Then I use this like so
Code:
sub ListSubForums(FORUM_ID)
If Not OneVisibleForum(FORUM_ID) then Exit Sub
etc., etc.<
modifichicci
22 February 2008, 16:19
That is very strange..
I have replied to bitwise2000 post 21 February 2008 : 17:33:18
i have posted without login, inserting id and pass, but my reply is shown before the post I have replied..<
How well does this mod work with the latest version of Snitz forum and MySQL? Does anybody have the updated files or are the files on Snitzbitz the latest release of this MOD?<
AnonJr
11 June 2008, 17:01
The files on Snitzbitz.com are the latest released files. I've used it in 3.4.06 forums with only a few minor issues that have existed from the get-go. I've been meaning to add better support for MySQL but I just haven't had the time... work kicked into high gear and just hasn't stopped. =/ One way to add some better MySQL support has been posted here, as have other changes.<