fixes #471, launch check for new version on page_tail

This commit is contained in:
plegall
2017-03-29 15:44:07 +02:00
parent ae34f3859a
commit 37c7902879
2 changed files with 35 additions and 0 deletions
+10
View File
@@ -276,6 +276,16 @@ $conf['ext_imagick_dir'] = '';
// are array(5,10,20,50,'all') but you can set any other numeric value.
$conf['comments_page_nb_comments'] = 10;
// how often should we check for new versions of Piwigo on piwigo.org? In
// seconds. The check is made only if there are visits on Piwigo.
// 0 to disable.
$conf['update_notify_check_period'] = 24*60*60;
// how often should be remind of new versions available? For example a first
// notification was sent on May 5th 2017 for 2.9.1, after how many seconds
// we send it again? 0 to disable.
$conf['update_notify_reminder_period'] = 7*24*60*60;
// +-----------------------------------------------------------------------+
// | email |
// +-----------------------------------------------------------------------+
+25
View File
@@ -39,6 +39,31 @@ if (!is_a_guest())
);
}
//--------------------------------------------------------- update notification
if ($conf['update_notify_check_period'] > 0)
{
$check_for_updates = false;
if (isset($conf['update_notify_last_check']))
{
if (strtotime($conf['update_notify_last_check']) < strtotime($conf['update_notify_check_period'].' seconds ago'))
{
$check_for_updates = true;
}
}
else
{
$check_for_updates = true;
}
if ($check_for_updates)
{
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'admin/include/updates.class.php');
$updates = new updates();
$updates->notify_piwigo_new_versions();
}
}
//------------------------------------------------------------- generation time
$debug_vars = array();