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/O Code)
 timing edit feature
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

e3stone
Average Member

USA
885 Posts

Posted - 03 June 2001 :  04:34:01  Show Profile  Send e3stone an AOL message
How involved would it be to only allow people to edit their message for the first, say, 60 minutes that the message was posted? Also, I don't want the users to be able to delete their messages. (I'm going to have a News/Views section which might contain debates, etc, so I don't want people to come back days later and change their message and say "I didn't say that..", for example.)

I was going to check if someone else had done anything similar to this before I dig into the code.

Could anyone tell me what pages would need to be edited? would it be just topic.asp? then the admin page to be able to set the times, etc?

<-- Eric -->


http://insidewaco.com/forum/home.asp

GBurch
Junior Member

United Kingdom
107 Posts

Posted - 03 June 2001 :  11:17:00  Show Profile
This would be very useful. Let me know when it's finished.

http://www.captgb.dabsol.co.uk
http://www.slipstreamservices.com
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 03 June 2001 :  13:46:24  Show Profile  Send e3stone an AOL message
found a bug...I'll repost later

Edited by - e3stone on 03 June 2001 13:47:04
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 03 June 2001 :  13:48:37  Show Profile  Send e3stone an AOL message
Ok, this might not be the best way to do it, but it works (as far as I know)

In post.asp, right after the </script> tag insert this code:

<%
Err_Msg = ""
if strRqMethod = "Edit" then
editSQL = "SELECT " & strTablePrefix & "REPLY.R_DATE"
editSQL = editSQL & " FROM " & strTablePrefix & "REPLY"
editSQL = editSQL & " WHERE " & strTablePrefix & "REPLY.REPLY_ID =" & Request.QueryString("REPLY_ID")
set rsTopicEdit = my_Conn.Execute (editSql)
if (DateToStr(strForumTimeAdjust) - rsTopicEdit("R_DATE")) > 3600 then 'Adjust this number for however many seconds you want the people to be able to edit
Err_Msg = "<li>Sorry, you cannot edit your message after 60 minutes</li><br><p><center><a href=""JavaScript:history.go(-1)"">Go Back</a></center></p>"
end if
end if

If Err_Msg = "" Then 'if edit, then it has been under 60 minutes
%>

then, at the bottom, right before the include for the footer, insert this code:

else
%>
<table align=center>
<tr>
<td align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><center>
<ul>
<% =Err_Msg %>
</ul>
</center></font>
</td>
</tr>
</table>
<%
end if

%>

Because I'm using the Reply_ID field & the time inserted in that recordset, I'm not able to limit the time on the original message (the first one in the thread) does anyone know if this can be done? I'm not sure if I'm going to worry about it, though.

<-- Eric -->


http://insidewaco.com/forum/home.asp

<-- Eric -->


http://insidewaco.com/forum/home.asp

Edited by - e3stone on 03 June 2001 13:54:35
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 03 June 2001 :  23:48:02  Show Profile  Send e3stone an AOL message
for those of you who use this, just remember to edit your faq page so it says you only have 60 minutes (or however long you set it at) http://www.insidewaco.com/forum/faq.asp#edit

<-- Eric -->


http://insidewaco.com/forum/home.asp
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 04 June 2001 :  02:56:24  Show Profile
quote:

Because I'm using the Reply_ID field & the time inserted in that recordset, I'm not able to limit the time on the original message (the first one in the thread) does anyone know if this can be done? I'm not sure if I'm going to worry about it, though.



I think the edit topic link has a different querystring than the edit reply link. Find the right one and then do the same thing you did above, but instead, topic uses T_DATE for the date the topic was posted.

The Writer Community

"Do not go where the path may lead, go instead where there is no path and leave a trail."

-Ralph Waldo Emerson
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 04 June 2001 :  03:34:14  Show Profile  Send e3stone an AOL message
Ok, here's the code to be able to edit BOTH the first message and all the other. It also allows the admin and moderators to edit messages at any time (even after 60 minutes)

replace this code:
<%
Err_Msg = ""
if strRqMethod = "Edit" then
editSQL = "SELECT " & strTablePrefix & "REPLY.R_DATE"
editSQL = editSQL & " FROM " & strTablePrefix & "REPLY"
editSQL = editSQL & " WHERE " & strTablePrefix & "REPLY.REPLY_ID =" & Request.QueryString("REPLY_ID")
set rsTopicEdit = my_Conn.Execute (editSql)
if (DateToStr(strForumTimeAdjust) - rsTopicEdit("R_DATE")) > 3600 then 'Adjust this number for however many seconds you want the people to be able to edit
Err_Msg = "<li>Sorry, you cannot edit your message after 60 minutes</li><br><p><center><a href=""JavaScript:history.go(-1)"">Go Back</a></center></p>"
end if
end if

If Err_Msg = "" Then 'if edit, then it has been under 60 minutes
%>

with this code:

