Author |
Topic  |
Ribkick
Junior Member
 
USA
296 Posts |
Posted - 09 May 2001 : 09:36:36
|
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
|
 |
|
Ribkick
Junior Member
 
USA
296 Posts |
Posted - 09 May 2001 : 11:35:17
|
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">
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 09 May 2001 : 12:43:46
|
the reason you are getting that error is that strUserMemberID isn't defined. |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 09 May 2001 : 12:51:35
|
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.  
|
 |
|
Ribkick
Junior Member
 
USA
296 Posts |
Posted - 09 May 2001 : 13:24:14
|
That's great Richard but how do I fix it? Remember, I'm new to this stuff.
|
 |
|
Aznknight
Senior Member
   
USA
1373 Posts |
Posted - 09 May 2001 : 13:41:18
|
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 |
 |
|
Ribkick
Junior Member
 
USA
296 Posts |
Posted - 09 May 2001 : 14:58:02
|
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?
|
 |
|
Aznknight
Senior Member
   
USA
1373 Posts |
Posted - 09 May 2001 : 15:03:49
|
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 |
 |
|
Ribkick
Junior Member
 
USA
296 Posts |
Posted - 09 May 2001 : 16:50:42
|
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?
|
 |
|
Aznknight
Senior Member
   
USA
1373 Posts |
Posted - 09 May 2001 : 17:04:36
|
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 |
 |
|
Ribkick
Junior Member
 
USA
296 Posts |
Posted - 09 May 2001 : 17:22:32
|
WOW!!! Your great man, thanks!!!! 
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 09 May 2001 : 19:23:45
|
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 |
 |
|
Martha2Mary
Junior Member
 
New Zealand
250 Posts |
Posted - 09 May 2001 : 19:52:58
|
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 * |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
|
Martha2Mary
Junior Member
 
New Zealand
250 Posts |
Posted - 10 May 2001 : 00:09:28
|
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 * |
 |
|
Topic  |
|