Welcome, Guest. Please Login or Register.
May 10, 2025, 08:40:08 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Member Post Count per Thread « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Member Post Count per Thread  (Read 615 times)
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Member Post Count per Thread
« on: March 01, 2003, 04:32:52 AM »
Reply with quote

I saw this in a VBulletin board that I think would be a nice mod to have on my YabbSE board. Especially since we tend to have races to see who can post the most in one particular thread.

What I am looking for is a post count for each member in a specific thread. I know we can count them up manually and that is what we have been doing lately but it would be nice to have it done automatically.
Logged

The important thing is not to stop questioning.
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Member Post Count per Thread
« Reply #1 on: March 01, 2003, 04:51:59 AM »
Reply with quote

can you show me an examle of this?
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Member Post Count per Thread
« Reply #2 on: March 01, 2003, 05:07:22 AM »
Reply with quote

I think I know what he/you mean/s.  (although I would DESPISE these kinds of spam races on my board.)

Perhaps, somewhere under the avatar (next to posts...), the number of posts in THIS thread could be shown.

Personally, I would rather expand my "Posts per day" mod to cover Display.php (possibly InstantMessage.php) as well.... but, if you like spam wars this mod would be for you.

-[Unknown]
Logged
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #3 on: March 01, 2003, 06:00:31 AM »
Reply with quote

Here is an example of the board that I saw this at.
Click here
If you take a look at the number of replies this is a link to a total count of the posts ranked by members that have posted in each thread.
Logged

The important thing is not to stop questioning.
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #4 on: March 01, 2003, 06:02:20 AM »
Reply with quote

Quote from: [Unknown] on March 01, 2003, 05:07:22 AM
I think I know what he/you mean/s.  (although I would DESPISE these kinds of spam races on my board.)

Perhaps, somewhere under the avatar (next to posts...), the number of posts in THIS thread could be shown.

Personally, I would rather expand my "Posts per day" mod to cover Display.php (possibly InstantMessage.php) as well.... but, if you like spam wars this mod would be for you.

-[Unknown]
Well it is not something that we encourage on a constant basis. But we usually have one Thread where we do race to a certain number of posts. We do have some rules in place where one person can not just go crazy and post more than three times in a row. I will look into your mod though.
Logged

The important thing is not to stop questioning.
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #5 on: March 21, 2003, 12:24:24 AM »
Reply with quote

okay I have been thinking about this and I think I have come up with a solution. But I need some help.
Now the way I want this to work is that when you click on the number of posts a thread has it will popup a new window with a table of posters and the amount of posts that they have in this particular thread. Like so.

Member#
User 15
User 24
User 33
User 43
User 51
I have looked at the yabbse_messages table and I do not see the need to add any extra fields or another table.
But now I am having problem getting the correct query for this purpose. I started with this one
SELECT `posterName` FROM `tsb_messages` WHERE `ID_TOPIC` = 1 GROUP BY `posterName` DESC
But that only gives me a one column table with the posters and no totals. Like this

