The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I saw a function on another forum that I would like to have... In all users profiles there was a percentage of how many post that had been deleted of the total post count on that user. I did a brain fart and had a quick look at pop_delete.asp. Is it as simple as adding this (please check the code for errors...) to pop_delete.asp to add "1" to M_DELPOST for the user that did the post/reply?
Under case "DeleteReply":
strSql = " UPDATE " & strMemberTablePrefix & "MEMBERS M" & _
"SET M.M_DELPOST = M.M_DELPOST + 1 "" & _
" WHERE M.MEMBER_ID = T.R_AUTHOR "
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Under case "DeleteTopic":
strSql = " UPDATE " & strMemberTablePrefix & "MEMBERS M" & _
"SET M.M_DELPOST = M.M_DELPOST + 1 "" & _
" WHERE M.MEMBER_ID = T.R_AUTHOR "
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Then just get that figure from the db and run it against total post count on the user and show the percentage in his/her profile.
Am I totally in the blue here? =)<
Under case "DeleteReply":
strSql = " UPDATE " & strMemberTablePrefix & "MEMBERS M" & _
"SET M.M_DELPOST = M.M_DELPOST + 1 "" & _
" WHERE M.MEMBER_ID = T.R_AUTHOR "
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Under case "DeleteTopic":
strSql = " UPDATE " & strMemberTablePrefix & "MEMBERS M" & _
"SET M.M_DELPOST = M.M_DELPOST + 1 "" & _
" WHERE M.MEMBER_ID = T.R_AUTHOR "
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Then just get that figure from the db and run it against total post count on the user and show the percentage in his/her profile.
Am I totally in the blue here? =)<
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Postet den
It can be done without the need for an additional field; grab the number of posts a member has made from the TOPICS and REPLY tables, subtract that from M_POSTS and use the resulting figure to calculate your percentage. The drawback to this solution is that it requires an extra database hit.
<
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.”
<
Search is your friend
“I was having a mildly paranoid day, mostly due to thefact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Postet den
It would only be used when viewing a profile so one extra hit wouldn't be that much of a problem.
So, something like:
COUNT("SELECT TOPICS FROM FORUM_TOPICS WHERE T_AUTHOR = ppMEMBER_ID" + "SELECT REPLIES FROM FORUM_REPLIES WHERE R_AUTHOR = ppMEMBER_ID") AS MEMBER_POST_COUNT
to count the number of posts?
Then like:
COUNT("M_POSTS - MEMBER_POST_COUNT") AS MEMBER_POST_PERCENTAGE
I have no clue how the syntax should be, I'm just having another brainfart..
(I really like that word =))
<
So, something like:
COUNT("SELECT TOPICS FROM FORUM_TOPICS WHERE T_AUTHOR = ppMEMBER_ID" + "SELECT REPLIES FROM FORUM_REPLIES WHERE R_AUTHOR = ppMEMBER_ID") AS MEMBER_POST_COUNT
to count the number of posts?
Then like:
COUNT("M_POSTS - MEMBER_POST_COUNT") AS MEMBER_POST_PERCENTAGE
I have no clue how the syntax should be, I'm just having another brainfart..
(I really like that word =))
<
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Postet den
Postet den
MySQL, sorry =)
<
<
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Postet den
You don't know what version, do you? Going to try and do it with a nested query but older versions of MySQL don't support them.
<
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.”
<
Search is your friend
“I was having a mildly paranoid day, mostly due to thefact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Postet den
DBMS Name MySQL
DBMS Version 4.0.20a-nt
I suppose this is the mysql version, found it in admin home under "server information". <
DBMS Version 4.0.20a-nt
I suppose this is the mysql version, found it in admin home under "server information". <
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Postet den
Hmm ... think that version should support nested queries so give the following a try:<
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.”
Code:
set rscount=my_conn.execute("SELECT COUNT(*) AS inttcount, (SELECT COUNT(*) AS intrcount FROM "&strTablePrefix&"REPLY WHERE R_AUTHOR="&ppMember_ID&") FROM "&strTablePrefix&"TOPICS WHERE T_AUTHOR="&ppMember_ID)
intpcount=clng(rscount("inttcount"))+clng(rs("intrcount"))
rscount.close
set rscount=nothing
intdpercentage=abs(round(((intTotalMemberPosts-intpcount)/intTotalMemberPosts)*100))
Search is your friend
“I was having a mildly paranoid day, mostly due to thefact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Postet den
heh, that query looks more cool than mine ;)
Thanks alot! I'll give it a try! <
Thanks alot! I'll give it a try! <
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Postet den
Oops, I got this:
Microsoft OLE DB Provider for ODBC Drivers fel '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.0.20a-nt]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 COUNT(*) AS intrcount FROM FORUM_REPLY WHERE R_AUTHOR=50
/pop_profile.asp, line 839
also, this won't count archived posts I suppose? <
Microsoft OLE DB Provider for ODBC Drivers fel '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.0.20a-nt]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 COUNT(*) AS intrcount FROM FORUM_REPLY WHERE R_AUTHOR=50
/pop_profile.asp, line 839
also, this won't count archived posts I suppose? <
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Email Member
Message Member
Post Moderation
Filopplasting
If you're having problems uploading, try choosing a smaller image.
Forhåndsvis post
Send Topic
Loading...