![]() |
Posts Per Month
I'm looking for a plugin that will give the post count for the last 30 days... I found a couple for 3.x, but they don't work. Has anyone done one for 4.x -or- can anyone modify this one to work?
Code:
$jointime = (TIMENOW - $vbulletin->userinfo['joindate']) / 2419200; //its for a month if you can change to 604800 seconds for 1 week, 84600 for 1 day. |
What you posted is 'average posts per month' not posts count for the past 30 days.
Hook: member_execute_start PHP Code:
PHP Code:
|
Was looking for something similar and thanks Eosian for trying to help.
I tried out you second suggestion "the fancier" once but got an error. Database error in vBulletin 4.2.0: Code:
Invalid SQL: |
$userinfo['userid'] isn't populating from where you're calling it.
What hook did you set it on? |
Quote:
I did put the query in a module php file for vBadvanced (already have a stats.php module file) and just rendered the variables and used them in a template. Guess being a novice that was the wrong way to do it or at least the query was not intended to be used in a php file. |
In order to port the code somewhere else you have to supply it a way of identifying the user you want information about. The $userinfo['userid'] needs to be replaced with whatever local variable has the user id of the person your module is referring to.
If it's a page you can only see about yourself it's easy; $vbulletin->userinfo['userid'] is generally globally available as a reference to 'me'. But for any page about someone else you should have some identifier for that person you can use. (Unrelated to fixing your issue, but none of what I posted was a template hook, that was a standard plugin that registers additional variables to an existing template before it renders by adding additional code to a specific event hook. A template hook is a somewhat different beast) You could actually use it in your postbit legacy just by changing the hook used. ( showthread_postbit_create and $post['userid'] and register postbit_legacy as the modified template ): PHP Code:
|
All times are GMT. The time now is 12:12 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|