Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD : Auto-locking Topics v.1.0 (for Snitz3403)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

laser
Advanced Member

Australia
3859 Posts

Posted - 30 October 2003 :  02:12:47  Show Profile

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

Edited by - laser on 07 November 2003 04:18:49

Etymon
Advanced Member

United States
2385 Posts

Posted - 31 October 2003 :  21:26:51  Show Profile  Visit Etymon's Homepage
Thank you, laser.

I think this will be useful for my purposes especially for events and classifieds.

Etymon
Go to Top of Page

Faizan
Average Member

United Kingdom
592 Posts

Posted - 31 October 2003 :  23:16:07  Show Profile  Visit Faizan's Homepage  Send Faizan an AOL message  Send Faizan an ICQ Message  Send Faizan a Yahoo! Message
Nice MOD Laser. I will be using it..

I also have a question, does it also work with a Poll MOD? I mean does it also lock a poll if a topic gets lock using this?



»Snitz Graphics
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 01 November 2003 :  00:00:09  Show Profile
I would guess so, but I don't use the Poll mod to try it.

My MOD basically compares the LockDate to Now(), so I would guess that this mod would lock polls as well.
Go to Top of Page

Faizan
Average Member

United Kingdom
592 Posts

Posted - 01 November 2003 :  00:28:42  Show Profile  Visit Faizan's Homepage  Send Faizan an AOL message  Send Faizan an ICQ Message  Send Faizan a Yahoo! Message
OK Thanks, that means I am definetly trying it!





»Snitz Graphics
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 01 November 2003 :  03:37:33  Show Profile  Visit Gremlin's Homepage
Looks like a handy MOD, might be useful on one of my older forums.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 01 November 2003 :  03:50:02  Show Profile
I haven't installed this, I was just looking over the instructions above, shouldn't this:
If DateToStr(Now()) > rsStatus("T_LOCKED") Then
    blnTStatus = 0
End If
actually be:
If DateToStr(Now()) > rsStatus("T_LOCKDATE") Then
    blnTStatus = 0
End If
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 01 November 2003 :  06:59:42  Show Profile
You're right Richard - thanks !!

Just goes to show I should never think of changing field names half way through it will bite you every time.
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 01 November 2003 :  08:39:39  Show Profile  Visit Gremlin's Homepage
quote:
it will bite you every time.
Sure does, and yes I'm speaking from experience there too

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

homeacademy
Junior Member

USA
163 Posts

Posted - 02 November 2003 :  08:40:14  Show Profile
Screenshots?
Go to Top of Page

Image
Average Member

Canada
574 Posts

Posted - 02 November 2003 :  18:32:53  Show Profile  Visit Image's Homepage  Send Image an ICQ Message
The probleme is
You can not "Un-Lock Topic" after
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 02 November 2003 :  18:41:42  Show Profile
quote:
Originally posted by Image

The probleme is
You can not "Un-Lock Topic" after


At the moment you must follow this procedure to unlock or edit the locking time :

To unlock completely : Edit the table and clear out the contents of the T_LOCKDATE field for the topic.

To edit the locking time : Edit the table and alter the contents of the T_LOCKDATE field for the topic. The field uses the normal Snitz date/time format of YYYYMMDDHHMMSS

Disclaimer : This MOD was designed with events, classifieds (and maybe polls) in mind, so I didn't worry about the editting capability at all, but at the same time I knew it wasn't there. ...I should have put that in my initial post.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07