Feature #731

avatar

Updated Stats

Added by Sein Kraft 109 days ago. Updated 71 days ago.

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


Related issues

duplicated by Feature #729 Updated Stats Closed 08/02/2009

History

Updated by Shish Moom 94 days ago

avatar
  • Status changed from New to Closed

b1bcb82 has this effect, by replacing the hardcoded assumption of other extensions with another event calling for stats (ideally the user extension should be completely independent of the image board); 39bd7a7 updates the danbooru theme too

Also available in: Atom PDF