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)
 Required Reading 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
Carefree Posted - 14 December 2008 : 18:32:45
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.<
15   L A T E S T    R E P L I E S    (Newest First)
Carefree Posted - 06 February 2009 : 11:53:43
Updated at SB.<
AnonJr Posted - 06 February 2009 : 08:41:24
Seems to be up now...<
Carefree Posted - 06 February 2009 : 06:42:40
No, SnitzBitz is down.<
philsbbs Posted - 06 February 2009 : 06:03:04
Has SB been updated to take into account changes mentioned above ?<
Carefree Posted - 05 February 2009 : 13:42:42
Yes, let's arrange details via EMail.<
texanman Posted - 05 February 2009 : 10:36:15
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 Posted - 04 February 2009 : 16:06:52
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 Posted - 04 February 2009 : 15:24:52
I tested it. It does the same thing as before the change.<
Carefree Posted - 04 February 2009 : 15:05:29
Yes, the code change was incorporated in the post above.<
texanman Posted - 04 February 2009 : 14:23:35
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 Posted - 04 February 2009 : 14:17:49
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 Posted - 04 February 2009 : 12:30:11
Thanks Carefree
I am running a private forum indeed.
I did replace it. The forum doesn't go past "sucessfully logged in". :-)<
Carefree Posted - 04 February 2009 : 12:09:35
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:
<%
'###############################################################################
'## 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 Posted - 04 February 2009 : 02:33:53
quote:
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:


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




It prints the following:

C_VALUE=2009
TopID=2009<
Carefree Posted - 04 February 2009 : 01:31:38
In "inc_required.asp", after the "end if" on line 45, insert these two lines and see what it prints out:


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

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