Feature #731
Updated Stats
| Status: | Closed | Start: | 08/03/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | default extensions | |||
| Target version: | 2.3 | |||
Description
Aded stats for comments, link for search comments and favorite stats. (changed some previous functions)
Favorite stats should be moved to ext\favorite\theme.php
In ext\user\theme.php line 136
protected function build_stats(User $duser) {
global $database;
global $config;
$h_join_date = html_escape($duser->join_date);
$i_image_count = Image::count_images(array("user_id={$duser->id}"));
$i_favorites_count = Image::count_images(array("favorited_by={$duser->name}"));
$i_comment_count = Comment::count_comments_by_user($duser);
$i_days_old = ((time() - strtotime($duser->join_date)) / 86400) + 1;
$h_image_rate = sprintf("%.1f", ($i_image_count / $i_days_old));
$h_favorites_rate = sprintf("%.1f", ($i_favorites_count / $i_days_old));
$h_comment_rate = sprintf("%.1f", ($i_comment_count / $i_days_old));
$images_link = make_link("post/list/poster=$duser->name/1");
$favorites_link = make_link("post/list/favorited_by=$duser->name/1");
$comments_link = make_link("post/list/commented_by=$duser->name/1");
return "
Join date: $h_join_date
<br><a href='$images_link'>Images uploaded</a>: $i_image_count, $h_image_rate per day
<br><a href='$favorites_link'>Images favorited</a>: $i_favorites_count, $h_favorites_rate per day
<br><a href='$comments_link'>Comments made</a>: $i_comment_count, $h_comment_rate per day
";
}
Duplicate entry on http://redmine.shishnet.org/issues/show/729 delete 729