extendable user stats rather than hardcoded with assumptions of extensions
This commit is contained in:
@ -124,6 +124,15 @@ class ImageIO extends SimpleExtension {
|
||||
$event->image->delete();
|
||||
}
|
||||
|
||||
public function onUserPageBuilding($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 onSetupBuilding($event) {
|
||||
$sb = new SetupBlock("Image Options");
|
||||
$sb->position = 30;
|
||||
|
Reference in New Issue
Block a user