Required Reading Mod

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/67961?pagenum=1
05 November 2025, 07:27

Topic


Carefree
Required Reading Mod
14 December 2008, 18:32


I wrote this in response to a request. This mod allows administrators (or moderators) to force members to view a topic before continuing to use the board. To turn the moderator access off is a matter of changing one line of code.

When the member views the topic, a value is set into the member's record. If the topic concerns a rule violation, for example, the administrator will be able to check whether a member viewed the topic about a rules change.
Required topic id changes are made from the admin home page.
Get a copy at SnitzBitz.<

 

Replies ...


Carefree
19 December 2008, 14:57


For those who downloaded earlier releases, please get the last one - it has several fixed routines and uses the config_new table vs the config table.<
jgs
24 January 2009, 13:45


I downloaded the Mod very recently, but the .chm is empty, besides the TOC. (file not found)

I found in both files that need editing 2 lines to add, is that all that needs editing?
Both my files have many mods, so comparing them is not easy.<
Carefree
24 January 2009, 15:13


Well, since it has been downloaded about 60 times in the last month, and I had not yet heard that complaint, I re-downloaded it about a minute ago. The .chm file works perfectly, it isn't empty, and there were no "file not found" results.
My best guess is that you got a corrupted download. Delete it and try again.<
jgs
24 January 2009, 17:01


When I use winzip to open the file unpacked, I can read it. After unzipping not. Downloaded the file again, same result. Used another unpacking tool, same result.
If you had no further complaints, do'nt bother, I'll use the unpacked way.<
AnonJr
24 January 2009, 20:58


If memory serves - With a recent Windows update, .chm files are typically "blocked" by default. You need to right-click on the .chm, select "Properties", and unblock it.<
jgs
25 January 2009, 06:59


