vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Post count hack? (https://vborg.vbsupport.ru/showthread.php?t=76925)

ludachris 02-23-2005 08:22 PM

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?!?!?!?!?!

DRJ 02-23-2005 09:00 PM

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


ludachris 02-23-2005 09:35 PM

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?

DRJ 02-23-2005 11:42 PM

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.

Marco van Herwaarden 02-24-2005 06:15 AM

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.

DRJ 02-24-2005 06:38 AM

He said he wanted to keep the overall post count and also add a secondary count for each user shown on the posts.

ludachris 02-24-2005 05:18 PM

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?

Marco van Herwaarden 02-25-2005 06:32 AM

Sorry overlooked the part where you said you also wanted to keep the full postcount.

ludachris 02-25-2005 06:17 PM

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?

ludachris 03-08-2005 10:28 PM

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.

AtoZ 11-02-2005 04:34 AM

Sorry to reply to an old thread, but I am looking for exactly the same thing and this is the first thread I've found that addresses it directly.

ludachris, did you get this working? Does anyone else have ideas on what to do?

I am planning to upgrade to 3.5 soon, so perhaps it will be easier to work through in 3.5?

Update: I think I may have found it here:
https://vborg.vbsupport.ru/showthread.php?t=68041
It's still classified as "beta" though...

Anyone know of a 3.5 hack like this?

ludachris 11-04-2005 02:44 PM

Quote:

Originally Posted by AtoZ
Sorry to reply to an old thread, but I am looking for exactly the same thing and this is the first thread I've found that addresses it directly.

ludachris, did you get this working? Does anyone else have ideas on what to do?

I am planning to upgrade to 3.5 soon, so perhaps it will be easier to work through in 3.5?

Update: I think I may have found it here:
https://vborg.vbsupport.ru/showthread.php?t=68041
It's still classified as "beta" though...

Anyone know of a 3.5 hack like this?

I haven't gotten it to work. Might have to post in the 3.5 section since nobody seems to see this thread.


All times are GMT. The time now is 04:48 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.01102 seconds
  • Memory Usage 1,750KB
  • 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
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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