![]() |
Posts Per Week Statistic
Hello,
It's me again - so I'm looking to either create a plugin, or use whatever variables that are already available to somehow come up with a way to figure out a users post per week statistic. I am not really sure how to go about this. Any tips to point me in the right direction would be great. |
If you are wanting to display this statistic on a user's profile page, then you could create a plugin as follows:
Product: vBulletin (or whatever product you wish this to be a part of) Hook Location: member_build_blocks_start Title: Compute Posts Per Week Execution Order: 5 Plugin PHP Code: PHP Code:
In the PHP Plugin Code, we are creating the number as part of the $prepared array since it is already registered there, and then using the number_format function to round it off to 2 decimal places to match the posts per day. Then, edit your "memberinfo_block_statistics" template by locating the code: HTML Code:
<dl class="blockrow stats"> HTML Code:
<dl class="blockrow stats"> |
Thanks again Mark. I actually have another question, but I will create another thread.
For this though - I actually wanted to calculate it on a weekly basis. I made a new column in my user table, and added a hook to newpost_complete which +1 to the count. I then added a cron job to reset the count to 0 each week (based off of there having been activity in the account in the last week to cut down on database writes) |
If you want a query that returns the number of posts made by a particular user during the last week, you could use:
PHP Code:
|
All times are GMT. The time now is 12:00 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|