mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-06 09:52:29 +02:00
fixes #471, launch check for new version on page_tail
This commit is contained in:
@@ -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 |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user