Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2005, 08:22 PM
ludachris ludachris is offline
 
Join Date: Feb 2002
Posts: 287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Post count hack?

So, in the postbit template, we have the post count # displayed for each member (at least some of us do). I was wondering if there was a way to build a post count for a member for only specified forums...

Post Count (for forumID[10] AND forumID(12): 25

So if a user has a total of 25 posts in ForumID(10) and ForumID(12) combined, then their post count would show up as 25. The reason I'd want this is because these are my important forums, and I want people to see how much these users contribute in those forums as opposed to knowing their overall post count. Is this possible? And how much load would it put on the server since it would be displayed in postbit?


Edit:
Actually, just found basically what I'm looking for already done for vB2... anyone seen it for vB3 yet:
https://vborg.vbsupport.ru/showthread.php?t=48977
If not, can someone PLEASE rewrite it for vB3?!?!?!?!?!
Reply With Quote
  #2  
Old 02-23-2005, 09:00 PM
DRJ DRJ is offline
 
Join Date: Jan 2005
Location: California USA
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What I do is only count posts for certain forums.

Otherwise, somthing like this should work.

PHP Code:
$postcount $DB_site->query("SELECT count( * ); 
FROM vb3_post As p, vb3_thread As t 
WHERE p.threadid = t.threadid
AND t.forumid = XX
AND p.userid = YY
"
); 
Reply With Quote
  #3  
Old 02-23-2005, 09:35 PM
ludachris ludachris is offline
 
Join Date: Feb 2002
Posts: 287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DRJ
What I do is only count posts for certain forums.

Otherwise, somthing like this should work.

PHP Code:
$postcount $DB_site->query("SELECT count( * ); 
FROM vb3_post As p, vb3_thread As t 
WHERE p.threadid = t.threadid
AND t.forumid = XX
AND p.userid = YY
"
); 
What file would I find that in? I think I'd want to keep the overall post count and have a secondary post count. I'm assuming this would be the only post counter?
Reply With Quote
  #4  
Old 02-23-2005, 11:42 PM
DRJ DRJ is offline
 
Join Date: Jan 2005
Location: California USA
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a mistake, remove the ; from the first line.

You could add this code to your showthread.php
PHP Code:
$postcount$DB_site->query("SELECT count( * )
FROM vb3_post As p, vb3_thread As t
WHERE p.threadid = t.threadid
AND t.forumid In(16,17,18)
AND p.userid = 
$post[userid] 
Then add $postcount to your postbit_legacy template whereever you want the number to appear.

I this example we are counting posts in forum 16, 17, 18.

Note that this would run a query for each post in the thread everytime anyone viewed any thread.
Reply With Quote
  #5  
Old 02-24-2005, 06:15 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry guys, but no hack is needed for this in vB3.

Edit your Forum settings, you will find a setting called something like "Posts in this forum add to postcount". Set this to No for all forums, except the ones mentioned above.
Reply With Quote
  #6  
Old 02-24-2005, 06:38 AM
DRJ DRJ is offline
 
Join Date: Jan 2005
Location: California USA
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

He said he wanted to keep the overall post count and also add a secondary count for each user shown on the posts.
Reply With Quote
  #7  
Old 02-24-2005, 05:18 PM
ludachris ludachris is offline
 
Join Date: Feb 2002
Posts: 287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Sorry guys, but no hack is needed for this in vB3.

Edit your Forum settings, you will find a setting called something like "Posts in this forum add to postcount". Set this to No for all forums, except the ones mentioned above.
I'd like to keep an overall count plus a secondary count.

And I'm assuming that if I were to change it via the control panel, only counting posts from a few of my forums instead of most all, then recalculate post counts, that any Ranks I have set up would be based on the new smaller post count and not the true (much larger) overall post count?

If this is the case, I really don't want to do it via the forum settings. I'd like to see about doing it like the hack that I linked to above - adding a secondary post (special) counter. Can anyone port that hack to vB3?
Reply With Quote
  #8  
Old 02-25-2005, 06:32 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry overlooked the part where you said you also wanted to keep the full postcount.
Reply With Quote
  #9  
Old 02-25-2005, 06:17 PM
ludachris ludachris is offline
 
Join Date: Feb 2002
Posts: 287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Sorry overlooked the part where you said you also wanted to keep the full postcount.
So I think I figured out how to do it... I duplicated the 'posts' field in table 'user' and named it 'posts_new'. Then, in "functions_newpost.php" I added code that should update the user's post count AND their post_new count at the same time. So now, going forward, I believe it will count all new posts (only for the specificed forums) in the new field.

However, how would I write a script that updates that count for all posts in those forums prior?
Reply With Quote
  #10  
Old 03-08-2005, 10:28 PM
ludachris ludachris is offline
 
Join Date: Feb 2002
Posts: 287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's too bad that people don't get the same amount of help here in the "free" forum now that there's a "payed service request" forum. This place used to be full of helpful people who didn't mind lending a hand with questions like this. Looks like there isn't much help available at all unless you want to pay to have your question answered... or maybe there just aren't as many people on here who know what they're doing with VB3. I guess people are still figuring out VB3.
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 08:02 PM.


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