Author |
Topic  |
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 05 June 2004 : 12:12:23
|
Snitz Version 3.4.3 on a MS_SQL platform.
I have made a new policy, but I need all the exsiting members (1800) to review and either accept to continue access or reject and be denied access to the forum.
Any suggestions or help is appreciated.
NiteOwl |
-=NiteOwl=-
|
Edited by - ruirib on 06 June 2004 16:58:32 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 05 June 2004 : 13:07:34
|
First thing coming to my mind: Create a new field in the members table, like M_VIEW_POLICY that holds 1 if the user has viewed the new policy or 0 if they haven't.
Then in the inc_header.asp file, after they have logged in, check to see if they have viewed the new policy or not. If they haven't, send them to the new policy. Explain to them that they have to accept this new policy before continuing. After they click ok, update the MEMBERS table with 1, in the M_VIEW_POLICY field. If they decline, log them out. |
Support Snitz Forums
|
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 05 June 2004 : 13:18:01
|
Yup, thats a good solution, but its a wee bit detailed for me, I am going to see if I can do this on my DEV site, I will soon see if I am challenged, hehe probably.
Niteowl |
-=NiteOwl=-
|
 |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
Posted - 05 June 2004 : 13:27:12
|
Its actually very easy and should take but 30 mins. Do what Davio said and add the column to the DB. Maybe a little more exp to make it easier for you is on the function that does the login process set a value strNewPolicyViewd and grab it from the DB at the same time the forum checks if the user has a valid account. This way you do not have any extra SQL calls to the DB. Then in the inc_header.asp file do this...
If strNewPolicyViewd = 0 Then Response.Redirect("read_new_policy.asp") End If
Hope this might help a little more. |
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 05 June 2004 : 13:58:06
|
On my DEVelopment My_SQL I did the first challenge (for me) which is to add to the database a new Field titled M_VIEW_POLICY , I made it a SMALLINT length=6 and default=0
Add the information to the inc_header file, which I have just done, basically this is the first If statement.
Cool, seemed to work ok, so now I am ready to:
1. Log-in process function, and grabbing value, this one has me a bit stumped, where should I be going to do this?
NiteOwl |
-=NiteOwl=-
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 05 June 2004 : 14:17:30
|
Create a function, call it something like ReadNewPolicy(fUser_ID), you can put it in the inc_func_common.asp file.
In the function, create a SELECT statement: SELECT M_VIEW_POLICY FROM FORUM_MEMBERS WHERE MEMBER_ID = " & fUser_ID
If rs("M_VIEW_POLICY") = 1 then ReadNewPolicy = True else ReadNewPolicy = False end if
And in the inc_header.asp file:if ReadNewPolicy(Member_ID) = false then
Response.Redirect("read_new_policy.asp")
end if You can try putting it after this code in the inc_header.asp file:if trim(strDBNTUserName) <> "" and trim(Request.Cookies(strUniqueID & "User")("Pword")) <> "" then
chkCookie = 1
mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1))
chkCookie = 0
else
MemberID = -1
mLev = 0
end if |
Support Snitz Forums
|
Edited by - Davio on 05 June 2004 14:18:00 |
 |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
