Changeset 661

Show
Ignore:
Timestamp:
02/03/07 23:20:26 (2 years ago)
Author:
mdawaffe
Message:

deprecate get_inception(). bb_get_inception(), bb_inception(). fixes #521

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bb-admin/index.php

    r659 r661  
    2929 <li><?php _e('Topics per day'); ?>: <?php topics_per_day(); ?></li> 
    3030 <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> 
    3232</ul> 
    3333</div> 
  • trunk/bb-includes/deprecated.php

    r659 r661  
    9696} 
    9797 
     98function get_inception() { 
     99        return bb_get_inception( 'timestamp' ); 
     100} 
     101 
    98102?> 
  • trunk/bb-includes/statistics-functions.php

    r659 r661  
    4949} 
    5050 
    51 function get_inception() { 
     51function 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 
     57function bb_get_inception( $args = '' ) { 
     58        $args = _bb_parse_time_function_args( $args ); 
     59 
    5260        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 ) ); 
    5865} 
    5966function 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; 
    6168} 
    6269 
     
    6673 
    6774function 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; 
    6976} 
    7077 
     
    7481 
    7582function 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; 
    7784} 
    7885