From 4a4546c42756ef84b5fe8fc3d7fec783714d39c3 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 30 Jul 2009 03:47:43 +0100 Subject: [PATCH] bring back X blah per day --- ext/user/theme.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/user/theme.php b/ext/user/theme.php index d73f3420..bf36f395 100644 --- a/ext/user/theme.php +++ b/ext/user/theme.php @@ -141,16 +141,17 @@ class UserPageTheme extends Themelet { $i_image_count = Image::count_images(array("user_id={$duser->id}")); $i_comment_count = Comment::count_comments_by_user($duser); - #$h_image_rate = sprintf("%3.1f", ($i_image_count / $i_days_old2)); - #$h_comment_rate = sprintf("%3.1f", ($i_comment_count / $i_days_old2)); + $i_days_old = ((time() - strtotime($duser->join_date)) / 86400) + 1; + $h_image_rate = sprintf("%.1f", ($i_image_count / $i_days_old)); + $h_comment_rate = sprintf("%.1f", ($i_comment_count / $i_days_old)); $u_id = url_escape($duser->id); $images_link = make_link("post/list/user_id=$u_id/1"); return " Join date: $h_join_date -
Images uploaded: $i_image_count -
Comments made: $i_comment_count +
Images uploaded: $i_image_count, $h_image_rate per day +
Comments made: $i_comment_count, $h_comment_rate per day "; }