Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 09-11-2005, 11:59 AM
adielsh adielsh is offline
 
Join Date: Feb 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Thread count

Hello
I need mod that show in the profil hiw mach Thread (not post) the user have
can someone help?
Reply With Quote
  #2  
Old 09-16-2005, 05:10 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 09-16-2005, 08:29 PM
dodgechargerfan dodgechargerfan is offline
 
Join Date: Aug 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 09-17-2005, 04:51 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 09-17-2005, 06:14 PM
dodgechargerfan dodgechargerfan is offline
 
Join Date: Aug 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 09-17-2005, 06:23 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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*'
Reply With Quote
  #7  
Old 09-17-2005, 10:39 PM
dodgechargerfan dodgechargerfan is offline
 
Join Date: Aug 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03960 seconds
  • Memory Usage 2,215KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete