Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2009, 06:31 PM
princeedward's Avatar
princeedward princeedward is offline
 
Join Date: Jan 2007
Location: Deutschland
Posts: 901
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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

Reply With Quote
  #2  
Old 10-28-2009, 06:53 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 10-28-2009, 07:31 PM
princeedward's Avatar
princeedward princeedward is offline
 
Join Date: Jan 2007
Location: Deutschland
Posts: 901
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

...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... how can i start to create that plugin...actually saw it somewhere or another vb board website that they have it too... 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
Reply With Quote
  #4  
Old 10-28-2009, 07:57 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 10-29-2009, 09:44 AM
princeedward's Avatar
princeedward princeedward is offline
 
Join Date: Jan 2007
Location: Deutschland
Posts: 901
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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

Reply With Quote
  #6  
Old 10-29-2009, 03:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:01 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.04322 seconds
  • Memory Usage 2,212KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete