vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Thread count (https://vborg.vbsupport.ru/showthread.php?t=96050)

adielsh 09-11-2005 10:59 AM

Thread count
 
Hello
I need mod that show in the profil hiw mach Thread (not post) the user have
can someone help?

Andreas 09-16-2005 04:10 AM

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.

dodgechargerfan 09-16-2005 07:29 PM

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.

Andreas 09-17-2005 03:51 AM

Quote:

I want to display a particular thread count on the forum index - forumhome I guess it's called.
What does that mean: The amount of Threads in a specific Forum, the amount of replies in an specific Thread, or smth. completely different?

dodgechargerfan 09-17-2005 05:14 PM

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?

Marco van Herwaarden 09-17-2005 05:23 PM

In php (put it in a plugin):

PHP Code:

$mydata $vbulletin->db->query_first("SELECT COUNT(*) AS mycount ........."); 

Then you can put in a template:
HTML Code:

$mydata[mycount]
PS Showing somehting in php is done with 'echo' or '*print*'

dodgechargerfan 09-17-2005 09:39 PM

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
  • Page Generation 0.01829 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete