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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Users delete their own topics
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

stone5150
Starting Member

36 Posts

Posted - 22 May 2007 :  21:00:39  Show Profile
I want to set it up so that users can delete their own topics even after other posts have been made.

Did I miss something in the config or is there something I need to change?

I am fairly adept at ASP. While I haven't figured out all of Snitz Forum code, I can edit it well anyway if I know where to look.

AnonJr
Moderator

United States
5768 Posts

Posted - 22 May 2007 :  22:06:43  Show Profile  Visit AnonJr's Homepage
You didn't miss anything. Its set up so that only Admins and Moderators can delete a topic once posts are made. If I were to hazard a guess, its so that people won't be twats and delete a topic in a huff when someone says something they don't like.

I don't have any clean code in front of me at the moment, so I can't say exactly where to make the changes. I'd guess you'd want to look in forum.asp for where the code calls TopicMemberOptions (and you're probably going to want to look at the function itself too); and you're going to want to look at topic.asp - the exact parts escape me at the moment....

Hope that gets you started. If I get the time I may try to look a little more deeply, but to be honest I haven't had much time to do more than make a few posts and leave. =/
Go to Top of Page

Hermes
Junior Member

Croatia
113 Posts

Posted - 23 May 2007 :  02:36:28  Show Profile

Errrm.
Can not Edit Time Limit Mod > do that.

There you can set limit in minutes, hours, days for users to delete or change their posts.




ASP Snitz Forum Upute za instalaciju
http://www.kairos.com.hr http://www.hermetizam.com Forum

not so newbie any more :)
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 23 May 2007 :  04:21:33  Show Profile
... And pop_delete.asp, as well.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 23 May 2007 :  06:19:27  Show Profile  Visit AnonJr's Homepage
quote:
Originally posted by Hermes

Errrm.
Can not Edit Time Limit Mod > do that.

There you can set limit in minutes, hours, days for users to delete or change their posts.

Not quite what he's looking for. In the base code, if you start a new thread, and I reply, you can't delete the thread any more. He's wanting to change that so you can still delete the thread you started regardless of any replies.


quote:
Originally posted by Shaggy

... And pop_delete.asp, as well.

Thanks, I knew I was forgetting something.
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 23 May 2007 :  09:52:17  Show Profile
Thanks, I will dig around in those 2 files when I get a chance, probably not today tho. If anyone knows what line or string I am looking for that would help greatly as well.
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 23 May 2007 :  10:25:59  Show Profile
I am not all that worried that people will delete topics in a huff because it is a company bulletin board that shouldn't have any of that sort of discussions anyway. If someone does I am sure someone else will complain to their supervisor and we will deal with it according to established policies.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 23 May 2007 :  10:34:40  Show Profile  Visit AnonJr's Homepage
Knowing human nature, eventually someone will get into a heated discussion and delete the topic at some point in time (or by accident - ask one of my moderators...). But if you've got the policies in place, and everyone is aware of them, you shouldn't have too much grief dealing with it.

Good luck, and if you come up with a solution before one is posted please post it here so if anybody else ever needs it its available.
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 23 May 2007 :  10:52:48  Show Profile
We had a Toast forum for several years before this one and policies were put in place for that one as well as the old ones that date back to communication in the form of paper memos (anyone old enough to remember those?).

BTW Snitz Forums are far superior to Toast in so many ways that it is not worth the time to list how many.

If I come up with a solution to it I will post it here.

Anyway, I am off to prepare for a consulting call I have been putting off for too long.

Edited by - stone5150 on 23 May 2007 11:24:37
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 24 May 2007 :  15:14:43  Show Profile
So far I have figured out how to add the delete topic icon back regardless of a post.

topic.asp Line 887
if (AdminAllowed = 1) or (TMember_ID = MemberID and Topic_Replies < 0) then
Change to
if (AdminAllowed = 1) or (TMember_ID = MemberID) then

Now onto finding permissions.
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 24 May 2007 :  15:41:14  Show Profile
The permissions prob is in here somewhere I am pretty sure, but I can't find it. Anyone?

case "DeleteTopic"
strEncodedPassword = sha256("" & strPassword)
mLev = cLng(chkUser5(strDBNTFUserName, strEncodedPassword, Topic_ID))
if mLev = 0 then '## is Member
if (chkForumModerator(Forum_ID, strDBNTFUserName) = "1") or (mLev = 1) or (mLev = 4) then
delAr = split(Topic_ID, ",")
for i = 0 to ubound(delAr)

