X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=post.php;h=a3273cee3831fd22938e202bef8456e6afe3a730;hb=e2cae7e3f2dc3b3a23da3aa608b90587986d18d2;hp=7d0f019e04f1dde3d4ef9cc2aa720e8f210924a3;hpb=e2625e7277ea0769529e4eaf3f28412dea90399b;p=banana.git diff --git a/post.php b/post.php index 7d0f019..a3273ce 100644 --- a/post.php +++ b/post.php @@ -1,50 +1,61 @@ \n\t".$locale['error']['connect']."\n

"; - require("include/footer.inc.php"); - exit; -} +$nntp = new nntp($news['server']); +if (!$nntp) error("nntpsock"); if ($news['user']!="anonymous") { - $result = $mynntp->authinfo($news["user"],$news["pass"]); - if (!$result) { - echo "

\n\t".$locale['error']['credentials'] - ."\n

"; - require("include/footer.inc.php"); - exit; - } + $result = $nntp->authinfo($news["user"],$news["pass"]); + if (!$result) error("nntpauth"); } if (isset($group) && isset($id) && isset($_REQUEST['type']) && ($_REQUEST['type']=='followup')) { - $rq=$mynntp->group($group); - $post = new post($mynntp,$id); + $rq=$nntp->group($group); + $post = new NNTPPost($nntp,$id); if ($post) { $subject = (preg_match("/^re:/i",$post->headers->subject)?"":"Re: ") .$post->headers->subject; - $body = $post->headers->name." wrote :\n".wrap($post->body, ">"); + 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 @@ -52,35 +63,35 @@ if (isset($group) && isset($id) && isset($_REQUEST['type']) && } } -$mynntp->quit(); +$nntp->quit(); ?> -
- -
+

+ +

-
- + +
- - - - - +
- +
- + +
- + + "> + "> +
- + + @@ -114,25 +125,25 @@ displayshortcuts();
- +
- + +
+ - + @@ -142,9 +153,10 @@ if (isset($group) && isset($id) && isset($_REQUEST['type']) ?>