View Full Version : Users Average Thread Per Day?
princeedward
10-28-2009, 06:31 PM
Sample:
Total Threads: 1,500 (1.57 Threads Per Day)
hi guys.... need help here please...is it posssible to have or show this besides users total thread? like we use to have on the side of our users total post average post per day....that can show to profile page or postbit legacy
is there any particular variables or any mod, addons any plugins i might need to make it happen?
please appreciate any help or guide on this...tried already to search but no luck
:mad:
Lynne
10-28-2009, 06:53 PM
Find the template (memberinfo_block_statistics), look in the template to find the variable used ($prepared[postsperday]), search in your files to find where 'postsperday' is defined (class_postbit.php and class_userprofile.php) and copy the code to a plugin or whatever you are using that info.
princeedward
10-28-2009, 07:31 PM
...using vb3.8.4 here..
thanks a bunch Lynne..as always good to have you here at all times....well actually got no idea about much on this if you can guide assist me more pleaseif its not that much for your time at all... took this code from my both files ...hope its the right one....but no idea now what's the next step...:p how can i start to create that plugin...actually saw it somewhere or another vb board website that they have it too...:confused: but forgot it already where...
class_userprofile.php
* Prepares the User's Posts Per Day
*
*/
function prepare_postsperday()
{
$jointime = (TIMENOW - $this->userinfo['joindate']) / 86400; // Days Joined
if ($jointime < 1)
{
// User has been a member for less than one day.
$postsperday = vb_number_format($this->userinfo['posts']);
}
else
{
$postsperday = vb_number_format($this->userinfo['posts'] / $jointime, 2);
}
$this->prepared['postsperday'] = $postsperday;
}
/**
class_postbit.php
// get join date & posts per day
$jointime = (TIMENOW - $this->post['joindate']) / 86400; // Days Joined
if ($jointime < 1)
{
// User has been a member for less than one day.
$this->post['postsperday'] = $this->post['posts'];
}
else
{
$this->post['postsperday'] = vb_number_format($this->post['posts'] / $jointime, 2);
}
$this->post['joindate'] = vbdate($this->registry->options['registereddateformat'], $this->post['joindate']);
// format posts number
Lynne
10-28-2009, 07:57 PM
Before you do anything, you need to decide where you are going to use it (what page? what template?), then look in the code and find which hook location is best for you, find that hook location in the code and see what variable names are available for you to use, and then think about taking that code and writing it for use. Until you decide where you are going to use it and what hook is best, you really can't do much else.
princeedward
10-29-2009, 09:44 AM
Before you do anything, you need to decide where you are going to use it (what page? what template?), then look in the code and find which hook location is best for you, find that hook location in the code and see what variable names are available for you to use, and then think about taking that code and writing it for use. Until you decide where you are going to use it and what hook is best, you really can't do much else.thanks again Lynne...well want to use it actually to memberinfo_block_statistics and posbit_legacy
but really can't figure it out how am i gonna do this
:o
Lynne
10-29-2009, 03:58 PM
Those are just templates. Now you need to find where those templates are evaled in the code and pick a hook location prior to them being evaled. If you have your test site in debug mode, then just look at the bottom of the page and see all the hook locations and go into the code and see where they are and if they are a good one for you.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.