![]() |
total member replies in one thread
I'm unsure if this is a hack request , or simply a php issue
I need a query that will assign a variable to the total number of replies a member has made in that thread. I want to put a entry in the postbit so that you can see how many replies the member has posted in that thread. Not a rolling total, just the total, so if he posted 4 replies to that thread, you will see "4 replies" in the postbit on everyone post he makes in that thread. Is this possible with a query ? Thanks for all assistance given ;) |
[sql]
SELECT COUNT(*) FROM post WHERE userid=$userid AND threadid=$threadid [/sql] |
Be aware that is one query per post per thread. That can add up.
|
I don't know why you'd want it in the first place, there's the Who Posted? popup...
|
Thank-you for your comments and help. but
ok, where do I put this ?? Would it make any difference if I were to say I only really need this variable assigning if the member has more than X ammount of replies ( replies not starting post ) in that thread. I want to be able to look at a thread and see who are the main contributors to that thread. I could use logican's template hack so that the postbit changes dependant on how many replies they have. So I could say hard code a value of say 10 I would then be able to easily see which members had 10 replies to that thread and it would be obvious to the main contributers. Hope this makes sense |
1 Attachment(s)
Here you go..
And it's optimized so that it wont add a SQL query per post. It just adds 1 query for thread in thread view (which is inevitable).. Enjoy.. |
stunning m8, thanks m8
I'll give it a whirl and let you know how i get on. Once again thanks |
Logician to the rescue once again... ;)
|
He sure was
Its works a treat, and yes only one more query I do have one further query though, Can this now be used with your dynamic templates hack ? [[($post[howmanypost]>10])]] Major Thread Contributor [[/($post[howmanypost]>10])]] Would this be correct ? |
Quote:
If you want to apply the modification in the hack code (so as not to need advanced templates hack), find: PHP Code:
PHP Code:
|
All times are GMT. The time now is 05:23 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|