vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   total member replies in one thread (https://vborg.vbsupport.ru/showthread.php?t=45436)

Mr_P 11-05-2002 11:00 PM

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 ;)

filburt1 11-05-2002 11:38 PM

[sql]
SELECT COUNT(*) FROM post WHERE userid=$userid AND threadid=$threadid
[/sql]

Erwin 11-06-2002 12:16 AM

Be aware that is one query per post per thread. That can add up.

filburt1 11-06-2002 12:19 AM

I don't know why you'd want it in the first place, there's the Who Posted? popup...

Mr_P 11-06-2002 05:32 PM

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

Logician 11-06-2002 08:40 PM

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..

Mr_P 11-06-2002 08:49 PM

stunning m8, thanks m8

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

Once again thanks

Erwin 11-07-2002 09:17 AM

Logician to the rescue once again... ;)

Mr_P 11-07-2002 07:22 PM

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 ?

Logician 11-07-2002 10:36 PM

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..


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
  • Page Generation 0.01031 seconds
  • Memory Usage 1,731KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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