![]() |
Thread count
Hello
I need mod that show in the profil hiw mach Thread (not post) the user have can someone help? |
SELECT COUNT(*) FROM thread WHERE postuserid=$userinfo[user]
That's it - basically. Just wrap it in a few Bits of PHP to format it nicely, put the Variable in Template MEMBERINFO and you're done. Note: This does not care for deleted or moderated Threads. If you don't want to count them a few more conditions are required for the query. |
I came looking for something like this.
But I think I'm in over my head. I want to display a particular thread count on the forum index - forumhome I guess it's called. I'm new to php. I can follow someone's code and figure out what it does and modify it to suit my needs, but I can't really start my own. Could I impose on you or someone else to supply an example? Much appreciated. |
Quote:
|
Sorry, I guess I was vague because I understand how the query should look from your earlier post.
The part I'm having trouble with is the code to make it all show up on a page.. Anyway, what I would like to be able to do is have something that says, "There are ## open posts in the XYZ forum." And have that placed somewhere just under the navbar... but once I see the code, I'll know how to move it where I need it - or at least I'll figure it out - eventually... :) I went and looked through code to see how things are "printed to the screen" but got lost... is it the show command? Time for some php lessons I guess... Thanks again for any help. oh, and the query I'm thinking I will need is: SELECT COUNT(*) FROM thread WHERE forumid=## AND open=1 Where ## is the forum id number of interest. Is that close? |
In php (put it in a plugin):
PHP Code:
HTML Code:
$mydata[mycount] |
Thanks, this helps a lot.
I'm pretty good at figuring out the behind the scenes system stuff, but as soon as I have to format something for output... I get lost. |
All times are GMT. The time now is 12:58 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:
|