vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Users Average Thread Per Day? (https://vborg.vbsupport.ru/showthread.php?t=226968)

princeedward 10-28-2009 06:31 PM

Users Average Thread Per Day?
 
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

Code:

* 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

Code:

// 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

Quote:

Originally Posted by Lynne (Post 1907545)
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.


All times are GMT. The time now is 08:30 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.01214 seconds
  • Memory Usage 1,728KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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