T O P I C R E V I E W |
modifichicci |
Posted - 02 June 2007 : 09:57:33 Using antispam mod checking for a number of posts to allow sending mail or PM, if a memeber post and delete his posts can raise the count and then begin to spam..
But snitz code doesn't update member post count if post is deleted.
So I have modified pop_delete to update count when deleting topics, replies, forum and cat.
This is the pop_delete modified in an original snitz 06 file. Changing are marked by ' #### post count update modifichicci mod #####
and
' #### post count update modifichicci mod ##### END
pop_delete mod
It works on my sql forum, but I think no problem with access also
save file as pop_delete.asp and if you haven't made changes overwrite the old file, or compare files..
Title changed by ruirib< |
15 L A T E S T R E P L I E S (Newest First) |
natty |
Posted - 27 April 2008 : 22:43:15 very nice< |
modifichicci |
Posted - 25 April 2008 : 05:30:18 I think I have solved: here is the new pop_delete.asp
pop_delete.asp
I have changed the function to:
and changed the Ruirib routine to
strUpLastPost = Reply_Autore ' or Topic etc in different section
DataUltimoPost = getultimopost(strUpLastPost)
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " SET M_LASTPOSTDATE = '" & DataUltimoPost & "'"
strSql = strSql & " WHERE MEMBER_ID = " & strUpLastPost
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
If someone knows how to optimize the function, he is welcome.< |
ruirib |
Posted - 23 April 2008 : 18:19:49 A null date is not comparable, you need to test it with IsNull(DataUltimoPostRA) or whatever variable you want to test for Null.< |
modifichicci |
Posted - 23 April 2008 : 16:35:42 I have checked the dates with if DataUltimoPostR > DataUltimoPostRA then response.write "DataUltimoPostR" & DataUltimoPostR else response.write "Dati non corrispondenti" end if response.write "DataUltimoPostT" & DataUltimoPostT response.write "DataUltimoPostRA" & DataUltimoPostRA response.write "DataUltimoPostTA" & DataUltimoPostTA
and dates are selected correctly, and when there is no reply or topics from the author the value is null. But the if statement if DataUltimoPostR > DataUltimoPostRA then with DataUltimoPostR = 20080423223022 and DataUltimoPostRA = "" isn't verify and I get always "Dati non corrispondenti" near the goal but so far..
< |
ruirib |
Posted - 23 April 2008 : 15:39:50 No, because there will be a record, with a single column, but that column will have a null value.< |
modifichicci |
Posted - 23 April 2008 : 15:35:14 that isn't done by bof and eof?< |
ruirib |
Posted - 23 April 2008 : 15:26:27 You will need to test for Null value, since if the user has no posts, max(t_Date) will return a null value. So, test for NULL and if the date is null, set the value for the last post date to ''.< |
modifichicci |
Posted - 23 April 2008 : 14:47:03 Well, to bypass the problem I have tryed this solution:
instead of ruirib's query, i have put strUpLastPost = Reply_Autore DataUltimoPost = getultimopost(strUpLastPost)
and created the function
function getultimopost(strUpLastPost)
strSql = "SELECT MAX(T_DATE) AS T_VALUE FROM " & strTablePrefix & "TOPICS WHERE T_AUTHOR = " & strUpLastPost
set rs = my_Conn.Execute (strSql)
if not(rs.eof or rs.bof) then
DataUltimoPostT = rs("T_VALUE")
else
DataUltimoPostT = ""
end if
rs.close
set rs = nothing
strSql = "SELECT MAX(R_DATE) AS T_VALUE FROM " & strTablePrefix & "REPLY WHERE R_AUTHOR = " & strUpLastPost
set rs = my_Conn.Execute (strSql)
if not(rs.eof or rs.bof) then
DataUltimoPostR = rs("T_VALUE")
else
DataUltimoPostR = ""
end if
rs.close
set rs = nothing
strSql = "SELECT MAX(R_DATE) AS T_VALUE FROM " & strTablePrefix & "A_REPLY WHERE R_AUTHOR = " & strUpLastPost
set rs = my_Conn.Execute (strSql)
if not(rs.eof or rs.bof) then
DataUltimoPostRA = rs("T_VALUE")
else
DataUltimoPostRA = ""
end if
rs.close
set rs = nothing
strSql = "SELECT MAX(T_DATE) AS T_VALUE FROM " & strTablePrefix & "A_TOPICS WHERE T_AUTHOR = " & strUpLastPost
set rs = my_Conn.Execute (strSql)
if not(rs.eof or rs.bof) then
DataUltimoPostTA = rs("T_VALUE")
else
DataUltimoPostTA = ""
end if
rs.close
set rs = nothing
if DataUltimoPostT > DataUltimoPostR then
DUpost = DataUltimoPostT
else
DUpost = DataUltimoPostR
end if
if DataUltimoPostTA > DataUltimoPostRA then
DUpostA = DataUltimoPostTA
else
DUpostA = DataUltimoPostRA
end if
if DUpost > DUpostA then
getultimopost = DUpost
else
getultimopost = DUpostA
end if
end function
no error now.. but.. it worked once with admin and then it get a null value for last post date.. I think there is a logical error in my routine, but i cannot find it and maybe there is a better way to find the max value of four, but I am a surgeon and this is a pure hobby, so if someone can give me some advices he is welcome.. < |
ruirib |
Posted - 22 April 2008 : 15:51:03 Yeah, that figures. MyBadSQL!< |
modifichicci |
Posted - 22 April 2008 : 15:04:37 Running well in Mysql 5. Not on MySql 4.0.27..< |
ruirib |
Posted - 21 April 2008 : 17:06:17 Ok, will wait for your input. I've tested the query in my local 5.0.19 version and a 4.1 server to which I have access and it runs without issues.< |
modifichicci |
Posted - 21 April 2008 : 16:53:27 I have to ask to the admin of the site, on my side there are no problem, in the meantime i will try an installation on a mysql5 server to see if it works. Thanks for your availability< |
ruirib |
Posted - 21 April 2008 : 16:07:01 Can it be that MySQL 4.0 does not support the syntax? I can only access 4.1 and 5.x versions... If your server allows remote access and you don't mind sending me the access data, I may try the query from SQLYog.< |
modifichicci |
Posted - 21 April 2008 : 12:46:00 Thank for help, I am sure I need it a lot!!!
With your code I receive the same error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.0.27-standard-log]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT MAX(T_DATE) AS T_VALUE FROM FORUM_TOPICS WHERE T_AUTHOR
on deleting reply. ( and on deleting topic also, if can help..)
The file is your file I cannot understand what is the issue.. I am blockhead I am afraid..< |
ruirib |
Posted - 21 April 2008 : 05:06:56 You're welcome.< |