mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fixes #1801 for big galleries, only compute number of orphans on the dashboard
This commit is contained in:
28
admin.php
28
admin.php
@@ -265,26 +265,22 @@ if (in_array($page['page'], array('site_update', 'batch_manager')))
|
||||
}
|
||||
}
|
||||
|
||||
// any orphan photo?
|
||||
$nb_orphans = count(get_orphans());
|
||||
// only calculate number of orphans on all pages if the number of images is "not huge"
|
||||
$page['nb_orphans'] = 0;
|
||||
|
||||
if ($nb_orphans > 0)
|
||||
list($page['nb_photos_total']) = pwg_db_fetch_row(pwg_query('SELECT COUNT(*) FROM '.IMAGES_TABLE));
|
||||
if ($page['nb_photos_total'] < 100000) // 100k is already a big gallery
|
||||
{
|
||||
$template->assign(
|
||||
array(
|
||||
'NB_ORPHANS' => $nb_orphans,
|
||||
'U_ORPHANS' => $link_start.'batch_manager&filter=prefilter-no_album',
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$template->assign(
|
||||
array(
|
||||
'NB_ORPHANS' => 0,
|
||||
'U_ORPHANS' => '',
|
||||
)
|
||||
);
|
||||
$page['nb_orphans'] = count(get_orphans());
|
||||
}
|
||||
|
||||
$template->assign(
|
||||
array(
|
||||
'NB_ORPHANS' => $page['nb_orphans'],
|
||||
'U_ORPHANS' => $link_start.'batch_manager&filter=prefilter-no_album',
|
||||
)
|
||||
);
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Refresh permissions |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user