I'm still using W2K, but I tried to open another .chm file, no poblem.
The problem is the file opens, but in the text screen I get an IE error that opening is breaking off (don't remember the english text, but it's the screen that says try reloading or try later again. File not available.<
Carefree
25 January 2009, 19:23


That's just odd.

The file has been updated on SnitzBitz. Added ability to force reading of FAQ (use an "f" or "F") & rules (use an "r" or "R") pages, instructions to turn it on/off (simply type a "0" (zero) to disable), and a bypass routine if users do not have access to a given forum.<
jgs
26 January 2009, 02:18


Even stranger is that the files opens perfectly without unpacking the zip file first.<
texanman
03 February 2009, 11:30


Thanks Carefree for this nice Mod
I just installed it. Everyting seems to be fine - no errors. But, it doesn't force me to read the topic I specified. I am using SQL also.<
Carefree
03 February 2009, 17:22


Sorry, all - Although the file was included as an example, I forgot to include the instructions for "config.asp" (without which, it just will not work). It's been updated at SB.<
texanman
04 February 2009, 00:56


Still the same after adding the changes in config :(<
Carefree
04 February 2009, 01:31


In "inc_required.asp", after the "end if" on line 45, insert these two lines and see what it prints out:

Code:

Response.Write "C_VALUE="&C_VALUE&"<br>TopID="&TopID
Response.End
<
texanman
04 February 2009, 02:33


Originally posted by Carefree
In "inc_required.asp", after the "end if" on line 45, insert these two lines and see what it prints out:

Code:

Response.Write "C_VALUE="&C_VALUE&"<br>TopID="&TopID
Response.End

It prints the following:

C_VALUE=2009
TopID=2009<
Carefree
04 February 2009, 12:09


I figured out what's happening. You're not running a private forum, right? I forgot to account for open forums when I did the check for access routine.
Replace "inc_required.asp" with the following and let me know the results:
Code:
 <%
'###############################################################################
'## Snitz Forums 2000 v3.4.06
'###############################################################################
'## Copyright © 2000-06
'## Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version. '##
'## All copyright notices regarding Snitz Forums 2000 must
'## remain intact in the scripts and in the HTML output. '## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet. '##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details. '##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to:
'##
'## Free Software Foundation, Inc. '## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'## manderson@snitz.com
'##
'###############################################################################
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT C_VARIABLE, C_VALUE FROM " & strTablePrefix & "CONFIG_NEW WHERE C_VARIABLE='TPID'"
set ReqTopic = my_conn.execute(strSQL)
if not ReqTopic.EOF then
C_VALUE=ReqTopic("C_VALUE")
TopID=cInt(ReqTopic("C_VALUE"))
ReqTopic.close
set ReqTopic=Nothing
end if
if C_VALUE="F" or C_VALUE="f" or C_VALUE="R" or C_VALUE="r" then
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT M_REQUIRED FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID=" & MEMBERID
set ReqTopic = my_conn.execute(strSQL)
if not ReqTopic.EOF then
if ReqTopic("M_REQUIRED") <> C_VALUE then
' Member hasn't read topic
ReqTopic.close
set ReqTopic=Nothing
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_REQUIRED = '" & C_VALUE & "' WHERE MEMBER_ID=" & MEMBERID
set ReqTopic = my_conn.execute(strSQL)
set ReqTopic=Nothing
if C_VALUE="F" or C_VALUE="f" then
Response.Redirect "faq.asp"
else
Response.Redirect "rules.asp"
end if
end if
end if
else
if TopID <> 0 then
' Not disabled
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT M_REQUIRED FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID=" & MEMBERID
set ReqTopic = my_conn.execute(strSQL)
if not ReqTopic.EOF then
if ReqTopic("M_REQUIRED") <> C_VALUE then
' Member hasn't read topic
ReqTopic.close
set ReqTopic = Nothing
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT FORUM_ID, TOPIC_ID FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID=" & TOPID
set ReqTopic = my_conn.execute(strSQL)
FORUMID=ReqTopic("FORUM_ID")
FORUM_ID=FORUMID
ReqTopic.Close
set ReqTopic=Nothing
' Check for access
if strPrivateForums <> "1" then
' Public forum - set value in record and refer to topic
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_REQUIRED = " & TopID & " WHERE MEMBER_ID=" & MEMBERID
set ReqTopic = my_conn.execute(strSQL)
set ReqTopic = Nothing
NewAddy = strForumURL+"topic.asp?TOPIC_ID="+C_VALUE
Response.Redirect NewAddy
elseif strPrivateForums = "1" and (Request.Form("Method_Type") <> "login") and (Request.Form("Method_Type") <> "logout") and ForumChkSkipAllowed = 0 then
' Private forum, access allowed
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql="SELECT FORUM_ID, MEMBER_ID FROM " & strTablePrefix & "ALLOWED_MEMBERS WHERE FORUM_ID=" & FORUMID & " AND MEMBER_ID=" & MEMBERID
set ReqTopic = my_conn.Execute(strSql)
if not ReqTopic.EOF then
' Set value in record and refer to topic
ReqTopic.Close
set ReqTopic = Nothing
set ReqTopic = Server.CreateObject("ADODB.Recordset")
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_REQUIRED = " & TopID & " WHERE MEMBER_ID=" & MEMBERID
set ReqTopic = my_conn.execute(strSQL)
set ReqTopic = Nothing
NewAddy = strForumURL+"topic.asp?TOPIC_ID="+C_VALUE
Response.Redirect NewAddy
end if
end if
end if
end if
end if
end if
%>
<
texanman
04 February 2009, 12:30


Thanks Carefree
I am running a private forum indeed. I did replace it. The forum doesn't go past "sucessfully logged in". :-)<
Carefree
04 February 2009, 14:17


Looks like I keep missing you by an hour. I made another change - trying to figure out what's happening with your site - please see your email. BTW, does the account you're using to test with have access to the topic? If not, it's designed to transparently bypass the required reading routine.<
texanman
04 February 2009, 14:23


Thanks
I can't access my e-mail now. But, I will check at night from home. Yes, the account I am using has access to the topic. If you made the change in the above code, I can test it now.<
Carefree
04 February 2009, 15:05


Yes, the code change was incorporated in the post above.<
texanman
04 February 2009, 15:24


I tested it. It does the same thing as before the change.<
Carefree
04 February 2009, 16:06


Let's give this one more try. If you have a test account, please send me details after you replace the code with the latest change.<
texanman
05 February 2009, 10:36


Thanks Carefree. In order to avoid holding members from waiting to login, would it be possible to do this at a certain time at your convenience?<
Carefree
05 February 2009, 13:42


Yes, let's arrange details via EMail.<
philsbbs
06 February 2009, 06:03


Has SB been updated to take into account changes mentioned above ?<
Carefree
06 February 2009, 06:42


No, SnitzBitz is down.<
AnonJr
06 February 2009, 08:41


Seems to be up now...<
Carefree
06 February 2009, 11:53


Updated at SB.<
© 2000-2021 Snitz™ Communications