From bfec7fc2c2e06103d566583ac1125a2cfeb487d2 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 8 Dec 2016 08:54:55 -0800 Subject: [PATCH] Option to dismiss alert added. --- e107_admin/admin.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 14a508a14..86cf3ad19 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -197,24 +197,34 @@ class admin_start } - + /** + * + */ private function checkNewInstall() { + + $upgradeAlertFlag = e_CACHE.'dismiss.upgrade.alert.txt'; + + if(!empty($_GET['dismiss']) && $_GET['dismiss'] == 'upgrade') + { + file_put_contents($upgradeAlertFlag,'true'); + } + $pref = e107::getPref('install_date'); $v2ReleaseDate = strtotime('August 27, 2015'); - // $pref = strtotime('yesterday'); - $numDays = (abs($pref - time())/60/60/24); if($numDays < 3) // installed in the past 3 days. { echo e107::getMessage()->setTitle('Need Help?',E_MESSAGE_INFO)->addInfo("

Connect with our community for free support with any e107 issues you may encounter.

")->render(); } - elseif($pref < $v2ReleaseDate) // installed prior to v2 release. + elseif($pref < $v2ReleaseDate && !file_exists($upgradeAlertFlag)) // installed prior to v2 release. { - echo e107::getMessage()->setTitle('Upgrading?',E_MESSAGE_INFO)->addInfo("

Connect with our community for free support with any upgrading issues you may encounter.

")->render(); + $message = "Connect with our community for free support with any upgrading issues you may encounter."; + $message .= "
Don't show again
"; //todo do it with class=e-ajax and data-dismiss='alert' + echo e107::getMessage()->setTitle('Upgrading?',E_MESSAGE_INFO)->addInfo($message)->render(); } e107::getMessage()->setTitle(null,E_MESSAGE_INFO);