Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2002, 11:00 PM
Mr_P Mr_P is offline
 
Join Date: Jan 2002
Location: Uk.
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 11-05-2002, 11:38 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[sql]
SELECT COUNT(*) FROM post WHERE userid=$userid AND threadid=$threadid
[/sql]
Reply With Quote
  #3  
Old 11-06-2002, 12:16 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Be aware that is one query per post per thread. That can add up.
Reply With Quote
  #4  
Old 11-06-2002, 12:19 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know why you'd want it in the first place, there's the Who Posted? popup...
Reply With Quote
  #5  
Old 11-06-2002, 05:32 PM
Mr_P Mr_P is offline
 
Join Date: Jan 2002
Location: Uk.
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 11-06-2002, 08:40 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #7  
Old 11-06-2002, 08:49 PM
Mr_P Mr_P is offline
 
Join Date: Jan 2002
Location: Uk.
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

stunning m8, thanks m8

I'll give it a whirl and let you know how i get on.

Once again thanks
Reply With Quote
  #8  
Old 11-07-2002, 09:17 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician to the rescue once again...
Reply With Quote
  #9  
Old 11-07-2002, 07:22 PM
Mr_P Mr_P is offline
 
Join Date: Jan 2002
Location: Uk.
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #10  
Old 11-07-2002, 10:36 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Mr_P
[[($post[howmanypost]>10])]]
Major Thread Contributor
[[/($post[howmanypost]>10])]]

Would this be correct ?
Provided that you apply the hacks (both this one and advanced templates) first and insert this to postbit template, yep that's correct!

If you want to apply the modification in the hack code (so as not to need advanced templates hack), find:

PHP Code:
$post[howmanypost]=(int)$howmany_userposts[$mypost_userid]; 
After it Add this:

PHP Code:
if ($post[howmanypost]>10) {$post[howmanypost]="Major Thread Contributor";
else {
$post[howmanypost]='';} 
it will give the same result with the conditional you referred..
Reply With Quote
Reply


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 08:09 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.04219 seconds
  • Memory Usage 2,269KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete