still making it a library. remains post.php + event handlers
authorx2000habouzit <x2000habouzit>
Tue, 4 Jan 2005 23:10:55 +0000 (23:10 +0000)
committerx2000habouzit <x2000habouzit>
Tue, 4 Jan 2005 23:10:55 +0000 (23:10 +0000)
css/style.css
disconnect.php [deleted file]
include/banana.inc.php.in
include/misc.inc.php
subscribe.php

index 68afe1d..65ff1d6 100644 (file)
@@ -35,3 +35,6 @@ table.banana_msg .hdr { width: 15%; text-align: right; font-weight: bold; paddin
 table.banana_msg td.thrd { padding: 0px; }
 table.banana_msg table { border: 0px; padding: 0px; margin: 0px; width: 100%; }
 
+/** MISC **/
+
+div.center { text-align: center; padding: 1em; }
diff --git a/disconnect.php b/disconnect.php
deleted file mode 100644 (file)
index 28b2b55..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/********************************************************************************
-* disconnect.php : exit page
-* ----------------
-*
-* This file is part of the banana distribution
-* Copyright: See COPYING files that comes with this distribution
-********************************************************************************/
-
-require_once("include/banana.inc.php");
-
-$_SESSION=array();
-session_destroy();
-
-require_once("include/header.inc.php");
-?>
-<div class="title">
-  <?php echo _b_('Déconnexion effectuée !'); ?>
-</div>
-<p class="normal">
-  <?php echo _b_('Retour au <a href="index.php">profil</a>'); ?>
-</p>
-<?php
-require_once("include/footer.inc.php");
-?>
index 454e063..413ddbe 100644 (file)
@@ -55,7 +55,7 @@ class Banana
 
     function action_listGroups()
     {
-        $this->newGroup(BANANA_GROUP_SUB);
+        $this->newGroup();
         
         $cuts = displayshortcuts();
         $res  = '<h1>'._b_('Les forums de Banana').'</h1>'.$cuts.$this->groups->to_html();
@@ -68,6 +68,18 @@ class Banana
         return $res.$cuts;
     }
 
+    function action_listSubs()
+    {
+        require_once("include/groups.inc.php");
+        $this->groups = new BananaGroups(BANANA_GROUP_ALL);
+        
+        $cuts = displayshortcuts();
+        $res  = '<h1>'._b_('Abonnements').'</h1>'.$cuts.$this->groups->to_html(true).$cuts;
+
+        $this->nntp->quit();
+        return $res;
+    }
+
     function action_showThread($group, $first)
     {
         $this->newSpool($group, $this->profile['display'], $this->profile['lastnews']);
index dafc163..a478bdb 100644 (file)
@@ -154,8 +154,6 @@ function displayshortcuts($first = -1) {
 
     if (function_exists('hook_displayshortcuts')) {
         $res .= hook_displayshortcuts($sname, $first);
-    } else {
-        $res .= '[<a href="disconnect.php">'._b_('Déconnexion').'</a>] ';
     }
 
     switch ($sname) {
index 110d65b..4483a71 100644 (file)
 require_once("include/banana.inc.php");
 require_once("include/header.inc.php");
 
-$groups = new BananaGroups(2);
-?>
-
-<h1>
-  <?php echo _b_('Abonnements'); ?>
-</h1>
-
-<?php
-
-if (isset($_POST['subscribe']) && isset($_POST['action']) && $_POST['action']=="OK") {
-    update_subscriptions($_POST['subscribe']);
-    $banana->profile['subscribe']=$_POST['subscribe'];
-}
-
-if (!sizeof($groups->overview)) error("nntpgroups");
-
-displayshortcuts();
-?>
-
-<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
-<table class="bicol" cellspacing="0" cellpadding="2">
-  <tr>
-    <th>
-      <?php echo _b_('Total'); ?>
-    </th>
-    <th>
-      <?php echo _b_('Abonné'); ?>
-    </th>
-    <th>
-      <?php echo _b_('Nom'); ?>
-    </th>
-    <th>
-      <?php echo _b_('Description'); ?>
-    </th>
-  </tr>
-<?php
-$pair = true;
-foreach ($groups->overview as $g => $d) {
-  $pair = !$pair;
-  $groupinfo = $banana->nntp->group($g);
-  $newarts = $banana->nntp->newnews($banana->profile['lastnews'], $g);
-?>
-  <tr class="<?php echo ($pair?"pair":"impair");?>" >
-    <td class="tot">
-      <?php echo $groupinfo[0]; ?>
-    </td>
-    <td class="new">
-      <input type="checkbox" name="subscribe[]" value="<?php echo $g;?>"
-      <?php if (in_array($g, $banana->profile['subscribe'])) echo 'checked="checked"'; ?> />
-    </td>
-    <td class="grp">
-      <?php echo "<a href=\"thread.php?group=$g\">$g</a>";?>
-    </td>
-    <td class="dsc">
-      <?php echo $d[0];?>
-    </td>
-  </tr>
-<?php
-}
-?>
-  <tr class="<?php echo (!$pair?"pair":"impair"); ?>">
-    <td colspan="4" class="bouton">
-      <input type="submit" name="action" value="OK" />
-    </td>
-  </tr>
-</table>
-</form>
-<?php
-
-displayshortcuts();
+echo $banana->action_listSubs();
 
-$banana->nntp->quit();
 require_once("include/footer.inc.php");
 ?>