var $host = 'news://localhost:119/';
- var $profile = Array( 'name' => 'Anonymous <anonymouse@example.com', 'sig' => '', 'org' => '',
+ var $profile = Array( 'name' => 'Anonymous <anonymouse@example.com>', 'sig' => '', 'org' => '',
'customhdr' =>'', 'display' => 0, 'lastnews' => 0, 'locale' => 'fr_FR', 'subscribe' => array());
var $nntp;
return $res.$cuts;
}
+ function action_newFup($group, $id = -1)
+ {
+ $subject = $body = '';
+ $target = $group;
+
+ if ($id > 0) {
+ $this->nntp->group($group);
+ $this->newPost($id);
+ if ($this->post) {
+ $subject = preg_replace("/^re\s*:\s*/i", 'Re: ', $this->post->headers['subject']);
+ $body = $this->post->name." "._b_("a écrit")." :\n".wrap($this->post->body, "> ");
+ $target = isset($this->post->headers['followup-to']) ? $this->post->headers['followup-to'] : $this->post->headers['newsgroups'];
+ }
+ }
+
+ $this->nntp->quit();
+
+ $cuts = displayshortcuts();
+ $html = '<h1>'._b_('Nouveau message').'</h1>'.$cuts;
+ $html .= '<form action="?" method="post">';
+ $html .= '<table class="bicol" cellpadding="0" cellspacing="0">';
+ $html .= '<tr><th colspan="2">'._b_('En-têtes').'</th></tr>';
+ $html .= '<tr><td>'._b_('Nom').'</td><td>'.htmlentities($this->profile['name']).'</td></tr>';
+ $html .= '<tr><td>'._b_('Sujet').'</td><td><input type="text" name="subject" value="'.htmlentities($subject).'" size="60" /></td></tr>';
+ $html .= '<tr><td>'._b_('Forums').'</td><td><input type="text" name="newsgroups" value="'.htmlentities($target).'" size="60" /></td></tr>';
+ $html .= '<tr><td>'._b_('Suivi à').'</td><td><input type="text" name="newsgroups" value="" size="60" /></td></tr>';
+ $html .= '<tr><td>'._b_('Organisation').'</td><td>'.$this->profile['org'].'</td></tr>';
+ $html .= '<tr><th colspan="2">'._b_('Corps').'</th></tr>';
+ $html .= '<tr><td colspan="2"><textarea name="body" cols="74" rows="16">'
+ .htmlentities($body).($this->profile['sig'] ? "\n\n-- \n".htmlentities($this->profile['sig']) : '').'</textarea></td></th>';
+ $html .= '<tr><td colspan="2"><input type="hidden" name="group" value="'.$group.'" />';
+ if ($id > 0) {
+ $html .= '<input type="hidden" name="id" value="'.$id.'" />';
+ }
+ $html .= '<input type="submit" /></td></tr>';
+ $html .= '</table></form>';
+
+ return $html.$cuts;
+ }
+
/**************************************************************************/
/* */
/**************************************************************************/
if (isset($_REQUEST['group'])) {
$group = htmlentities(strtolower($_REQUEST['group']));
}
-if (isset($_REQUEST['id'])) {
- $id = htmlentities(strtolower($_REQUEST['id']));
-}
-
-if (isset($group)) {
- $target = $group;
-}
-
-if (isset($group) && isset($id) && isset($_REQUEST['type']) && ($_REQUEST['type']=='followup')) {
- $banana->nntp->group($group);
- $banana->newPost($id);
- $body = '';
- if ($banana->post) {
- $subject = (preg_match("/^re\s*:\s*/i", $banana->post->headers['subject']) ? '' : 'Re: ').$banana->post->headers['subject'];
- $body = $banana->post->name." wrote :\n".wrap($banana->post->body, "> ");
- $target = isset($banana->post->headers['followup-to']) ? $banana->post->headers['followup-to'] : $banana->post->headers['newsgroups'];
- }
-}
-$banana->nntp->quit();
-?>
-<h1>
- <?php echo _b_('Nouveau message'); ?>
-</h1>
-<?php
+$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : -1;
-echo displayshortcuts();
+echo $banana->action_newFup($group, $id);
-?>
-
-<form action="thread.php" method="post">
- <table class="bicol" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <th colspan="2">
- <?php echo _b_('En-têtes'); ?>
- </th>
- </tr>
- <tr>
- <td class="<?php echo $css['bicoltitre'];?>">
- <?php echo _b_('Nom'); ?>
- </td>
- <td>
- <?php echo htmlentities($banana->profile['name']); ?>
- </td>
- </tr>
- <tr>
- <td class="<?php echo $css['bicoltitre'];?>">
- <?php echo _b_('Sujet'); ?>
- </td>
- <td>
- <input type="text" name="subject" value="<?php if (isset($subject)) echo $subject; ?>" />
- </td>
- </tr>
- <tr>
- <td class="<?php echo $css['bicoltitre'];?>">
- <?php echo _b_('Forums'); ?>
- </td>
- <td>
- <input type="text" name="newsgroups" value="<?php if (isset($target)) echo $target; ?>" />
- </td>
- </tr>
- <tr>
- <td class="<?php echo $css['bicoltitre'];?>">
- <?php echo _b_('Suivi-à'); ?>
- </td>
- <td>
- <input type="text" name="followup" value="" />
- </td>
- </tr>
- <tr>
- <td class="<?php echo $css['bicoltitre'];?>">
- <?php echo _b_('Organisation'); ?>
- </td>
- <td>
- <?php echo $banana->profile['org']; ?>
- </td>
- </tr>
- <tr>
- <th colspan="2">
- <?php echo _b_('Corps'); ?>
- </th>
- </tr>
- <tr>
- <td class="<?php echo $css['bicolvpadd'];?>" colspan="2">
- <textarea name="body" cols="90" rows="16"><?php
- echo htmlentities($body);
- if ($banana->profile['sig']) echo "\n\n-- \n".htmlentities($banana->profile['sig']);
- ?></textarea>
- </td>
- </tr>
- <tr>
- <td class="<?php echo $css['bouton']?>" colspan="2">
- <?php
- if (isset($group) && isset($id) && isset($_REQUEST['type'])
- && ($_REQUEST['type']=='followup')) {
- ?>
- <input type="hidden" name="type" value="followupok" />
- <input type="hidden" name="group" value="<?php echo $group;?>" />
- <input type="hidden" name="id" value="<?php echo $id;?>" />
- <?php
- } else {
- ?>
- <input type="hidden" name="type" value="new" />
- <?php
- }
- ?>
- <input type="submit" name="action" value="OK" />
- </td>
- </tr>
- </table>
-</form>
-<?php
-echo displayshortcuts();
require_once("include/footer.inc.php");
?>