_(...) -> _b_(...)
[banana.git] / post.php
1 <?php
2 /********************************************************************************
3 * post.php : posting page
4 * ----------
5 *
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
9
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");
20
21 $profile = getprofile();
22 require_once("include/header.inc.php");
23 if (isset($_REQUEST['group'])) {
24 $group=htmlentities(strtolower($_REQUEST['group']));
25 }
26 if (isset($_REQUEST['id'])) {
27 $id=htmlentities(strtolower($_REQUEST['id']));
28 }
29
30 if (isset($group)) {
31 $target = $group;
32 }
33
34 $nntp = new nntp($news['server']);
35 if (!$nntp) error("nntpsock");
36 if ($news['user']!="anonymous") {
37 $result = $nntp->authinfo($news["user"],$news["pass"]);
38 if (!$result) error("nntpauth");
39 }
40
41 if (isset($group) && isset($id) && isset($_REQUEST['type']) &&
42 ($_REQUEST['type']=='followup')) {
43 $rq=$nntp->group($group);
44 $post = new NNTPPost($nntp,$id);
45 if ($post) {
46 $subject = (preg_match("/^re:/i",$post->headers->subject)?"":"Re: ")
47 .$post->headers->subject;
48 if ($profile['dropsig']) {
49 $cutoff=strpos($post->body,"\n-- \n");
50 if ($cutoff) {
51 $quotetext = substr($post->body,0,strpos($post->body,"\n-- \n"));
52 } else {
53 $quotetext = $post->body;
54 }
55 } else {
56 $quotetext = $post->body;
57 }
58 $body = $post->headers->name." wrote :\n".wrap($quotetext, "> ");
59 if (isset($post->headers->followup))
60 $target=$post->headers->followup;
61 else
62 $target=$post->headers->newsgroups;
63 }
64 }
65
66 $nntp->quit();
67 ?>
68 <h1>
69 <?php echo _b_('Nouveau message'); ?>
70 </h1>
71 <?php
72
73 displayshortcuts();
74
75 ?>
76
77 <form action="thread.php" method="post">
78 <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" border="0">
79 <tr>
80 <th colspan="2">
81 <?php echo _b_('En-têtes'); ?>
82 </th>
83 </tr>
84 <tr>
85 <td class="<?php echo $css['bicoltitre'];?>">
86 <?php echo _b_('Nom'); ?>
87 </td>
88 <td>
89 <?php echo htmlentities($profile['name']); ?>
90 </td>
91 </tr>
92 <tr>
93 <td class="<?php echo $css['bicoltitre'];?>">
94 <?php echo _b_('Sujet'); ?>
95 </td>
96 <td>
97 <input type="text" name="subject" value="<?php echo
98 (isset($subject)?$subject:"");?>" />
99 </td>
100 </tr>
101 <tr>
102 <td class="<?php echo $css['bicoltitre'];?>">
103 <?php echo _b_('Forums'); ?>
104 </td>
105 <td>
106 <input type="text" name="newsgroups" value="<?php echo
107 (isset($target)?$target:"");?>" />
108 </td>
109 </tr>
110 <tr>
111 <td class="<?php echo $css['bicoltitre'];?>">
112 <?php echo _b_('Suivi-à'); ?>
113 </td>
114 <td>
115 <input type="text" name="followup" value="" />
116 </td>
117 </tr>
118 <tr>
119 <td class="<?php echo $css['bicoltitre'];?>">
120 <?php echo _b_('Organisation'); ?>
121 </td>
122 <td>
123 <?php echo $profile['org']; ?>
124 </td>
125 </tr>
126 <tr>
127 <th colspan="2">
128 <?php echo _b_('Corps'); ?>
129 </th>
130 </tr>
131 <tr>
132 <td class="<?php echo $css['bicolvpadd'];?>" colspan="2">
133 <textarea name="body" cols="90" rows="16"><?php echo
134 (isset($body)?htmlentities($body):"").
135 ($profile['sig']!=''?"\n\n-- \n".htmlentities($profile['sig']):"");?></textarea>
136 </td>
137 </tr>
138 <tr>
139 <td class="<?php echo $css['bouton']?>" colspan="2">
140 <?php
141 if (isset($group) && isset($id) && isset($_REQUEST['type'])
142 && ($_REQUEST['type']=='followup')) {
143 ?>
144 <input type="hidden" name="type" value="followupok" />
145 <input type="hidden" name="group" value="<?php echo $group;?>" />
146 <input type="hidden" name="id" value="<?php echo $id;?>" />
147 <?php
148 } else {
149 ?>
150 <input type="hidden" name="type" value="new" />
151 <?php
152 }
153 ?>
154 <input type="submit" name="action" value="OK" />
155 </td>
156 </tr>
157 </table>
158 </form>
159 <?php
160 displayshortcuts();
161 require_once("include/footer.inc.php");
162 ?>