<%
IF strRqMethod = "EditTopic" or _
strRqMethod = "Edit" then
Err_Msg = ""
if strRqMethod = "EditTopic" then
editSQL = "SELECT " & strTablePrefix & "TOPICS.T_DATE"
editSQL = editSQL & " FROM " & strTablePrefix & "TOPICS"
editSQL = editSQL & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID=" & Request.QueryString("TOPIC_ID")
set rsTopicEdit = my_Conn.Execute (editSql)
if (DateToStr(strForumTimeAdjust) - rsTopicEdit("T_DATE")) > 3600 then
Err_Msg = "<li>Sorry, you cannot edit your message after 60 minutes</li><br><p><center><a href=""JavaScript:history.go(-1)"">Go Back</a></center></p>"
end if
ELSEif strRqMethod = "Edit" then

editSQL = "SELECT " & strTablePrefix & "REPLY.R_DATE"
editSQL = editSQL & " FROM " & strTablePrefix & "REPLY"
editSQL = editSQL & " WHERE " & strTablePrefix & "REPLY.REPLY_ID =" & Request.QueryString("REPLY_ID")
set rsTopicEdit = my_Conn.Execute (editSql)
if (DateToStr(strForumTimeAdjust) - rsTopicEdit("R_DATE")) > 3600 then
Err_Msg = "<li>Sorry, you cannot edit your message after 60 minutes</li><br><p><center><a href=""JavaScript:history.go(-1)"">Go Back</a></center></p>"
end if
END IF



end if

If (Err_Msg = "") or (mlev = 3) or (mlev = 4) then 'if edit, then it has been under 60 minutes
%>

<-- Eric -->


http://insidewaco.com/forum/home.asp
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 04 June 2001 :  06:01:45  Show Profile
e3stone,

This is a nice little mod you have here.. Works great.. Should stop (or start) a few fights from people saying stuff in the forums on my site and then saying that they didn't say it...

Good work..


quote:

Ok, here's the code to be able to edit BOTH the first message and all the other. It also allows the admin and moderators to edit messages at any time (even after 60 minutes)

replace this code:
<%
Err_Msg = ""
if strRqMethod = "Edit" then
editSQL = "SELECT " & strTablePrefix & "REPLY.R_DATE"
editSQL = editSQL & " FROM " & strTablePrefix & "REPLY"
editSQL = editSQL & " WHERE " & strTablePrefix & "REPLY.REPLY_ID =" & Request.QueryString("REPLY_ID")
set rsTopicEdit = my_Conn.Execute (editSql)
if (DateToStr(strForumTimeAdjust) - rsTopicEdit("R_DATE")) > 3600 then 'Adjust this number for however many seconds you want the people to be able to edit
Err_Msg = "<li>Sorry, you cannot edit your message after 60 minutes</li><br><p><center><a href=""JavaScript:history.go(-1)"">Go Back</a></center></p>"
end if
end if

If Err_Msg = "" Then 'if edit, then it has been under 60 minutes
%>

with this code:

<%
IF strRqMethod = "EditTopic" or _
strRqMethod = "Edit" then
Err_Msg = ""
if strRqMethod = "EditTopic" then
editSQL = "SELECT " & strTablePrefix & "TOPICS.T_DATE"
editSQL = editSQL & " FROM " & strTablePrefix & "TOPICS"
editSQL = editSQL & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID=" & Request.QueryString("TOPIC_ID")
set rsTopicEdit = my_Conn.Execute (editSql)
if (DateToStr(strForumTimeAdjust) - rsTopicEdit("T_DATE")) > 3600 then
Err_Msg = "<li>Sorry, you cannot edit your message after 60 minutes</li><br><p><center><a href=""JavaScript:history.go(-1)"">Go Back</a></center></p>"
end if
ELSEif strRqMethod = "Edit" then

editSQL = "SELECT " & strTablePrefix & "REPLY.R_DATE"
editSQL = editSQL & " FROM " & strTablePrefix & "REPLY"
editSQL = editSQL & " WHERE " & strTablePrefix & "REPLY.REPLY_ID =" & Request.QueryString("REPLY_ID")
set rsTopicEdit = my_Conn.Execute (editSql)
if (DateToStr(strForumTimeAdjust) - rsTopicEdit("R_DATE")) > 3600 then
Err_Msg = "<li>Sorry, you cannot edit your message after 60 minutes</li><br><p><center><a href=""JavaScript:history.go(-1)"">Go Back</a></center></p>"
end if
END IF



end if

If (Err_Msg = "") or (mlev = 3) or (mlev = 4) then 'if edit, then it has been under 60 minutes
%>

<-- Eric -->


http://insidewaco.com/forum/home.asp



Regards,

Webmaster @ Classic Motor Cycling
Classic Motor Cycling
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 06 June 2001 :  05:26:24  Show Profile  Send e3stone an AOL message
Excellent. I'm glad you like it

<-- Eric -->


InsideWaco.com
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.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07