Close #407: RSS feed for Forums and MLs
[platal.git] / include / banana / forum.inc.php
index 651fdb8..3061c7a 100644 (file)
@@ -27,34 +27,23 @@ function hook_checkcancel($_headers)
     return ($_headers['x-org-id'] == S::v('forlife') or S::has_perms());
 }
 
-function hook_makeLink($params)
-{
-    global $globals;
-    $base = $globals->baseurl . '/banana';
-    if (isset($params['page'])) {
-        return $base . '/' . $params['page'];
-    }
-    if (@$params['action'] == 'subscribe') {
-        return $base . '/subscription';
-    }
-
-    if (!isset($params['group'])) {
-        return $base;
-    }
-    $base .= '/' . $params['group'];
-
-    return $base . hook_platalMessageLink($params);
-}
-
 class ForumsBanana extends Banana
 {
     function __construct($params = null)
     {
         global $globals;
         Banana::$msgedit_canattach = false;
+        Banana::$spool_root = $globals->banana->spool_root;
         array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
         Banana::$nntp_host = 'news://web_'.S::v('forlife')
                            . ":{$globals->banana->password}@{$globals->banana->server}:{$globals->banana->port}/";
+        if (S::has_perms()) {
+            Banana::$msgshow_mimeparts[] = 'source';
+        }
+        Banana::$debug_nntp = ($globals->debug & 1);
+        if (!S::v('core_rss_hash')) {
+            Banana::$feed_active = false;
+        }
         parent::__construct($params);
     }
 
@@ -91,9 +80,9 @@ class ForumsBanana extends Banana
                    FROM  {$globals->banana->table_prefix}abos
               LEFT JOIN  {$globals->banana->table_prefix}list ON list.fid=abos.fid
                   WHERE  uid={?}", S::i('uid'));
-        Banana::$profile['headers']['From']         = utf8_encode("$nom <$mail>");
+        Banana::$profile['headers']['From']         = "$nom <$mail>";
         Banana::$profile['headers']['Organization'] = 'Utilisateur de Polytechnique.org';
-        Banana::$profile['signature']               = utf8_encode($sig);
+        Banana::$profile['signature']               = $sig;
         Banana::$profile['display']                 = $disp;
         Banana::$profile['autoup']                  = $maj;
         Banana::$profile['lastnews']                = S::v('banana_last');
@@ -114,7 +103,7 @@ class ForumsBanana extends Banana
                                 . 'Marquer tous les messages comme lus'
                                 . '</a>', array('forums', 'thread', 'message'));
         }   
-        Banana::$page->registerPage('profile', utf8_encode('Préférences'), null);
+        Banana::$page->registerPage('profile', 'Préférences', null);
         
 
         // Run Banana
@@ -152,4 +141,5 @@ class ForumsBanana extends Banana
     }
 }
 
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>