Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Number Of Topic Posts
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 March 2009 :  14:34:40  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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?

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 March 2009 :  16:01:42  Show Profile  Visit leatherlips's Homepage  Reply with Quote
I think I may have figured it out. I added this:

Response.Write "                <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Topics Started: " & Topic_Author & "</small></font><br />" & vbNewLine

I think it is working properly.

Edit: Oops. Nevermind. All that does is show the members id number.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 17 March 2009 16:03:04
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 March 2009 :  16:06:24  Show Profile  Visit HuwR's Homepage  Reply with Quote
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
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 18 March 2009 :  05:44:37  Show Profile  Reply with Quote
You'll have to use two routines in "topic.asp", one for original posts and one for replies.


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.

Edited by - Carefree on 18 March 2009 05:49:54
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 18 March 2009 :  10:14:46  Show Profile  Reply with Quote
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.
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 19 March 2009 :  14:16:03  Show Profile  Reply with Quote
That could be because someone could of deleted a post or a few from the user(s).
quote:
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
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 19 March 2009 :  15:22:07  Show Profile  Reply with Quote
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.
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 19 March 2009 :  17:26:43  Show Profile  Reply with Quote
I will update the counts in the database (to remove deteled topics/posts) and apply the changes again and see what happens.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07