Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Thread... Post... and Reply Count... Details »»
Thread... Post... and Reply Count...
Version: 1.00, by g-force2k2 g-force2k2 is offline
Developer Last Online: May 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-19-2002 Last Update: Never Installs: 6
 
No support by the author.

It's really a quick hack but i thought i'd release it because maybe some members would find interest in it... requested by Barret... it requires only a file edit and template edit... yes a smaller hack i usually try to stay away from them because i like challenges...

open admin/functions.php

find:

PHP Code:
$post[joindate]=vbdate($registereddateformat,$post[joindate]); 
above it add:

PHP Code:
global $DB_site;
$threads $DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE postuserid='$post[userid]'");
    
$post[threads] = $threads['threads'];
    
$post[replies] = $post[posts] - $post[threads]; 
the open the postbit template and place $post[threads] and/or $post[replies] wherever you like... hopefully it'll be useful to some member...

Enjoy

g-force2k2

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 11-20-2002, 10:57 PM
Exo's Avatar
Exo Exo is offline
 
Join Date: Nov 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why use this Hack so much queries? The normal post counter does that not!
Reply With Quote
  #33  
Old 09-06-2003, 08:30 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
08-21-02 at 12:26 PM Xenon said this in Post #15
@g-force:
you should replace this:
PHP Code:
$threads $DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE postuserid='$post[userid]'");
    
$post[threads] = $threads['threads'];
    
$post[replies] = $post[posts] - $post[threads]; 
with something like this:
PHP Code:
if(!isset($threads[$post[userid]])) {
$threads[$post[userid]] = $DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE postuserid='$post[userid]'");
}
    
$post[threads] = $threads[$post[userid]]['threads'];
    
$post[replies] = $post[posts] - $post[threads]; 
this should reduce the querys if the same user has two or more posts in one thread on the displaying page
Could you revise your code to limit the amount of queries this hack produces?

Thanks in advance Xenon!
Reply With Quote
  #34  
Old 09-06-2003, 08:44 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well the code should work i'd say
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 12:35 AM.


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.04060 seconds
  • Memory Usage 2,259KB
  • Queries Executed 20 (?)
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
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete