switch ($view)
{
case 'config':
+ $dev = $this->getPocheVersion('dev');
+ $prod = $this->getPocheVersion('prod');
+ $compare_dev = version_compare(POCHE_VERSION, $dev);
+ $compare_prod = version_compare(POCHE_VERSION, $prod);
+ $tpl_vars = array(
+ 'dev' => $dev,
+ 'prod' => $prod,
+ 'compare_dev' => $compare_dev,
+ 'compare_prod' => $compare_prod,
+ );
Tools::logm('config view');
break;
case 'view':
));
Tools::logm('export view');
}
+
+ private function getPocheVersion($which = 'prod')
+ {
+ $cache_file = CACHE . '/' . $which;
+ if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) {
+ $version = file_get_contents($cache_file);
+ } else {
+ $version = file_get_contents('http://www.inthepoche.com/' . $which);
+ file_put_contents($cache_file, $version, LOCK_EX);
+ }
+ return $version;
+ }
}
\ No newline at end of file
require_once './inc/3rdparty/simple_html_dom.php';
if (DOWNLOAD_PICTURES) {
- require_once './inc/poche/pochePicture.php';
+ require_once './inc/poche/pochePictures.php';
}
$poche = new Poche($storage_type);
\ No newline at end of file
<p>{% trans "Drag & drop this link to your bookmarks bar and have fun with poche." %}</p>
<p><a ondragend="this.click();" style="cursor: move; border: 1px dashed grey; background: white;" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@inthepoche.com']){top['bookmarklet-url@inthepoche.com'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></p>
+ <h2>{% trans "Updating poche" %}</h2>
+ <p><ul>
+ <li>{% trans "your version" %} : <strong>{{ constant('POCHE_VERSION') }}</strong></li>
+ <li>{% trans "latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong>{% trans "a more recent stable version is available." %}</strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>
+ <li>{% trans "latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong>{% trans "a more recent development version is available." %}</strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>
+ </ul>
+ </p>
+
<h2>{% trans "Change your password" %}</h2>
<form method="post" action="?config" name="loginform">
<fieldset class="w500p">