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)
 To: Richard Kinser & Slemieux......
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

Ribkick
Junior Member

USA
296 Posts

Posted - 09 May 2001 :  09:36:36  Show Profile
Thanks Alan, that seems to be what I was after One little error code though, any ideas? does it have to do with your SQL commands?

Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'M_TO = AND M_SENT < '20010409064109' AND M_READ = 1'.

/pm_view.asp, line 68


Go to Top of Page

Ribkick
Junior Member

USA
296 Posts

Posted - 09 May 2001 :  11:35:17  Show Profile
Here is how it stands in my pm_view.asp file when error is shown:

'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

<% if strDBNTUserName = "" Then
Response.Redirect "default.asp"
Response.End
else
if Request.Cookies(strCookieURL & "paging")("outbox") = "" then
if strSetCookieToForum = 1 then
Response.Cookies(strCookieURL & "paging").Path = strCookieURL
end if
'#######################################################################
'####### Right now if a user doesn't have an OUTBOX preference #######
'####### set in their cookie it will default to double #######
'####### #######
'####### If you want to change it, just change "double" below #######
'####### to either "single" or "none" #######
'#######################################################################

Response.Cookies(strCookieURL & "paging")("outbox") = "double"
Response.Cookies(strCookieURL & "paging").Expires = dateAdd("d", 360, strForumTimeAdjust)
end if

<!-- BEGIN PRUNE EDIT -->

'Delete messages past 30 days old
strMessageDays = datetostr(dateAdd("d",-30,strForumTimeAdjust))
SQL = "DELETE FROM " & strTablePrefix & "PM WHERE M_TO = " & strUserMemberID & " AND M_SENT < '" & strMessageDays & "' AND M_READ = 1"
my_Conn.Execute SQL

SQL = "DELETE FROM " & strTablePrefix & "PM WHERE M_FROM = " & strUserMemberID & " AND M_SENT < '" & strMessageDays & "' AND M_READ = 1"
my_Conn.Execute SQL

<!-- END PRUNE EDIT -->

%>
<center>
<form action="pm_delete2.asp" method="post" name="DeleteTopic">
<script language="JavaScript">


Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 09 May 2001 :  12:43:46  Show Profile
the reason you are getting that error is that strUserMemberID isn't defined.
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 09 May 2001 :  12:51:35  Show Profile
quote:

Ooooh! What a good idea! Someone post the error code so Alan can fix it and the less adventurous among us can use it!



We could make into a game or contest. Alan's Error Challenge. Maybe set a time limit or something too.

Go to Top of Page

Ribkick
Junior Member

USA
296 Posts

Posted - 09 May 2001 :  13:24:14  Show Profile
That's great Richard but how do I fix it? Remember, I'm new to this stuff.

Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 09 May 2001 :  13:41:18  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
quote:

the reason you are getting that error is that strUserMemberID isn't defined.



woops i forgot that strUserMemberID is a variable that I added to my inc_top.asp page . What it contains is the Member_id of the current user browing the page. I should have named it intUserMemberID but i guess it must have been late that day .

Well anyways, just add this above the code i gave you.

if strDBNTUserName <> "" then strUserMemberID = getMemberID(strDBNTUserName) else strUserMemberID = -1

Oh and did i win the contest? hehe j/k


- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource
Go to Top of Page

Ribkick
Junior Member

USA
296 Posts

Posted - 09 May 2001 :  14:58:02  Show Profile
You won alright! Thanks Alan, that worked perfectly and is just what I was after.

Curious, can the 30 days be changed to 15 just by changing the 30 statements?

Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 09 May 2001 :  15:03:49  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
yep! just change it from -30 to -15 for 15 days old. whatever integer you want.

oh and no probs, glad you got it to work

- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource
Go to Top of Page

Ribkick
Junior Member

USA
296 Posts

Posted - 09 May 2001 :  16:50:42  Show Profile
Thanks again Alan. One more question then I'll not bother you any more. Is it possable to adjust this to delete any PM's, read or not, after the alloted days?

Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 09 May 2001 :  17:04:36  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
Yeah, that's simple, just remove AND M_READ = 1 from the sql statements, like below:


'Delete messages past 30 days old
strMessageDays = datetostr(dateAdd("d",-30,strForumTimeAdjust))

SQL = "DELETE FROM " & strTablePrefix & "PM WHERE M_TO = " & strUserMemberID & " AND M_SENT < '" & strMessageDays & "'"
my_Conn.Execute SQL

SQL = "DELETE FROM " & strTablePrefix & "PM WHERE M_FROM = " & strUserMemberID & " AND M_SENT < '" & strMessageDays & "'"
my_Conn.Execute SQL



- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource

Edited by - aznknight on 09 May 2001 17:05:48
Go to Top of Page

Ribkick
Junior Member

USA
296 Posts

Posted - 09 May 2001 :  17:22:32  Show Profile
WOW!!! Your great man, thanks!!!!

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 09 May 2001 :  19:23:45  Show Profile
Here is a screenshot of the Admin interface I was working on to prune private Messages.

Is this still needed? Alan's solution is automatic, this one would require you to do it manually.

I don't really have a good forum to test it on. If someone wants to test it, I'll post the URL to download it.

But, if you do use it, make sure you backup your database first just be safe.

http://www1.domaindlx.com/dssdbs/files/admin_pmmaint.png
Go to Top of Page

Martha2Mary
Junior Member

New Zealand
250 Posts

Posted - 09 May 2001 :  19:52:58  Show Profile  Visit Martha2Mary's Homepage  Send Martha2Mary an AOL message  Send Martha2Mary an ICQ Message  Send Martha2Mary a Yahoo! Message
quote:

Here is a screenshot of the Admin interface I was working on to prune private Messages.

Is this still needed? Alan's solution is automatic, this one would require you to do it manually.

I don't really have a good forum to test it on. If someone wants to test it, I'll post the URL to download it.

But, if you do use it, make sure you backup your database first just be safe.

http://www1.domaindlx.com/dssdbs/files/admin_pmmaint.png



Hi Richard,

I'd be more than happy to test this for you, so let me know the URL ~ and yes, I would most definately backup my database first

*If Knowledge is Power, and Power Corrupts, what hope is there for Mankind *
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 09 May 2001 :  21:44:56  Show Profile
http://www1.domaindlx.com/dssdbs/files/admin_pmmaint.zip

You'll just need to add a link to it in your admin_home.asp page.
Go to Top of Page

Martha2Mary
Junior Member

New Zealand
250 Posts

Posted - 10 May 2001 :  00:09:28  Show Profile  Visit Martha2Mary's Homepage  Send Martha2Mary an AOL message  Send Martha2Mary an ICQ Message  Send Martha2Mary a Yahoo! Message
quote:

http://www1.domaindlx.com/dssdbs/files/admin_pmmaint.zip

You'll just need to add a link to it in your admin_home.asp page.



Hi Richard,

Have downloaded and implemented it, and had no problems whatsoever getting rid of all read messages older than 30 days. Using TableEditor, I checked the total messages in the forum_pm table both before and after implementing your mod (admin_pmmaint.asp), and it certainly seemed to do what it was supposed to. Very well done!!

If there is any other aspect you would like me to test (like older than 15/45 days, unread messages as well, etc) then just let me know.

*If Knowledge is Power, and Power Corrupts, what hope is there for Mankind *
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | 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.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07