Revert "fixes #2166 add feature to send anonymous stats to piwigo.org"

This reverts commit 1106612fc3.

Theses changes were committed on 14.x by mistake
This commit is contained in:
plegall
2024-06-10 21:32:35 +02:00
parent 1106612fc3
commit ec5bce90bf
6 changed files with 119 additions and 512 deletions
+74 -10
View File
@@ -109,10 +109,74 @@ if ($conf['show_newsletter_subscription'] and userprefs_get_param('show_newslett
}
$stats = get_pwg_general_statitics();
$query = '
SELECT COUNT(*)
FROM '.IMAGES_TABLE.'
;';
list($nb_photos) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.CATEGORIES_TABLE.'
;';
list($nb_categories) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.TAGS_TABLE.'
;';
list($nb_tags) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.IMAGE_TAG_TABLE.'
;';
list($nb_image_tag) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.USERS_TABLE.'
;';
list($nb_users) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM `'.GROUPS_TABLE.'`
;';
list($nb_groups) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.RATE_TABLE.'
;';
list($nb_rates) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT
SUM(nb_pages)
FROM '.HISTORY_SUMMARY_TABLE.'
WHERE month IS NULL
;';
list($nb_views) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT
SUM(filesize)
FROM '.IMAGES_TABLE.'
;';
list($disk_usage) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT
SUM(filesize)
FROM '.IMAGE_FORMAT_TABLE.'
;';
list($formats_disk_usage) = pwg_db_fetch_row(pwg_query($query));
$disk_usage+= $formats_disk_usage;
$du_decimals = 1;
$du_gb = $stats['disk_usage']/(1024*1024);
$du_gb = $disk_usage/(1024*1024);
if ($du_gb > 100)
{
$du_decimals = 0;
@@ -120,14 +184,14 @@ if ($du_gb > 100)
$template->assign(
array(
'NB_PHOTOS' => $stats['nb_photos'],
'NB_ALBUMS' => $stats['nb_categories'],
'NB_TAGS' => $stats['nb_tags'],
'NB_IMAGE_TAG' => $stats['nb_image_tag'],
'NB_USERS' => $stats['nb_users'],
'NB_GROUPS' => $stats['nb_groups'],
'NB_RATES' => $stats['nb_rates'],
'NB_VIEWS' => number_format_human_readable($stats['nb_views']),
'NB_PHOTOS' => $nb_photos,
'NB_ALBUMS' => $nb_categories,
'NB_TAGS' => $nb_tags,
'NB_IMAGE_TAG' => $nb_image_tag,
'NB_USERS' => $nb_users,
'NB_GROUPS' => $nb_groups,
'NB_RATES' => $nb_rates,
'NB_VIEWS' => number_format_human_readable($nb_views),
'NB_PLUGINS' => count($pwg_loaded_plugins),
'STORAGE_USED' => str_replace(' ', ' ', l10n('%sGB', number_format($du_gb, $du_decimals))),
'U_QUICK_SYNC' => PHPWG_ROOT_PATH.'admin.php?page=site_update&site=1&quick_sync=1&pwg_token='.get_pwg_token(),