|
|
|
Zayexi Hayati
Noobie

Posts: 25

Making this forum better one post at a time.
|
 |
Re:Member Post Count per Thread
« Reply #3 on: March 01, 2003, 06:00:31 AM » |
|
Here is an example of the board that I saw this at. Click hereIf 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.
|
 |
Re:Member Post Count per Thread
« Reply #5 on: March 21, 2003, 12:24:24 AM » |
|
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 1 | 5 | User 2 | 4 | User 3 | 3 | User 4 | 3 | User 5 | 1 |
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.
|
 |
Re:Member Post Count per Thread
« Reply #11 on: March 21, 2003, 01:00:45 AM » |
|
Okay you lost me  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.
|
 |
Re:Member Post Count per Thread
« Reply #12 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.
|
|
|
Logged
|
The important thing is not to stop questioning.
|
|
|
[Unknown]
Global Moderator
YaBB God
    
Posts: 7830


|
 |
Re:Member Post Count per Thread
« Reply #13 on: March 21, 2003, 01:13:34 AM » |
|
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
|
|
|
|
|