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 would like to add a new stat in the Authors column on the topic.asp page. Currently it says something like "123 Posts". I'd also like to add "Topics Started: 10"
The Topics Started would list how many topics have been started by that member. I looked at the database but could not find anything that kept track of that. Is there a way to add it?
The Topics Started would list how many topics have been started by that member. I looked at the database but could not find anything that kept track of that. Is there a way to add it?
نوشته شده در
I think I may have figured it out. I added this:
I think it is working properly.
Edit: Oops. Nevermind. All that does is show the members id number.
Code:
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Topics Started: " & Topic_Author & "</small></font><br />" & vbNewLineEdit: Oops. Nevermind. All that does is show the members id number.
آخرین ویرایش توسط
نوشته شده در
ther is nothing that tracks that, you will have to write a query that counts the number of topics where the user is the TopicAuthor
نوشته شده در
You'll have to use two routines in "topic.asp", one for original posts and one for replies.
Note: If you're using the active members' mod, the closing /td will not be present on the Response Write lines.
Code:
For topics, look for the following line (appx 770):
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Member_Posts & " Posts</small></font></p></td>" & vbNewLine & _
Change it to say:
strSql = "SELECT COUNT(T_AUTHOR) AS CNT FROM " & strTablePrefix & "TOPICS WHERE T_AUTHOR="&TMEMBER_ID
set rsCount = Server.CreateObject("ADODB.Recordset")
rsCount.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
intTotalPosts=rsCount("CNT")
rsCount.close
set rsCount=Nothing
strSql = "SELECT COUNT(R_AUTHOR) AS CNT FROM " & strTablePrefix & "REPLY WHERE R_AUTHOR="&TMEMBER_ID
set rsCount = Server.CreateObject("ADODB.Recordset")
rsCount.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
intTotalReplies=rsCount("CNT")
rsCount.close
set rsCount=Nothing
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & IntTotalPosts & " Posts<br>" & IntTotalReplies & " Replies</small></font></p></td>" & vbNewLine & _
For replies, look for the following line (appx 565):
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Reply_MemberPosts & " Posts</small></font></p></td>" & vbNewLine & _
Change it to say:
strSql = "SELECT COUNT(T_AUTHOR) AS CNT FROM " & strTablePrefix & "TOPICS WHERE T_AUTHOR="&Reply_MemberID
set rsCount = Server.CreateObject("ADODB.Recordset")
rsCount.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
intTotalPosts=rsCount("CNT")
rsCount.close
set rsCount=Nothing
strSql = "SELECT COUNT(R_AUTHOR) AS CNT FROM " & strTablePrefix & "REPLY WHERE R_AUTHOR="&Reply_MemberID
set rsCount = Server.CreateObject("ADODB.Recordset")
rsCount.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
intTotalReplies=rsCount("CNT")
rsCount.close
set rsCount=Nothing
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & IntTotalPosts & " Posts<br>" & IntTotalReplies & " Replies</small></font></p></td>" & vbNewLine & _
Note: If you're using the active members' mod, the closing /td will not be present on the Response Write lines.
آخرین ویرایش توسط
نوشته شده در
It works but doesn't give the correct total. In other words, # of topics plus the # of posts do no add up to the number of posts before the change.
نوشته شده در
That could be because someone could of deleted a post or a few from the user(s).
Originally posted by texanman
It works but doesn't give the correct total. In other words, # of topics plus the # of posts do no add up to the number of posts before the change.
Cheers,
David Greening
David Greening
نوشته شده در
This method cannot count previous (deleted) posts. It only shows posts which still exist. Thus, if you want to include the difference between the standard value and the current value, you'll have to decide whether you want those numbers reflected as posts, topics, or split to a particular degree.
نوشته شده در
I will update the counts in the database (to remove deteled topics/posts) and apply the changes again and see what happens.
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...