2 /********************************************************************************
3 * post.php : posting page
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 require_once("include/session.inc.php");
11 require_once("include/misc.inc.php");
12 require_once("include/format.inc.php");
13 require_once("include/config.inc.php");
14 require_once("include/NetNNTP.inc.php");
15 require_once("include/post.inc.php");
16 require_once("include/spool.inc.php");
17 require_once("include/password.inc.php");
18 require_once("include/profile.inc.php");
19 require_once("include/error.inc.php");
21 $profile = getprofile();
22 require_once($profile['locale']);
24 require_once("include/header.inc.php");
25 if (isset($_REQUEST['group'])) {
26 $group=htmlentities(strtolower($_REQUEST['group']));
28 if (isset($_REQUEST['id'])) {
29 $id=htmlentities(strtolower($_REQUEST['id']));
36 $nntp = new nntp($news['server']);
37 if (!$nntp) error("nntpsock");
38 if ($news['user']!="anonymous") {
39 $result = $nntp->authinfo($news["user"],$news["pass"]);
40 if (!$result) error("nntpauth");
43 if (isset($group) && isset($id) && isset($_REQUEST['type']) &&
44 ($_REQUEST['type']=='followup')) {
45 $rq=$nntp->group($group);
46 $post = new NNTPPost($nntp,$id);
48 $subject = (preg_match("/^re:/i",$post->headers
->subject
)?
"":"Re: ")
49 .$post->headers
->subject
;
50 if ($profile['dropsig']) {
51 $cutoff=strpos($post->body
,"\n-- \n");
53 $quotetext = substr($post->body
,0,strpos($post->body
,"\n-- \n"));
55 $quotetext = $post->body
;
58 $quotetext = $post->body
;
60 $body = $post->headers
->name
." wrote :\n".wrap($quotetext, "> ");
61 if (isset($post->headers
->followup
))
62 $target=$post->headers
->followup
;
64 $target=$post->headers
->newsgroups
;
71 <?php
echo $locale['post']['title'];?
>
79 <form action
="thread.php" method
="post">
80 <table
class="<?php echo $css['bicol']?>" cellpadding
="0" cellspacing
="0" border
="0">
83 <?php
echo $locale['post']['headers'];?
>
87 <td
class="<?php echo $css['bicoltitre'];?>">
88 <?php
echo $locale['post']['name'];?
>
91 <?php
echo htmlentities($profile['name']); ?
>
95 <td
class="<?php echo $css['bicoltitre'];?>">
96 <?php
echo $locale['post']['subject'];?
>
99 <input type
="text" name
="subject" value
="<?php echo
100 (isset($subject)?$subject:"");?>" />
104 <td
class="<?php echo $css['bicoltitre'];?>">
105 <?php
echo $locale['post']['newsgroups'];?
>
108 <input type
="text" name
="newsgroups" value
="<?php echo
109 (isset($target)?$target:"");?>" />
113 <td
class="<?php echo $css['bicoltitre'];?>">
114 <?php
echo $locale['post']['fu2'];?
>
117 <input type
="text" name
="followup" value
="" />
121 <td
class="<?php echo $css['bicoltitre'];?>">
122 <?php
echo $locale['post']['organization'];?
>
125 <?php
echo $profile['org']; ?
>
130 <?php
echo $locale['post']['body'];?
>
134 <td
class="<?php echo $css['bicolvpadd'];?>" colspan
="2">
135 <textarea name
="body" cols
="90" rows
="16"><?php
echo
136 (isset($body)?
htmlentities($body):"").
137 ($profile['sig']!=''?
"\n\n-- \n".htmlentities($profile['sig']):"");?
></textarea
>
141 <td
class="<?php echo $css['bouton']?>" colspan
="2">
143 if (isset($group) && isset($id) && isset($_REQUEST['type'])
144 && ($_REQUEST['type']=='followup')) {
146 <input type
="hidden" name
="type" value
="followupok" />
147 <input type
="hidden" name
="group" value
="<?php echo $group;?>" />
148 <input type
="hidden" name
="id" value
="<?php echo $id;?>" />
152 <input type
="hidden" name
="type" value
="new" />
156 <input type
="submit" name
="action" value
="OK" />
163 require_once("include/footer.inc.php");