From fad8506f6511c83be66442aa6231b0455281a9d1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 8 Oct 2008 05:14:20 +0100 Subject: [PATCH] display size of stored articles in the user details window --- modules/pref-users.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/pref-users.php b/modules/pref-users.php index 061927033..75afb00a3 100644 --- a/modules/pref-users.php +++ b/modules/pref-users.php @@ -53,7 +53,16 @@ // print "Access level$access_level"; print "".__('Registered')."$created"; print "".__('Last logged in')."$last_login"; - print "".__('Stored articles')."$stored_articles"; + + $result = db_query($link, "SELECT + SUM(LENGTH(content)) AS db_size + FROM ttrss_user_entries,ttrss_entries + WHERE owner_uid = '$uid' AND ref_id = id"); + + $db_size = round(db_fetch_result($result, 0, "db_size") / 1024); + + print "".__('Stored articles'). + "$stored_articles (${db_size}K)"; $result = db_query($link, "SELECT COUNT(id) as num_feeds FROM ttrss_feeds WHERE owner_uid = '$uid'"); @@ -61,18 +70,7 @@ $num_feeds = db_fetch_result($result, 0, "num_feeds"); print "".__('Subscribed feeds count')."$num_feeds"; - - /* - $result = db_query($link, "SELECT - SUM(LENGTH(content)+LENGTH(title)+LENGTH(link)+LENGTH(guid)) AS db_size - FROM ttrss_user_entries,ttrss_entries - WHERE owner_uid = '$uid' AND ref_id = id"); - - $db_size = round(db_fetch_result($result, 0, "db_size") / 1024); - - print "Approx. used DB size$db_size KBytes"; - */ - + print ""; print "

".__('Subscribed feeds')."

";