'## Forum_SQL - count total number of replies of TOPIC_ID in Reply table
set rs = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT count(REPLY_ID) AS cnt "
strSql = strSql & " FROM " & strActivePrefix & "REPLY "
strSql = strSql & " WHERE TOPIC_ID = " & cLng(delAr(i))

rs.Open strSql, my_Conn
risposte = rs("cnt")
rs.close
set rs = nothing

'## Forum_SQL - get topic status so you know if the counts need to be updated
set rs = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT T_STATUS "
strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
strSql = strSql & " WHERE TOPIC_ID = " & cLng(delAr(i))

rs.Open strSql, my_Conn

Topic_Status = rs("T_STATUS")

rs.close
set rs = nothing

'## Forum_SQL - Delete the actual topics
strSql = "DELETE FROM " & strActivePrefix & "TOPICS "
strSql = strSql & " WHERE TOPIC_ID = " & cLng(delAr(i))
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

'## Forum_SQL - Delete all replys related to the topics
strSql = "DELETE FROM " & strActivePrefix & "REPLY "
strSql = strSql & " WHERE TOPIC_ID = " & cLng(delAr(i))
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

'## Forum_SQL - Delete any subscriptions to this topic
strSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS "
strSql = strSql & " WHERE TOPIC_ID = " & cLng(delAr(i))
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

'## Don't update if topic was in archive
if (Topic_Status <= 1) and (ArchiveView = "") then
'## Forum_SQL - Get last_post and last_post_author for Forum
strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID"
strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID & " "
strSql = strSql & " ORDER BY T_LAST_POST DESC"

set rs = my_Conn.Execute (strSql)

if not rs.eof then
rs.movefirst
strLast_Post = rs("T_LAST_POST")
strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
strLast_Post_Topic_ID = rs("TOPIC_ID")
strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
else
strLast_Post = ""
strLast_Post_Author = "NULL"
strLast_Post_Topic_ID = 0
strLast_Post_Reply_ID = 0
end if

rs.Close
set rs = nothing

'## Forum_SQL - Update count of replies to a topic in Forum table
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET F_COUNT = F_COUNT - " & cLng(risposte) + 1
strSql = strSql & ", F_TOPICS = F_TOPICS - " & 1
strSql = strSql & ", F_LAST_POST = '" & strLast_Post & "' "
strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author
strSql = strSql & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

'## Forum_SQL - Update total TOPICS in Totals table
strSql = "UPDATE " & strTablePrefix & "TOTALS "
strSql = strSql & " SET T_COUNT = T_COUNT - " & 1
strSql = strSql & ", P_COUNT = P_COUNT - " & cLng(risposte) + 1
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end if
next
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><b>Topic Deleted!</b></font></p>" & vbNewLine & _
" <script language=""javascript1.2"">self.opener.location.reload();</script>" & vbNewLine
else
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><b>No Permissions to Delete Topic</b></font><br />" & vbNewLine & _
"<br /><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick=history.go(-1)"">Go Back to Re-Authenticate</a></font></p>" & vbNewLine
end if
else
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><b>No Permissions to Delete Topic</b></font><br />" & vbNewLine & _
"<br /><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick=history.go(-1)"">Go Back to Re-Authenticate</a></font></p>" & vbNewLine
end if

Edited by - stone5150 on 25 May 2007 10:06:35
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 25 May 2007 :  10:07:36  Show Profile
I think it is in the first two IF statements, I have tried different variations but no luck so far.
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 30 May 2007 :  14:21:41  Show Profile
I haven't had much time to play with this lately.

Anyone have any ideas?
Go to Top of Page

stone5150
Starting Member

36 Posts

Posted - 11 June 2007 :  15:35:20  Show Profile
I figured out that it is this line

if (chkForumModerator(Forum_ID, strDBNTFUserName) = "1") or (mLev = 1) or (mLev = 4) then

I changed it to

if 1 = 1 then

Which works but I can't imagine that it is all that secure, but I can't work out what it should be.

Any ideas?
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 June 2007 :  16:07:02  Show Profile  Send ruirib a Yahoo! Message
I don't think that's safe at all... but I'm not sure what you're meaning when talking about 'permissions'...


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 11 June 2007 :  16:26:07  Show Profile  Visit AnonJr's Homepage
I don't think that's the right IF you're looking for anyway... basically its checking to see if you are the topic author (mLev = 1), an Administrator (mLev = 4), or a Moderator for that forum. You'll still want that check in place unless you want to allow anybody to delete the topic.
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 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.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07