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