I've seen this asked for a few times and thought I'd try it.
The mod allows admins. to set a time limit for editing posts.
1. Time limit is set in admin options > configure features.
2. Time limit is in days. (I wasn't sure the best way to do the time so I did it lke this)
If you can do the math you can get it down to exact seconds.
7 = 1 week
1 = 1 day
.5 = 12 hrs.
.25 = 6 hrs.
.125 = 3 hrs.
.0625 = 1.5 hrs.
0 = no editing
Notes: I never had time to write the help pages.
Edit 1: I made a few changes and added this to pop_delete.asp.
It works, but I did it real quick and there might be a better place to put it in the file.
It uses the same time limit.
edit 2: I forgot some code
edit 3: 10/29/04 Bug fix in post.asp
edit 4: 10/29/04 Bug fix in pop_delete.asp
Heres the code
edit 2
In config.asp
Find this code
Dim SubCount, MySubCount
Under that add this
Dim strEditPost, strEditTime
Find this code
strShowSmiliesTable = Application(strCookieURL & "STRSHOWSMILIESTABLE")
strShowQuickReply = Application(strCookieURL & "STRSHOWQUICKREPLY")
Under that add this
strEditPost = Application(strCookieURL & "STREDITPOST")
strEditTime = Application(strCookieURL & "STREDITTIME")
End edit 2
In admin_config_features
find this code
if strModeration = "1" and Request.Form("strModeration") = "0" then
if CheckForUnmoderatedPosts("BOARD", 0, 0, 0) > 0 then
Err_Msg = Err_Msg & "<li>Please Approve or Delete all UnModerated/Held posts before turning Moderation off.</li>"
end if
end if
Under that add this
'## Edit Time Mod ### ADD code below ####################################################################################################
if strEditPost = "1" or Request.Form("strEditPost") = "1" then
if IsNumeric(Request.Form("strEditTime")) = "False" then
Err_Msg = Err_Msg & "<li>Edit time must be a number.</li>"
elseif left(Request.Form("strEditTime"), 1) = "-" then
Err_Msg = Err_Msg & "<li>Edit time must be a positive number</li>"
end if
end if
'## End code add on #####################################################################################################################
Find this code
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Show Quick Reply:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" On:<input type=""radio"" class=""radio"" name=""strShowQuickReply"" value=""1""" & chkRadio(strShowQuickReply,0,false) & "> " & vbNewLine & _
" Off:<input type=""radio"" class=""radio"" name=""strShowQuickReply"" value=""0""" & chkRadio(strShowQuickReply,0,true) & ">" & vbNewLine & _
" <a href=""JavaScript:openWindow3('pop_config_help.asp?mode=features#ShowQuickReply')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
Under that add this
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Edit Time Limit:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" On:<input type=""radio"" class=""radio"" name=""strEditPost"" value=""1""" & chkRadio(strEditPost,0,false) & "> " & vbNewLine & _
" Off:<input type=""radio"" class=""radio"" name=""strEditPost"" value=""0""" & chkRadio(strEditPost,0,true) & ">" & vbNewLine & _
" <input type=""text"" name=""strEditTime"" size=""3"" maxLenght=""3"" value=""" & chkExistElse(strEditTime,0) & """>" & vbNewLine & _
" <a href=""JavaScript:openWindow3('pop_config_help.asp?mode=features#Edittime')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a> </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
In post.asp
Find this code
if strRqMethod = "EditForum" then
if (mLev = 4) or (chkForumModerator(strRqForumId, strDBNTUserName) = "1") then
'## Do Nothing
else
Go_Result "Only moderators and administrators can edit forums"
end if
end if
Under that add this
Edit:3 - 10/29/04 change (if strRqMethodType = "Edit" then) to (if strRqMethod = "Edit" then) in code below.
'## Edit time restiction
if strEditPost = 1 then
if mlev < 3 and (strRqMethod = "Edit" or strRqMethod = "EditTopic") then
dim intTime : intTime = int(strEditTime * -86400)
if strRqMethod = "Edit" then
strTable = "R"
strType = "Reply"
strSql = "SELECT R_DATE "
strSql = strSql & " FROM " & strActivePrefix & "REPLY"
strSql = strSql & " WHERE REPLY_ID = " & strRqReplyID
else
strTable = "T"
strType = "Topic"
strSql = "SELECT T_DATE "
strSql = strSql & " FROM " & strActivePrefix & "TOPICS"
strSql = strSql & " WHERE TOPIC_ID = " & strRqTopicID
end if
set rsTimesup = my_Conn.Execute(strSql)
if rsTimesup(strTable & "_DATE") < DateToStr(DateAdd("s",intTime,strForumTimeAdjust)) then
dim strMin, strHr, strDay, strTime
dim intSec : intSec = int(replace(intTime, "-", ""))
dim intMin : intMin = int(intSec/60)
dim intHr : intHr = int(intMin/60)
dim intDay : intDay = int(intHr/24)
select case intDay
case 0
strDay = ""
case 1
strDay = intDay & " day "
case else
strDay = intDay & " days "
end select
strHr = intHr mod 24
select case strHr
case 0
strHr = ""
case 1
strHr = strHr & " hr. "
case else
strHr = strHr & " hrs. "
end select
strMin = intMin mod 60
select case strMin
case 0
strMin = ""
case 1
strMin = strMin & " min."
case else
strMin = strMin & " mins."
end select
if strDay = "" and strHr = "" and strMin = "" then
strTime = "Editing time has been set to 0 by the Forum Admin."
else
strTime = "The set time limit of " & strDay & strHr & strMin & " has been exceeded."
end if
Go_Result "This " & strType & " cannot be edited,<br />" & strTime & "<br />Contact forum administrator or moderator for more information."
else
rsTimesup.close
set rsTimesup = nothing
end if
end if
end if
edit 1
This is for deleting
In pop_delete.asp
Find this code
if request("ARCHIVE") = "true" then
strActivePrefix = strTablePrefix & "A_"
ArchiveView = "true"
ArchiveLink = "ARCHIVE=true&"
else
strActivePrefix = strTablePrefix
ArchiveView = ""
ArchiveLink = ""
end if
Under that add this
Edit 4: Bug fix- 11/01/04 Changed (if strRqMethodType = "Edit" then
) to (if Mode_Type = "DeletReply" then) in the code below.
'## Edit time restiction
if strEditPost = 1 then
if mlev < 3 and (Mode_Type = "DeleteTopic" or Mode_Type = "DeleteReply") then
dim strTable, strType
dim intTime : intTime = int(strEditTime * -86400)
if Mode_Type = "DeleteReply" then
strTable = "R"
strType = "Reply"
strSql = "SELECT R_DATE "
strSql = strSql & " FROM " & strActivePrefix & "REPLY"
strSql = strSql & " WHERE REPLY_ID = " & Reply_ID
else
strTable = "T"
strType = "Topic"
strSql = "SELECT T_DATE "
strSql = strSql & " FROM " & strActivePrefix & "TOPICS"
strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
end if
set rsTimesup = my_Conn.Execute(strSql)
if rsTimesup(strTable & "_DATE") < DateToStr(DateAdd("s",intTime,strForumTimeAdjust)) then
dim strMin, strHr, strDay, strTime
dim intSec : intSec = int(replace(intTime, "-", ""))
dim intMin : intMin = int(intSec/60)
dim intHr : intHr = int(intMin/60)
dim intDay : intDay = int(intHr/24)
select case intDay
case 0
strDay = ""
case 1
strDay = intDay & " day "
case else
strDay = intDay & " days "
end select
strHr = intHr mod 24
select case strHr
case 0
strHr = ""
case 1
strHr = strHr & " hr. "
case else
strHr = strHr & " hrs. "
end select
strMin = intMin mod 60
select case strMin
case 0
strMin = ""
case 1
strMin = strMin & " min."
case else
strMin = strMin & " mins."
end select
if strDay = "" and strHr = "" and strMin = "" then
strTime = "Editing time has been set to 0 by the Forum Admin."
else
strTime = "The set time limit of " & strDay & strHr & strMin & " has been exceeded."
end if
Response.write " <br /><div align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiliteFontColor & """>This " & strType & " cannot be edited,<br />" & strTime & "<br />Contact forum administrator or moderator for more information.</font></div>" &_
" <br />"
WriteFooterShort
Response.end
else
rsTimesup.close
set rsTimesup = nothing
end if
end if
end if
End edit
That's it .