Posted - 05 June 2004 : 18:53:30
|
Well I do not think you want the default to be 0 for that column in the database. If the default is 0 when a user signs up (and reads the policy) then when it logs them in it shows them the new policy saying they need to read it which they just did cause they signed up. If the default was set at 1 (yes they have read it) then new people being added will not have to double read the policy. |
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 05 June 2004 : 19:33:36
|
You can update the M_VIEW_POLICY field with 1 when when a user registers. |
Support Snitz Forums
|
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 05 June 2004 : 22:23:05
|
Should the function statement look something like this?
function ReadNewPolicy(fUser_ID)
strSql = "SELECT M_VIEW_POLICY FROM FORUM_MEMBERS WHERE MEMBER_ID = " & fUser_ID
If rs("M_VIEW_POLICY") = 1 then
ReadNewPolicy = True
else
ReadNewPolicy = False
end if
end function |
-=NiteOwl=-
|
Edited by - NiteOwl on 06 June 2004 13:46:30 |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 05 June 2004 : 22:59:45
|
No. I guess I will need to show you the whole thing:function ReadNewPolicy(fUser_ID)
strSql = "SELECT M_VIEW_POLICY FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & fUser_ID
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn
if rs.EOF then
ReadNewPolicy = false
else
if rs("M_VIEW_POLICY") = 1 then
ReadNewPolicy = true
else
ReadNewPolicy = false
end if
end if
rs.close
set rs = nothing
end function You can try that. I haven't tested the code. I'm just making it up as I go. |
Support Snitz Forums
|
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 05 June 2004 : 23:37:57
|
Thanks Davio, hey I very much appreciate the help and help you have given me in the past, I would be happy and feel I should pay you for this work. With the last addition I now get this error. .
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'
[TCX][MyODBC]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
/BCFMWU_DEV_Snitz/forum/inc_func_common.asp, line 48 |
-=NiteOwl=-
|
Edited by - NiteOwl on 06 June 2004 15:54:47 |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 06 June 2004 : 01:14:47
|
That's alright NiteOwl. Everyone now and then I have to offer some help to others without being paid for it. [:0}
How are you calling the function and where in your inc_header.asp file do you put the call? It seems like the Member ID isn't being passed to the function so 'fUser_ID' is empty. |
Support Snitz Forums
|
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 06 June 2004 : 01:59:29
|
Ok, so far I have done the following:
MySQL Database change to the Forum Members Table Add to the database a new Field titled M_VIEW_POLICY , I made it a SMALLINT length=6 and default=0
Edited the inc_header.asp about line 210 If MemberID>0 Then ' #THEY ARE A MEMBER SO LETS CHECK FOR NEW POLICY PAGE if ReadNewPolicy(MemberID) = false then Response.Redirect("read_new_policy.asp") end if Else ' # THEY ARE NOT A MEMBER SO DON'T DO ANYTHING End If
And put it after this code in the inc_header.asp file: if trim(strDBNTUserName) <> "" and trim(Request.Cookies(strUniqueID & "User")("Pword")) <> "" then chkCookie = 1 mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1)) chkCookie = 0 else MemberID = -1 mLev = 0 end if
Edited the inc_function_common.asp about line 41 function ReadNewPolicy(fUser_ID) strSql = "SELECT M_VIEW_POLICY FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & fUser_ID set rs = Server.CreateObject("ADODB.Recordset") rs.open strSql, my_Conn
if rs.EOF then ReadNewPolicy = false else if rs("M_VIEW_POLICY") = 1 then ReadNewPolicy = true else ReadNewPolicy = false end if end if
rs.close set rs = nothing end function
Created a blank (for now) read_new_policy.asp Basically a copy of the existing policy.asp As suggested below, I modified the reference in this read_new_policy.asp to a seperate inc_header.asp, in my case I copied the original inc.header.asp and renamed it to inc_header2.asp and ensured the new code from above is not included in it. Next you need to change this line <form action="register.asp?mode=Register" id="form1" method="post" name="form1"> with this line <form action="read_new_policy.asp?action=read" id="form1" method="post" name="form1">
Then towards the top of the new policy page you need to add a quick check to see if the form was submitted
If Request.QueryString("action")="read" Then ' # ADD SQL UPDATE STATMENT BELOW strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_VIEW_POLICY = 1 WHERE MEMBER_ID=" & MemberID my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords ' # NOW WE WILL REDIRECT THEM TO THE FORUM SINCE ITS BEEN UPDATED Response.Redirect("default.asp") End If
inc_header2.asp does the read_new_policy.asp file use the same inc_header.asp? If so then you need put a check that if they are on read_new_policy.asp then dont forward them to the page. I created a second inc_header.asp and called it inc_header2.asp, this file is actually an unedited version of the inc_header.asp
|
-=NiteOwl=-
|
Edited by - NiteOwl on 09 June 2004 00:54:31 |
 |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 06 June 2004 : 12:38:58
|
Good eye, thanks I will try it. |
-=NiteOwl=-
|
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 06 June 2004 : 13:42:15
|
BTW, my site TEST site is here http://24.108.167.17/BCFMWU_DEV_Snitz/forum/ and a username is Test10 / Test10
Something is still not quite right, I appear to be caught in a loop, but if I comment out the second line below, the agreement comes up, but it's not yet working as I first need to get caught in the loop, then I comment the line and the agreement shows.
inc_header.asp if ReadNewPolicy(MemberID) = false then ' Response.Redirect("read_new_policy.asp") end if |
-=NiteOwl=-
|
Edited by - NiteOwl on 06 June 2004 13:45:41 |
 |
|
Topic  |
|