public function onUserPageBuilding(Event $event) { global $page, $user, $config; $h_join_date = autodate($event->display_user->join_date); $event->add_stats("Joined: {$h_join_date}", 10); $av = $event->display_user->get_avatar_html(); if ($av) { $event->add_stats($av, 0); } ksort($event->stats); $this->theme->display_user_page($event->display_user, $event->stats); if ($user->id == $event->display_user->id) { $ubbe = new UserBlockBuildingEvent(); send_event($ubbe); ksort($ubbe->parts); $this->theme->display_user_links($page, $user, $ubbe->parts); } if (($user->is_admin() || $user->id == $event->display_user->id) && $user->id != $config->get_int('anon_id')) { $this->theme->display_ip_list($page, $this->count_upload_ips($event->display_user), $this->count_comment_ips($event->display_user)); } }
public function onUserPageBuilding(Event $event) { $i_days_old = (time() - strtotime($event->display_user->join_date)) / 86400 + 1; $i_comment_count = Comment::count_comments_by_user($event->display_user); $h_comment_rate = sprintf("%.1f", $i_comment_count / $i_days_old); $event->add_stats("Comments made: {$i_comment_count}, {$h_comment_rate} per day"); }