Easier way to switch between subscribed newsgroups
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Wed, 12 Jul 2006 08:18:30 +0000 (08:18 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:34:52 +0000 (00:34 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@80 9869982d-c50d-0410-be91-f2a2ec7c7c7b

Changelog
banana/banana.inc.php.in
banana/post.inc.php
banana/spool.inc.php
css/style.css

index ccc5403..d33bb9c 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,6 @@
+Wed, 12 Jul 2006                    Florent Bruneau <florent.bruneau@m4x.org>
+       * Add the list of subscriptions after the spool
+
 Tue, 11 Jul 2006                    Florent Bruneau <florent.bruneau@m4x.org>
        * Bugfix: body conversion from unknown charset
 
index b1ec2b2..f67c746 100644 (file)
@@ -467,6 +467,9 @@ class Banana
                 return false;
             }
         }
+        if (count($this->profile['subscribe']) > 0) {
+            $this->_newGroup(false);
+        }
         return true;
     }
 
@@ -481,11 +484,11 @@ class Banana
         return true;
     }
 
-    function _newGroup()
+    function _newGroup($showNew = true)
     {
         $this->_require('groups');
         $this->groups = new BananaGroups(BANANA_GROUP_SUB);
-        if ($this->groups->type == BANANA_GROUP_SUB) {
+        if ($showNew && $this->groups->type == BANANA_GROUP_SUB) {
             $this->newgroups = new BananaGroups(BANANA_GROUP_NEW);
         }
     }
index 09c2a0a..e699e7f 100644 (file)
@@ -428,10 +428,14 @@ class BananaPost
             $res .= '</td></tr>';
         }
         
-        $res .= '<tr><th colspan="2">'._b_('Apercu').'</th></tr>';
+        $res .= '<tr><th colspan="2">' . _b_('Apercu de ')
+             . makeHREF(Array('group' => $banana->state['group']),
+                        $banana->state['group'])
+             . '</th></tr>';
         $ndx  = $banana->spool->getndx($this->id);
-        $res .= '<tr><td class="thrd" colspan="2">'.$banana->spool->to_html($ndx-$banana->tbefore, $ndx+$banana->tafter, $ndx).'</td></tr>';
-
+        $res .= '<tr><td class="thrd" colspan="2">'
+             . $banana->spool->to_html($ndx-$banana->tbefore, $ndx+$banana->tafter, $ndx)
+             . '</td></tr>';
         return $res.'</table>';
     }
 }
index 0b121e9..f387ebf 100644 (file)
@@ -403,6 +403,16 @@ class BananaSpool
             $res .= '<tr><td colspan="3">'._b_('Aucun message dans ce forum').'</td></tr>';
         }
 
+        global $banana;
+        if (is_object($banana->groups)) {
+            $res .= '<tr><td colspan="3" class="subs">'
+                 . $banana->groups->to_html()
+                 . '</td></tr>';
+        }
+        $res .= '<tr><th colspan="3" class="subs">'
+             . makeHREF(Array('subscribe' => 1), 'GĂ©rer mes abonnements')
+             . '</th></tr>';
+
         return $res .= '</table>';
     }
 
index 50a0761..74e4592 100644 (file)
@@ -38,6 +38,8 @@ table.banana_thread td.from { text-align: left; }
 
 table.banana_thread div.tree { float: left; padding-right: 0.3em; }
 table.banana_thread span.cur { font-style: italic; }
+table.banana_thread table { border: 0px; padding: 0px; margin: 0px; width: 100%; }
+table.banana_thread td.subs { padding: 0%; }
 
 /** MESSAGE VIEW **/