Fixes a few errors.
[platal.git] / include / banana / ml.inc.php
index 5370476..c2eea5c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -55,6 +55,7 @@ class MLBanana extends Banana
         Banana::$debug_mbox = ($globals->debug & DEBUG_BT);
         Banana::$debug_smarty = ($globals->debug & DEBUG_SMARTY);
         Banana::$mbox_helper = $globals->banana->mbox_helper;
+        Banana::$feed_updateOnDemand = true;
         if (S::has_perms()) {
             Banana::$msgshow_mimeparts[] = 'source';
         }
@@ -78,6 +79,17 @@ class MLBanana extends Banana
         $sig  = $nom . ' (' . S::v('promo') . ')';
         Banana::$msgedit_headers['X-Org-Mail'] = S::v('forlife') . '@' . $globals->mail->domain;
 
+        // Tree color
+        $req = XDB::query("SELECT  tree_unread, tree_read
+                             FROM  {$globals->banana->table_prefix}profils
+                            WHERE  uid={?}", S::i('uid'));
+        if (!(list($unread, $read) = $req->fetchOneRow())) {
+            $unread = 'o';
+            $read = 'dg';
+        }
+        Banana::$tree_unread = $unread;
+        Banana::$tree_read = $read;
+
         // Build user profile
         Banana::$profile['headers']['From']         = "$nom <$mail>";
         Banana::$profile['headers']['Organization'] = make_Organization();