Author |
Topic |
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 09 August 2002 : 09:43:24
|
I've just noticed this on peoples profiles:
Total Posts: 332 [1% of total forum posts / 1.27 posts per day]
I've seen it on other forums aswell.
Does anyone have the code for it please? |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 09 August 2002 : 10:24:54
|
OK, here's a little something I wrote myself with some help from Ruirib, Hamlin & Gremlin, I was going to package it up as a Mod before I saw that it was already included in 3.4. All line references below are for a clean copy of version 3.3.03.
In pop_profile.asp find the following beginning on line 424:
<tr> <td bgColor="<% =strPopUpTableColor %>" align=right nowrap valign=top><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Total Posts: </font></b></td> <td bgColor="<% =strPopUpTableColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% = ChkString(rs("M_POSTS"), "display") %></font></td> </tr> And replace it with this:
<%' ################ BEGIN MeTV's Post Stats Mod ################ end if StrSQLTotals = "SELECT P_COUNT, P_A_COUNT FROM FORUM_TOTALS" RSTotals = my_Conn.Execute(StrSQLTotals) intPercentage = (ChkString(rs("M_POSTS"), "display") / (RSTotals("P_COUNT") + RSTotals("P_A_COUNT"))) * 100 intMemberDays = DateDiff("d",ChkDate(rs("M_DATE")),strForumTimeAdjust) if intMemberDays = 0 then intMemberDays = 1 end if intMemberPostDays = ChkString(rs("M_POSTS"), "display") / intMemberDays %> <tr> <td bgColor="<% =strPopUpTableColor %>" align=right nowrap valign=top><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Total Posts: </font></b></td> <td bgColor="<% =strPopUpTableColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% = ChkString(rs("M_POSTS"), "display") %><br>(<% = FormatNumber(intPercentage,1)%>% of all posts)<br>(<% = FormatNumber(intMemberPostDays,2) %> posts per day)</font></td> </tr> <%' ################ END MeTV's Post Stats Mod ################ %>
c ya in the funny books MeTV - tvthemetunes.net - forums house of design - graphic design consultants "I have not failed. I've just found 10000 ways that won't work." |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 09 August 2002 : 11:50:51
|
Cheers!
I was going to use it some other places aswell as profile, but thanks for the info on the placement. |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 09 August 2002 : 12:17:13
|
You're welcome!
You may have to make some changes to recordset names, etc. if you want to use it on other pages, let me know if you come across any problems.
c ya in the funny books MeTV - tvthemetunes.net - forums house of design - graphic design consultants "I have not failed. I've just found 10000 ways that won't work." |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 09 August 2002 : 12:31:17
|
quote: Originally posted by mortioli
Cheers!
I was going to use it some other places aswell as profile, but thanks for the info on the placement.
let me know if you are interested in doing something like this, I made this based on requests from my members and its proven to be pretty fast and very useful for those stat-mongers. :
http://www.burningsoulsforum.com/forum/members.asp |
|
Edited by - dayve on 09 August 2002 12:31:37 |
|
|
Darkness
Junior Member
Italy
145 Posts |
Posted - 13 August 2002 : 16:43:28
|
I have this error:
Microsoft VBScript compilation error '800a03fe'
Expected 'Select'
/forum/pop_profile.asp, line 424
end if ----^
Why? |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 13 August 2002 : 17:10:27
|
Yeah that would cool dayve! Cheers! |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 13 August 2002 : 17:15:52
|
quote: Originally posted by mortioli
Yeah that would cool dayve! Cheers!
I am at work right now, I will post the code later this evening. |
|
|
|
Darkness
Junior Member
Italy
145 Posts |
Posted - 13 August 2002 : 17:43:23
|
If i try this code :
<%' ################ BEGIN MeTV's Post Stats Mod ################
StrSQLTotals = "SELECT P_COUNT, P_A_COUNT FROM FORUM_TOTALS" RSTotals = my_Conn.Execute(StrSQLTotals) intPercentage = (ChkString(rs("M_POSTS"), "display") / (RSTotals("P_COUNT") + RSTotals("P_A_COUNT"))) * 100 intMemberDays = DateDiff("d",ChkDate(rs("M_DATE")),strForumTimeAdjust) if intMemberDays = 0 then intMemberDays = 1 end if intMemberPostDays = ChkString(rs("M_POSTS"), "display") / intMemberDays %> <tr> <td bgColor="<% =strPopUpTableColor %>" align=right nowrap valign=top><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Total Posts: </font></b></td> <td bgColor="<% =strPopUpTableColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% = ChkString(rs("M_POSTS"), "display") %><br>(<% = FormatNumber(intPercentage,1)%>% of all posts)<br>(<% = FormatNumber(intMemberPostDays,2) %> posts per day)</font></td> </tr> <%' ################ END MeTV's Post Stats Mod ################ %>
All works fine...
|
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 14 August 2002 : 05:27:27
|
Sorry about that little "end if" problem, I just copied and pasted that bit of code from my pop_profile.asp. If you read back over some of my posts, you'll notice there's always a problem with "end if" when I try to help people!
c ya in the funny books MeTV - tvthemetunes.net - forums house of design - graphic design consultants "I have not failed. I've just found 10000 ways that won't work." |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 14 August 2002 : 12:25:07
|
quote: Originally posted by dayve
quote: Originally posted by mortioli
Yeah that would cool dayve! Cheers!
I am at work right now, I will post the code later this evening.
No problem! Cheers mate! |
|
|
vweyes
New Member
74 Posts |
|
|
Topic |
|