c3e87dc8f2035e0c179f1d6740222a4a6f644ef9
[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/banana.inc.php");
11 require_once("include/header.inc.php");
12
13 if (isset($_REQUEST['group'])) {
14 $group = htmlentities(strtolower($_REQUEST['group']));
15 }
16 if (isset($_REQUEST['id'])) {
17 $id = htmlentities(strtolower($_REQUEST['id']));
18 }
19
20 if (isset($group)) {
21 $target = $group;
22 }
23
24 if (isset($group) && isset($id) && isset($_REQUEST['type']) && ($_REQUEST['type']=='followup')) {
25 $banana->newPost($id);
26 $body = '';
27 if ($banana->post) {
28 $subject = (preg_match("/^re\s*:\s*/i", $banana->post->headers['subject']) ? '' : 'Re: ').$banana->post->headers['subject'];
29 $body = $banana->post->name." wrote :\n".wrap($banana->post->body, "> ");
30 $target = isset($banana->post->headers['followup-to']) ? $banana->post->headers['followup-to'] : $banana->post->headers['newsgroups'];
31 }
32 }
33
34 $banana->nntp->quit();
35 ?>
36 <h1>
37 <?php echo _b_('Nouveau message'); ?>
38 </h1>
39 <?php
40
41 displayshortcuts();
42
43 ?>
44
45 <form action="thread.php" method="post">
46 <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" border="0">
47 <tr>
48 <th colspan="2">
49 <?php echo _b_('En-têtes'); ?>
50 </th>
51 </tr>
52 <tr>
53 <td class="<?php echo $css['bicoltitre'];?>">
54 <?php echo _b_('Nom'); ?>
55 </td>
56 <td>
57 <?php echo htmlentities($banana->profile['name']); ?>
58 </td>
59 </tr>
60 <tr>
61 <td class="<?php echo $css['bicoltitre'];?>">
62 <?php echo _b_('Sujet'); ?>
63 </td>
64 <td>
65 <input type="text" name="subject" value="<?php if (isset($subject)) echo $subject; ?>" />
66 </td>
67 </tr>
68 <tr>
69 <td class="<?php echo $css['bicoltitre'];?>">
70 <?php echo _b_('Forums'); ?>
71 </td>
72 <td>
73 <input type="text" name="newsgroups" value="<?php if (isset($target)) echo $target; ?>" />
74 </td>
75 </tr>
76 <tr>
77 <td class="<?php echo $css['bicoltitre'];?>">
78 <?php echo _b_('Suivi-à'); ?>
79 </td>
80 <td>
81 <input type="text" name="followup" value="" />
82 </td>
83 </tr>
84 <tr>
85 <td class="<?php echo $css['bicoltitre'];?>">
86 <?php echo _b_('Organisation'); ?>
87 </td>
88 <td>
89 <?php echo $banana->profile['org']; ?>
90 </td>
91 </tr>
92 <tr>
93 <th colspan="2">
94 <?php echo _b_('Corps'); ?>
95 </th>
96 </tr>
97 <tr>
98 <td class="<?php echo $css['bicolvpadd'];?>" colspan="2">
99 <textarea name="body" cols="90" rows="16"><?php
100 echo htmlentities($body);
101 if ($banana->profile['sig']) echo "\n\n-- \n".htmlentities($banana->profile['sig']);
102 ?></textarea>
103 </td>
104 </tr>
105 <tr>
106 <td class="<?php echo $css['bouton']?>" colspan="2">
107 <?php
108 if (isset($group) && isset($id) && isset($_REQUEST['type'])
109 && ($_REQUEST['type']=='followup')) {
110 ?>
111 <input type="hidden" name="type" value="followupok" />
112 <input type="hidden" name="group" value="<?php echo $group;?>" />
113 <input type="hidden" name="id" value="<?php echo $id;?>" />
114 <?php
115 } else {
116 ?>
117 <input type="hidden" name="type" value="new" />
118 <?php
119 }
120 ?>
121 <input type="submit" name="action" value="OK" />
122 </td>
123 </tr>
124 </table>
125 </form>
126 <?php
127 displayshortcuts();
128 require_once("include/footer.inc.php");
129 ?>