SELECT  u.user_id AS uid, prenom, nom, perms, promo, matricule, password, FIND_IN_SET('femme', u.flags) AS femme,
                 UNIX_TIMESTAMP(s.start) AS lastlogin, s.host, a.alias AS forlife, a2.alias AS bestalias,
                 q.core_mail_fmt AS mail_fmt, UNIX_TIMESTAMP(q.banana_last) AS banana_last, q.watch_last, q.core_rss_hash,
-                FIND_IN_SET('watch', u.flags) AS watch_account
+                FIND_IN_SET('watch', u.flags) AS watch_account, q.last_version
           FROM  auth_user_md5   AS u
     INNER JOIN  auth_user_quick AS q  USING(user_id)
     INNER JOIN  aliases         AS a  ON (u.user_id = a.id AND a.type='a_vie')
 
 
     function get_tips($exclude = null)
     {
+        global $globals;
+        // Add a new special tip when changing plat/al version
+        if ($globals->version != S::v('last_version') && is_null($exclude)) {
+            XDB::execute('UPDATE auth_user_quick
+                             SET last_version = {?}
+                           WHERE user_id = {?}',
+                           $globals->version, S::i('uid'));
+            return array('id' => 0,
+                         'titre' => 'Bienvenue sur la nouvelle version du site !',
+                         'text' => 'Le site a été mis à jour depuis ta dernière visite vers la version ' . $globals->version
+                                   . '. Nous t\'invitons à en découvrir les nouveautés en te rendant sur '
+                                   . '<a href="banana/xorg.m4x.innovation">nos forums</a> ou en consultant '
+                                   . '<a href="changelog">la liste exhaustive des modifications</a>',
+                         'priorite' => 255,
+                         'promo_min' => 0,
+                         'promo_max' => 0,
+                         'state'     => 'active',
+                         'special'   => true);
+        }
+
         $exclude  = is_null($exclude) ? '' : ' AND id != ' . $exclude . ' ';
         $priority = rand(0, 510);
         do {
 
         $page->assign('virtualalias', $res->fetchOneCell());
 
         $page->addJsLink('close_on_esc.js');
+        header('Last-Modified: ' . date('r', strtotime($user['date'])));
     }
 
     function handler_p_edit(&$page, $opened_tab = 'general')
 
 {if $full}
 <fieldset id="tod">
 {/if}
-  <legend>{icon name=lightbulb}Astuce : {$tips.titre}     
+  <legend>{icon name=lightbulb}{if !$tips.special}
+    Astuce : {$tips.titre}
+  {else}
+    <span style="color: red; font-weight: bold;">{$tips.titre}</span>
+  {/if}
   {if !$nochange}
-  <a href="" onclick="Ajax.update_html('tod', 'ajax/tips/{$tips.id}'); return false">
+       <a href="" onclick="Ajax.update_html('tod', 'ajax/tips/{$tips.id}'); return false">
     {icon name=resultset_next title="Astuce suivante"}
   </a>
   {/if}
 
--- /dev/null
+alter table auth_user_quick add column last_version varchar(16) not null default '0.9.13';
+
+# vim:set syntax=mysql: