From 3d763d38e8b76caa22b477cfcdf1a6096f3c95c3 Mon Sep 17 00:00:00 2001 From: Kenzaburo Ito Date: Wed, 6 Dec 2000 23:51:55 +0000 Subject: [PATCH] tidied up date git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@34 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- core_API.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/core_API.php b/core_API.php index bbc749fd1d..287517bfdd 100644 --- a/core_API.php +++ b/core_API.php @@ -198,7 +198,7 @@ function print_bug_date_summary( $p_date_array ) { $arr_count = count( $p_date_array ); for ($i=0;$i<$arr_count;$i++) { - $t_enum_count = get_bug_count_by_date2( $p_date_array[$i] ); + $t_enum_count = get_bug_count_by_date( $p_date_array[$i] ); ### alternate row colors if ( $i % 2 == 1) { @@ -378,19 +378,9 @@ function sql_to_unix_time( $p_timeString ) { substr( $p_timeString, 0, 4 ) ); } #-------------------- - function get_bug_count_by_date( $p_num_days=1 ) { - global $g_mantis_bug_table; - - #$day = strtotime( "-1 month" ); - $day = time() - 86400*$p_num_days; - $query = "SELECT COUNT(id) - FROM $g_mantis_bug_table - WHERE UNIX_TIMESTAMP(last_updated)>$day"; - $result = mysql_query( $query ); - return mysql_result( $result, 0 ); - } - #-------------------- - function get_bug_count_by_date2( $p_time_length="day" ) { + # expects the paramter to be neutral in time length + # automatically adds the - + function get_bug_count_by_date( $p_time_length="day" ) { global $g_mantis_bug_table; $day = strtotime( "-".$p_time_length );