Can this mod be used to have new members in jail by default? We want new members to have the ability to post in one area only at first and read all others until they get used to the boards. Thanks
I was bored so I made a couple of updates to this mod. lol
First, I created a new file called "admin_amnesty.asp". Just in case the admin is feeling kind and generous, he/she can run this and create a random date to release anyone who is in prison as of the date the amnesty program is run. The date will be anytime within a specified range: 1 month, 3 months, 6 months or 1 year.
The date generated will be inserted into anyone's record who is in jail at that moment. If they are STILL in jail when that date is reached, the next time they logon they'll automatically get released.
The User Groups mod and the Prison Mod MUST both be installed before adding this feature. Also, the title of the prisoner group MUST be Prisoners (or you'll have to change it in both the admin_amnesty and inc_header files).
Necessary changes to use this additional feature:
(1) Save this file as "dbs_prisoner.asp"
Prison Mod Amnesty
[ALTER]
USERGROUP_USERS
ADD#RELEASE_DATE#VARCHAR(14)#NULL#
[END]
(2) Within the admin control panel, select "Mod Setup" and choose the "Prison Mod Amnesty" mod to update database.
Look for the following line (appx 153):
" <LI><span class=""spnMessageText""><a href=""setup.asp"">Check Installation</a></span><font size=""" & strFooterFontSize & """><b> (Run after each upgrade !)</b></font></LI>" & vbNewLine & _
After it, insert this:
" <LI><span class=""spnMessageText""><a href=""admin_Amnesty.asp"">Amnesty</a></span></LI>" & vbNewLine & _
(5) Modify "inc_header.asp"
Look for these lines (appx 81-84):
If strDBType = "" then
Response.Write "<html>" & vbNewLine & _
"<head>" & vbNewline & _
"<title>" & strForumTitle & "</title>" & vbNewline
Above them, insert the following:
'####### Begin UserGroup MOD #######
if Session(strCookieURL & "UserGroups" & MemberID) = "" or _
IsNull(Session(strCookieURL & "UserGroups" & MemberID)) then
strGroupMembership = getGroupMembership(MemberID,1)
Session(strCookieURL & "UserGroups" & MemberID) = strGroupMembership
Session(strCookieURL & "UserGroups" & MemberID) = strGroupMembership
else
strSql="SELECT USERGROUP_ID, USERGROUP_NAME FROM " & strTablePrefix & "USERGROUPS WHERE USERGROUP_NAME='Prisoners'"
set rsPrisoners=my_Conn.Execute(strSql)
if not rsPrisoners.EOF then
intUID=rsPrisoners("USERGROUP_ID")
rsPrisoners.Close
end if
set rsPrisoners=Nothing
strSql="SELECT ORIGINAL_ID, USERGROUP_ID, MEMBER_ID, RELEASE_DATE FROM " & strTablePrefix & "USERGROUP_USERS WHERE MEMBER_ID=" & MemberID
set rsPrisoners=my_Conn.Execute(strSql)
if not rsPrisoners.EOF then
intORI=rsPrisoners("ORIGINAL_ID")
intRPI=rsPrisoners("USERGROUP_ID")
strRD=rsPrisoners("RELEASE_DATE")
rsPrisoners.Close
end if
set rsPrisoners=Nothing
if isNull(strRD) then
strSql="UPDATE " & strTablePrefix & "USERGROUP_USERS SET RELEASE_DATE='0' WHERE MEMBER_ID="& MemberID
my_Conn.Execute(strSql)
end if
if (intRPI=intUID) AND (strRD < DatetoStr(strForumTimeAdjust)) AND (strRD <> "0") then 'is Released due to Amnesty
strRD="0"
strSql="UPDATE "& strTablePrefix & "USERGROUP_USERS SET USERGROUP_ID=" & intORI & ", RELEASE_DATE='0' WHERE MEMBER_ID=" & MemberID
my_Conn.Execute(strSql)
Response.Write "Congratulations! Due to admin amnesty, you have been released from Correctional Custody.<br>To regain access to all forum functions, you must sign out and back in."
Call ClearCookies
Response.Write "<meta http-equiv=""Refresh"" content=""6; URL=default.asp"">" & vbNewLine & _
"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""default.asp"">Back To Forum</font></a></p>" & vbNewLine
WriteFooter
Response.End
end if
end if
'####### End UserGroup MOD #######
(6) Finally, replace "warden.asp" with this:
Note: If you used a forum name other than "Correctional Custody", you will need to replace it on line 51.