From 41cf00ebff5a2e7d3770bb7fc78288677df3ba2a Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Tue, 4 Jan 2005 17:54:55 +0000 Subject: [PATCH] various updates --- article.php | 2 +- css/banana.css | 67 +++++++++++++++++++ css/style.css | 4 +- include/NetNNTP.inc.php | 5 +- include/banana.inc.php.in | 39 ----------- include/misc.inc.php | 2 +- post.php | 163 +++++++++++++++++++++++----------------------- subscribe.php | 14 ++-- xface.php | 3 +- 9 files changed, 165 insertions(+), 134 deletions(-) create mode 100644 css/banana.css diff --git a/article.php b/article.php index ed10a48..d30e4c4 100644 --- a/article.php +++ b/article.php @@ -21,7 +21,7 @@ echo $banana->action_showArticle($group, $id); if (isset($_GET['type']) && $_GET['type']=='cancel' && $banana->post->checkcancel()) { ?> -

+

diff --git a/css/banana.css b/css/banana.css new file mode 100644 index 0000000..cf1940b --- /dev/null +++ b/css/banana.css @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2003-2004 Polytechnique.org * + * http://opensource.polytechnique.org/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ***************************************************************************/ + +body { + font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif; + margin:2em 1%; + padding:0; +} + +div.bloc { width: 800px; margin-left: auto; margin-right: auto; } + +div.foot { + border-top: 1px solid #a2c2e1; + padding-top: 1em; + margin-top: 1em; +} + +a:link, a:visited { color: #f60; background: transparent; } +a:active, a:hover { color: #369; background: transparent; } + +hr { border: none; border-top: 1px dotted #a2c2e1; } + +h1 { + color: #369; + background: inherit; + font-size: 200%; + text-align: center; + margin: 0em; + border-bottom: 2px solid #369; + padding: 4px; + margin: 1em 0em; +} + +table.bicol { + border-collapse: collapse; + border: 1px solid #a2c2e1; + width: 100%; +} + +table.bicol tr.impair { } +table.bicol tr.pair { color: inherit; background: #eee; } + +table.bicol th { + color: #369; + background: #d6e1ec; + padding: 0px 4px; +} + +table.bicol td { padding: 0px 4px; } + diff --git a/css/style.css b/css/style.css index 0b698c9..68afe1d 100644 --- a/css/style.css +++ b/css/style.css @@ -21,7 +21,7 @@ table.banana_thread td { white-space: nowrap; height: 100%; vertical-align: midd table.banana_thread tr.new { font-weight: bold; } -table.banana_thread td.date { text-align: center; } +table.banana_thread td.date { width: 15%; text-align: center; } table.banana_thread td.subj { text-align: left; overflow: hidden; } table.banana_thread td.from { text-align: left; } @@ -30,6 +30,8 @@ table.banana_thread span.cur { font-style: italic; font-size: 90%; } /** MESSAGE VIEW **/ +table.banana_msg .hdr { width: 15%; text-align: right; font-weight: bold; padding-right: 1em; } + table.banana_msg td.thrd { padding: 0px; } table.banana_msg table { border: 0px; padding: 0px; margin: 0px; width: 100%; } diff --git a/include/NetNNTP.inc.php b/include/NetNNTP.inc.php index c5c62de..13e574a 100644 --- a/include/NetNNTP.inc.php +++ b/include/NetNNTP.inc.php @@ -179,10 +179,9 @@ class nntp $this->lasterrortext = substr($result, 4); return false; } - $result = $this->gline(); - while ($result != ".") { + $array = Array(); + while (($result = $this->gline()) != ".") { $array[] = $result; - $result = $this->gline(); } return $array; } diff --git a/include/banana.inc.php.in b/include/banana.inc.php.in index 1411566..454e063 100644 --- a/include/banana.inc.php.in +++ b/include/banana.inc.php.in @@ -116,7 +116,6 @@ class Banana function newSpool($group, $disp=0, $since='') { require_once('include/spool.inc.php'); $this->spool = new BananaSpool($group, $disp, $since); - if (!$this->spool) { error('nntpspool'); } } function newPost($id) @@ -142,8 +141,6 @@ class Banana { if (function_exists('hook_getprofile')) { $this->profile = hook_getprofile(); - } else { - session_start(); } setlocale(LC_ALL, $this->profile['locale']); @@ -152,40 +149,4 @@ class Banana $banana = new Banana; -switch (basename($_SERVER['SCRIPT_NAME'])) { - case "thread.php": - if (!isset($_SESSION['bananapostok'])) { - $_SESSION['bananapostok']=true; - } - break; - - default: - $_SESSION['bananapostok']=true; - break; -} - -if (empty($css)) { -$css = array( - 'bananashortcuts' => 'bananashortcuts', - 'bicol' => 'bicol', - 'bicoltitre' => 'bicoltitre', - 'bicolvpadd' => 'bicolvpadd', - 'pair' => 'pair', - 'impair' => 'impair', - 'bouton' => 'bouton', - 'error' => 'error', - 'normal' => 'normal', - 'total' => 'total', - 'unread' => 'unread', - 'group' => 'group', - 'description' => 'description', - 'date' => 'date', - 'subject' => 'subject', - 'from' => 'from', - 'author' => 'author', - 'nopadd' => 'nopadd', - 'overview' => 'overview', - 'tree' => 'tree' - ); -} ?> diff --git a/include/misc.inc.php b/include/misc.inc.php index b20fce5..dafc163 100644 --- a/include/misc.inc.php +++ b/include/misc.inc.php @@ -147,7 +147,7 @@ function formatFrom($text) { } function displayshortcuts($first = -1) { - global $banana, $css; + global $banana; $sname = basename($_SERVER['SCRIPT_NAME']); $res = '
'; diff --git a/post.php b/post.php index c3e87dc..d76909b 100644 --- a/post.php +++ b/post.php @@ -22,6 +22,7 @@ if (isset($group)) { } if (isset($group) && isset($id) && isset($_REQUEST['type']) && ($_REQUEST['type']=='followup')) { + $banana->nntp->group($group); $banana->newPost($id); $body = ''; if ($banana->post) { @@ -38,92 +39,92 @@ $banana->nntp->quit(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - profile['name']); ?> -
- - - -
- - - -
- - - -
- - - profile['org']; ?> -
- -
- -
- - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + profile['name']); ?> +
+ + + +
+ + + +
+ + + +
+ + + profile['org']; ?> +
+ +
+ +
+ + + + + + + + +
diff --git a/subscribe.php b/subscribe.php index 1c7063d..110d65b 100644 --- a/subscribe.php +++ b/subscribe.php @@ -30,7 +30,7 @@ displayshortcuts(); ?>
-" cellspacing="0" cellpadding="2"> +
" > - " > + - - - - "> + "> diff --git a/xface.php b/xface.php index 802254e..16d0332 100644 --- a/xface.php +++ b/xface.php @@ -1,5 +1,6 @@ -- 2.1.4
@@ -52,25 +52,25 @@ foreach ($groups->overview as $g => $d) { $groupinfo = $banana->nntp->group($g); $newarts = $banana->nntp->newnews($banana->profile['lastnews'], $g); ?> -
"> +
"> + profile['subscribe'])) echo 'checked="checked"'; ?> /> "> + $g";?> "> +