Title: Auto-locking Topics
Version: v1.0 for Snitz Forums v3.4
Author: laser
Last Update: October 30, 2003
Description:
The Auto-locking topics MOD enables your visitors to set a certain duration that the topic remains open. After this time has elapsed, the topic is locked and no more replies are allowed
Features:
- Forum administrator/code changer can choose the time options (as many as needed)
- Easy installation : 2 (1-easy, 10-difficult )
- All code done in response.write for Snitz v3.4 compatability
Demo:
http://www.v8central.com/forum/ (for this MOD and the Inject Message Text MOD)
Installation Instructions:
Three files to maintain:
- post_info.asp
(Step 1)
approx line 180, you will find :
"T.T_STATUS, T.T_AUTHOR, T.T_SUBJECT " & _
alter that line to :
"T.T_STATUS, T.T_AUTHOR, T.T_SUBJECT, T.T_LOCKDATE " & _
(Step 2)
approx line 210, you will find :
strTopicTitle = rsStatus("T_SUBJECT")
after that line add :
If DateToStr(Now()) > rsStatus("T_LOCKDATE") and rsStatus("T_LOCKDATE") <> "" Then
blnTStatus = 0
End If
(Step 3)
approx line 805, you will find :
strSql = strSql & ", T_UREPLIES"
after that line add :
strSql = strSql & ", T_LOCKDATE"
(Step 4)
approx line 844, you will find :
strSql = strSql & ", 0"
after that line add :
strSql = strSql & ", '" & Request.Form("AutoLock") & "'"
- forum.asp
(Step 5)
approx line 238, you will find :
strSql = strSql & "T.T_LAST_POST_REPLY_ID, M.M_NAME, MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME"
alter that line to :
strSql = strSql & "T.T_LAST_POST_REPLY_ID, M.M_NAME, MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME, T.T_LOCKDATE"
(Step 6)
approx line 456, you will find :
tLAST_POST_AUTHOR_NAME = 14
after that line add :
tAUTOLOCKDATE = 15
(Step 7)
approx line 462, you will find :
Topic_Status = arrTopicData(tT_STATUS, iTopic)
after that line add :
If arrTopicData(tAUTOLOCKDATE, iTopic) <> "" and DateToStr(Now()) > arrTopicData(tAUTOLOCKDATE, iTopic) Then
Topic_Status = 0
End If
- post.asp
(Step 8)
approx line 151, you will find :
"T.T_STATUS, T.T_SUBJECT " & _
alter that line to :
"T.T_STATUS, T.T_SUBJECT, T.T_LOCKDATE " & _
(Step 9)
approx line 534, you will find :
if mlev = 4 or _
before that line add :
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Auto-lock date:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" <select name=""AutoLock"" size=""1"" tabindex=""-1"" >" & vbNewLine & _
" <option value=""" & """>no locking</option>" & vbNewLine & _
" <option value=""" & DateToStr(DateAdd("N",5,Now())) & """>5 mins</option>" & vbNewLine & _
" <option value=""" & DateToStr(DateAdd("N",30,Now())) & """>30 mins</option>" & vbNewLine & _
" <option value=""" & DateToStr(DateAdd("D",5,Now())) & """>5 days</option>" & vbNewLine & _
" <option value=""" & DateToStr(DateAdd("D",10,Now())) & """>10 days</option>" & vbNewLine & _
" <option value=""" & DateToStr(DateAdd("M",1,Now())) & """>1 month</option>"
Response.Write " </select>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" </tr>" & vbNewLine
You can customise these options to your specific needs. The option appears between the Screensize and Format Mode lines when creating a new topic.
- dbs_auto_locking.asp
(Step 10)
Create a new file (named as specified) and add this code :
Auto-locking topics v.1.00
[ALTER]
TOPICS
ADD#T_LOCKDATE#VARCHAR(14)#NULL#
[END]
(Step 11)
That's it !
- upload the dbs file & install via MOD Setup
- upload the other 3 files
- check it out
Support:
If you have problems installing this MOD, either post your questions in the Help: MOD Implementation forum or here.
Feedback:
Suggestions, comments, questions and bug reports are always greatly appreciated! This is my first (published) MOD, it took a few hours to do - all up between starting to finishing this doc was 6 hrs. (I was pleasantly surprised how easy this was. I've added a few more comments here to show others that it can be easy to write and publish MODs, although at the same time I've waited a long time before my first MOD so I had a good knowledge of Snitz as a whole)
Test Environment:
I have only tested this with Access so I would love feedback from other database environments. The only thing I envisage being wrong is the dbs file
Donations:
- Donations are always welcome for support & mod implementations (PayPal : webmaster@v8central.com)
edit (Nov1): fixed typo in post_info.asp, line 210 area.
edit (Nov5): added URL for demo site
edit (Nov7): fixed a bug I found in Step 2