Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 sr_erick's Sub-forums MOD

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AnonJr Posted - 02 February 2006 : 17:19:34
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.<
15   L A T E S T    R E P L I E S    (Newest First)
AnonJr Posted - 11 June 2008 : 17:01:49
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.<
OJJE Posted - 11 June 2008 : 16:22:31
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?<
modifichicci Posted - 23 February 2008 : 02:40:08
<
AnonJr Posted - 22 February 2008 : 18:42:25
Were you in a cool De Lorean at the time? <
modifichicci Posted - 22 February 2008 : 16:19:47
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..<
bitwise2000 Posted - 21 February 2008 : 17:33:18
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.


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

sub ListSubForums(FORUM_ID)

	If Not OneVisibleForum(FORUM_ID) then Exit Sub


etc., etc.<
modifichicci Posted - 21 February 2008 : 16:36:12
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 Posted - 21 February 2008 : 16:06:22
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.<
AnonJr Posted - 21 February 2008 : 14:11:22
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 Posted - 21 February 2008 : 12:55:51
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 Posted - 21 February 2008 : 06:21:54
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. <
Bassman Posted - 21 February 2008 : 05:37:09
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.<
bitwise2000 Posted - 20 February 2008 : 20:19:32
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.<
modifichicci Posted - 07 October 2007 : 11:37:30
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
<
modifichicci Posted - 07 October 2007 : 08:40:31
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>"

change to
forumprivato = rs("F_PRIVATEFORUMS")
parolaprivata = rs("F_PASSWORD_NEW")
IDForum = rs("FORUM_ID")

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
<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000 Version 3.4.07