posterName
zayexi
YaBB SE Dev Team
skuzzel
Rufus Bzb Jones
poruvi
Nikita
mrmeaner
Hug-In
Alia McCarros
Then I modify the query to add a SUM for the total column. Like this.
SELECT `posterName` FROM `tsb_messages` WHERE `ID_TOPIC` = 1, SUM(IF(ID_TOPIC='1',1)) AS total GROUP BY `posterName` DESC
But that gives me a syntax error. I tried COUNT and I tried it with and without commas(,) with and without quotes (',") both single and double.
If someone can help me with this query I think I can do the rest.
Thanks in advance.
Logged

The important thing is not to stop questioning.
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #6 on: March 21, 2003, 12:38:28 AM »
Reply with quote

SELECT `posterName` FROM `tsb_messages` WHERE `ID_TOPIC` = 1, COUNT(*) AS total GROUP BY `posterName` DESC

Tried COUNT(*) instead and still no luck.
Replaced (*) with posterName and still no luck.
Logged

The important thing is not to stop questioning.
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Member Post Count per Thread
« Reply #7 on: March 21, 2003, 12:43:07 AM »
Reply with quote

SELECT COUNT(ID_MSG)
FROM {$db_prefix}messages
WHERE ID_MEMBER=$posterID
  AND ID_TOPIC=$threadid;

[edit: d'oh... forgot the from.]

-[Unknown]
« Last Edit: March 21, 2003, 12:44:49 AM by [Unknown] » Logged
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #8 on: March 21, 2003, 12:49:29 AM »
Reply with quote

but wont that only give me the total posts for one member?
Would a seperate query have to be done for each member?
Logged

The important thing is not to stop questioning.
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #9 on: March 21, 2003, 12:53:36 AM »
Reply with quote

tweak your suggestion a bit and I almost got it working.
SELECT ID_MEMBER, COUNT(ID_MSG)
FROM tsb_messages
WHERE ID_TOPIC=6 GROUP by ID_MEMBER
Logged

The important thing is not to stop questioning.
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Member Post Count per Thread
« Reply #10 on: March 21, 2003, 12:54:11 AM »
Reply with quote

"SELECT COUNT(ID_MSG), ID_MEMBER
FROM {$db_prefix}messages
WHERE ID_MEMBER IN (" . implode(',', $ID_MEMBERsWhoPosted) . ")
  AND ID_TOPIC=$threadid
GROUP BY ID_MEMBER
LIMIT " . count($ID_MEMBERsWhoPosted)

That would be the fastest way... I think that should work. (untested!)

Of course, that would be much easier to do in my secret project, because it's already set up to be faster...

-[Unknown]
Logged
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #11 on: March 21, 2003, 01:00:45 AM »
Reply with quote

Okay you lost me  ;D
I got this to work.

SELECT posterName, COUNT(ID_MSG)
FROM tsb_messages
WHERE ID_TOPIC=1 GROUP by posterName ORDER BY `COUNT(ID_MSG)` DESC


And the reason that I changed the order of the posterName and the COUNT is because that is how I want my table to appear.
Logged

The important thing is not to stop questioning.
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #12 on: March 21, 2003, 01:06:26 AM »
Reply with quote

And whats this secret project that you keep talking about... I am starting to get mighty curious  ???

Now, if I was to try out your solution I would like to know the answer to this questions:

Wheres does $ID_MEMBERsWhoPosted get defined?
This is a complete function correct?
If so, then that means that I should include it in my Subs.php file, or am I mistaken?
Last, Where do I call this function from MessageIndex.php?

Thanks for all the help.
Logged

The important thing is not to stop questioning.
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Member Post Count per Thread
« Reply #13 on: March 21, 2003, 01:13:34 AM »
Reply with quote

Quote from: Zayexi Hayati on March 21, 2003, 01:06:26 AM
And whats this secret project that you keep talking about... I am starting to get mighty curious  ???

Now, if I was to try out your solution I would like to know the answer to this questions:

Wheres does $ID_MEMBERsWhoPosted get defined?
This is a complete function correct?
If so, then that means that I should include it in my Subs.php file, or am I mistaken?
Last, Where do I call this function from MessageIndex.php?

Thanks for all the help.

In my secret project, it collects and loads the member data in one swoop.  This can be MUCH FASTER when many people have replied to a single thread.

I named it that so you could tell what I meant by it... in mine, it's $posters (an array).

What are you talking about - functions?  My secret project is a rewrite of YaBB SE 1.5.1 with a load of extra features and speed ups.

-[Unknown]
Logged
Zayexi Hayati
Noobie
*
Posts: 25


Making this forum better one post at a time.

WWW
Re:Member Post Count per Thread
« Reply #14 on: March 21, 2003, 01:21:54 AM »
Reply with quote

Hmm okay... As for functions. Well I wanted to see if I could release this as a mod since I recieved two emails from other members that thought this would be a cool feature but I have no idea as to how to make a mod. Or what needs editing where. I am still learning.
But thanks for your help anyways. If nothing else I can always execute this query from phpMyAdmin whenever we need a total.

Thanks again.
Logged

The important thing is not to stop questioning.
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Member Post Count per Thread « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.058 seconds with 21 queries.