#plugin-version { display: block; position: fixed; bottom: 0; right: 0; background: #eee; padding: 2px 10px; font-size: 0.9em; color: #555; } #plugin-version a { color: #777; margin-left: 8px; } '; return $html; } public function adminBodyEnd() { global $ADMIN_CONTROLLER; $timeToCheck = Session::get('timeToCheck') + 10*60; if( ($ADMIN_CONTROLLER=='dashboard') && ($timeToCheckgetVersion(); $versions = array('latest'=>'2.0'); Session::set('timeToCheck', time()); Session::set('latestVersion', $versions['latest']); } if( version_compare(Session::get('latestVersion'), BLUDIT_VERSION, '>') ) { $html = '
New version available
'; } else { if(BLUDIT_PRO) { $html = '
Bludit PRO v'.BLUDIT_VERSION.'
'; } else { $html = '
Bludit v'.BLUDIT_VERSION.'Upgrade to Bludit PRO
'; } } return $html; } private function getVersion() { $url = 'https://version.bludit.com'; $output = TCP::http($url); $json = json_decode($output, true); if(empty($json)) { return array('latest'=>''); } return $json; } }