Changeset 661
- Timestamp:
- 02/03/07 23:20:26 (2 years ago)
- Files:
-
- trunk/bb-admin/index.php (modified) (1 diff)
- trunk/bb-includes/deprecated.php (modified) (1 diff)
- trunk/bb-includes/statistics-functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bb-admin/index.php
r659 r661 29 29 <li><?php _e('Topics per day'); ?>: <?php topics_per_day(); ?></li> 30 30 <li><?php _e('Registrations per day'); ?>: <?php registrations_per_day(); ?></li> 31 <li><?php printf(__('Forums started %s ago.'), bb_ since(get_inception())); ?></li>31 <li><?php printf(__('Forums started %s ago.'), bb_get_inception()); ?></li> 32 32 </ul> 33 33 </div> trunk/bb-includes/deprecated.php
r659 r661 96 96 } 97 97 98 function get_inception() { 99 return bb_get_inception( 'timestamp' ); 100 } 101 98 102 ?> trunk/bb-includes/statistics-functions.php
r659 r661 49 49 } 50 50 51 function get_inception() { 51 function bb_inception( $args = '' ) { 52 $args = _bb_parse_time_function_args( $args ); 53 $time = apply_filters( 'bb_inception', bb_get_inception( array('format' => 'mysql') + $args), $args ); 54 echo _bb_time_function_return( $time, $args ); 55 } 56 57 function bb_get_inception( $args = '' ) { 58 $args = _bb_parse_time_function_args( $args ); 59 52 60 global $bbdb, $bb_inception; 53 if ( isset($bb_inception) ) 54 return $bb_inception; 55 $bb_inception = $bbdb->get_var("SELECT topic_start_time FROM $bbdb->topics ORDER BY topic_start_time LIMIT 1"); 56 $bb_inception = bb_gmtstrtotime( $bb_inception ); 57 return $bb_inception; 61 if ( !isset($bb_inception) ) 62 $bb_inception = $bbdb->get_var("SELECT topic_start_time FROM $bbdb->topics ORDER BY topic_start_time LIMIT 1"); 63 64 return apply_filters( 'bb_get_inception', _bb_time_function_return( $bb_inception, $args ) ); 58 65 } 59 66 function get_registrations_per_day() { 60 return get_total_users() / ( time() - get_inception() ) * 3600 * 24;67 return get_total_users() / ( time() - bb_get_inception( 'timestamp' ) ) * 3600 * 24; 61 68 } 62 69 … … 66 73 67 74 function get_posts_per_day() { 68 return get_total_posts() / ( time() - get_inception() ) * 3600 * 24;75 return get_total_posts() / ( time() - bb_get_inception( 'timestamp' ) ) * 3600 * 24; 69 76 } 70 77 … … 74 81 75 82 function get_topics_per_day() { 76 return get_total_topics() / ( time() - get_inception() ) * 3600 * 24;83 return get_total_topics() / ( time() - bb_get_inception( 'timestamp' ) ) * 3600 * 24; 77 84 } 78 85