Remove my old and ugly hack to check permissions and set up a new flexible way to...
[platal.git] / modules / events.php
index 3601aef..96885f8 100644 (file)
@@ -37,6 +37,26 @@ class EventsModule extends PLModule
 
     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 {