config.inc.php is now a REAL file of the package
[banana.git] / post.php
index f0e4397..b15ab66 100644 (file)
--- a/post.php
+++ b/post.php
@@ -8,7 +8,7 @@
 ********************************************************************************/
 
 require_once("include/session.inc.php");
-require_once("include/encoding.inc.php");
+require_once("include/misc.inc.php");
 require_once("include/format.inc.php");
 require_once("include/config.inc.php");
 require_once("include/NetNNTP.inc.php");
@@ -16,60 +16,56 @@ require_once("include/post.inc.php");
 require_once("include/spool.inc.php");
 require_once("include/password.inc.php");
 require_once("include/profile.inc.php");
-require_once("include/wrapper.inc.php");
 require_once("include/error.inc.php");
 
 $profile = getprofile();
-require_once($profile['locale']);
-
 require_once("include/header.inc.php");
 if (isset($_REQUEST['group'])) {
-  $group=htmlentities(strtolower($_REQUEST['group']));
+    $group=htmlentities(strtolower($_REQUEST['group']));
 }
 if (isset($_REQUEST['id'])) {
-  $id=htmlentities(strtolower($_REQUEST['id']));
+    $id=htmlentities(strtolower($_REQUEST['id']));
 }
 
 if (isset($group)) {
-  $target = $group;
+    $target = $group;
 }
 
 $nntp = new nntp($news['server']);
 if (!$nntp) error("nntpsock");
 if ($news['user']!="anonymous") {
-  $result = $nntp->authinfo($news["user"],$news["pass"]);
-  if (!$result) error("nntpauth");
+    $result = $nntp->authinfo($news["user"],$news["pass"]);
+    if (!$result) error("nntpauth");
 }
 
 if (isset($group) && isset($id) && isset($_REQUEST['type']) && 
-  ($_REQUEST['type']=='followup')) {
-  $rq=$nntp->group($group);
-  $post = new post($nntp,$id);
-  if ($post) {
-    $subject = (preg_match("/^re:/i",$post->headers->subject)?"":"Re: ")
-      .$post->headers->subject;
-       if ($profile['dropsig']) {
-      $cutoff=strpos($post->body,"\n-- \n");
-      if ($cutoff) {
-           $quotetext = substr($post->body,0,strpos($post->body,"\n-- \n"));
-      } else {
-           $quotetext = $post->body;
-      }
-       } else {
-         $quotetext = $post->body;
-       }
-    $body = $post->headers->name." wrote :\n".wrap($quotetext, "> ");
-    if (isset($post->headers->followup))
-      $target=$post->headers->followup;
-    else
-      $target=$post->headers->newsgroups;
-  }
+        ($_REQUEST['type']=='followup')) {
+    $rq=$nntp->group($group);
+    $post = new BananaPost($nntp,$id);
+    if ($post) {
+        $subject = (preg_match("/^re:/i",$post->headers['subject'])?"":"Re: ").$post->headers['subject'];
+        if ($profile['dropsig']) {
+            $cutoff=strpos($post->body,"\n-- \n");
+            if ($cutoff) {
+                $quotetext = substr($post->body,0,strpos($post->body,"\n-- \n"));
+            } else {
+                $quotetext = $post->body;
+            }
+        } else {
+            $quotetext = $post->body;
+        }
+        $body = $post->name." wrote :\n".wrap($quotetext, "> ");
+        if (isset($post->headers['followup-to']))
+            $target = $post->headers['followup-to'];
+        else
+            $target = $post->headers['newsgroups'];
+    }
 }
 
 $nntp->quit();
 ?>
 <h1>
-  <?php echo $locale['post']['title'];?>
+  <?php echo _b_('Nouveau message'); ?>
 </h1>
 <?php
 
@@ -81,12 +77,12 @@ displayshortcuts();
 <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" border="0">
   <tr>
     <th colspan="2">
-      <?php echo $locale['post']['headers'];?>
+      <?php echo _b_('En-têtes'); ?>
     </th>
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo $locale['post']['name'];?>
+      <?php echo _b_('Nom'); ?>
     </td>
     <td>
       <?php echo htmlentities($profile['name']); ?>
@@ -94,7 +90,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo $locale['post']['subject'];?>
+      <?php echo _b_('Sujet'); ?>
     </td>
     <td>
       <input type="text" name="subject" value="<?php echo 
@@ -103,7 +99,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo $locale['post']['newsgroups'];?>
+      <?php echo _b_('Forums'); ?>
     </td>
     <td>
       <input type="text" name="newsgroups" value="<?php echo
@@ -112,7 +108,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo $locale['post']['fu2'];?>
+      <?php echo _b_('Suivi-à'); ?>
     </td>
     <td>
       <input type="text" name="followup" value="" />
@@ -120,7 +116,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo $locale['post']['organization'];?>
+      <?php echo _b_('Organisation'); ?>
     </td>
     <td>
       <?php echo $profile['org']; ?>
@@ -128,7 +124,7 @@ displayshortcuts();
   </tr>
   <tr>
     <th colspan="2">
-      <?php echo $locale['post']['body'];?>
+      <?php echo _b_('Corps'); ?>
     </th>
   </tr>
   <tr>