public function onUserPageBuilding(UserPageBuildingEvent $event) { global $page, $user, $database; $threads_count = $database->get_one("SELECT COUNT(*) FROM forum_threads WHERE user_id=?", array($event->display_user->id)); $posts_count = $database->get_one("SELECT COUNT(*) FROM forum_posts WHERE user_id=?", array($event->display_user->id)); $days_old = (time() - strtotime($event->display_user->join_date)) / 86400 + 1; $threads_rate = sprintf("%.1f", $threads_count / $days_old); $posts_rate = sprintf("%.1f", $posts_count / $days_old); $event->add_stats("Forum threads: {$threads_count}, {$threads_rate} per day"); $event->add_stats("Forum posts: {$posts_count}, {$posts_rate} per day"); }
/** * @param UserPageBuildingEvent $event */ public function onUserPageBuilding(UserPageBuildingEvent $event) { global $user, $config; $h_join_date = autodate($event->display_user->join_date); if ($event->display_user->can("hellbanned")) { $h_class = $event->display_user->class->parent->name; } else { $h_class = $event->display_user->class->name; } $event->add_stats("Joined: {$h_join_date}", 10); $event->add_stats("Class: {$h_class}", 90); $av = $event->display_user->get_avatar_html(); if ($av) { $event->add_stats($av, 0); } else { if ($config->get_string("avatar_host") == "gravatar" && $user->id == $event->display_user->id) { $event->add_stats("No avatar? This gallery uses <a href='http://gravatar.com'>Gravatar</a> for avatar hosting, use the" . "<br>same email address here and there to have your avatar synced<br>", 0); } } }
public function onUserPageBuilding(UserPageBuildingEvent $event) { $u_id = url_escape($event->display_user->id); $i_image_count = Image::count_images(array("user_id={$event->display_user->id}")); $i_days_old = (time() - strtotime($event->display_user->join_date)) / 86400 + 1; $h_image_rate = sprintf("%.1f", $i_image_count / $i_days_old); $images_link = make_link("post/list/user_id={$u_id}/1"); $event->add_stats("<a href='{$images_link}'>Images uploaded</a>: {$i_image_count}, {$h_image_rate} per day"); }
public function onUserPageBuilding(UserPageBuildingEvent $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"); }
public function onUserPageBuilding(UserPageBuildingEvent $event) { $i_favorites_count = Image::count_images(array("favorited_by={$event->display_user->name}")); $i_days_old = (time() - strtotime($event->display_user->join_date)) / 86400 + 1; $h_favorites_rate = sprintf("%.1f", $i_favorites_count / $i_days_old); $favorites_link = make_link("post/list/favorited_by={$event->display_user->name}/1"); $event->add_stats("<a href='{$favorites_link}'>Images favorited</a>: {$i_favorites_count}, {$h_favorites_rate} per day"); }