diff --git a/3.0/modules/quotas/helpers/quotas_event.php b/3.0/modules/quotas/helpers/quotas_event.php index dcf535c6..bd8a596e 100644 --- a/3.0/modules/quotas/helpers/quotas_event.php +++ b/3.0/modules/quotas/helpers/quotas_event.php @@ -107,4 +107,16 @@ class quotas_event_Core { $record = ORM::factory("users_space_usage")->where("owner_id", "=", $item->owner_id)->find(); $record->add_item($item); } + + static function show_user_profile($data) { + $v = new View("user_profile_quotas.html"); + $quotas_record = ORM::factory("users_space_usage")->where("owner_id", "=", $data->user->id)->find(); + + $v->user_profile_data = array(); + $v->user_profile_data[(string) t("Albums")] = db::build()->from("items")->where("type", "=", "album")->where("owner_id", "=", $data->user->id)->count_records(); + $v->user_profile_data[(string) t("Uploads")] = db::build()->from("items")->where("type", "!=", "album")->where("owner_id", "=", $data->user->id)->count_records(); + $v->user_profile_data[(string) t("Disc Usage")] = $quotas_record->total_usage_string(); + + $data->content[] = (object) array("title" => t("User stats"), "view" => $v); + } } diff --git a/3.0/modules/quotas/views/user_profile_quotas.html.php b/3.0/modules/quotas/views/user_profile_quotas.html.php new file mode 100644 index 00000000..e559abda --- /dev/null +++ b/3.0/modules/quotas/views/user_profile_quotas.html.php @@ -0,0 +1,9 @@ + + + $value): ?> + + + + + +