$body = $_POST['body'];
$target = $_POST['newsgroups'];
$followup = $_POST['followup'];
- $this->state['page'] = 'message';
+ $this->state['page'] = 'action';
+ $this->state['group'] = $group;
+ $this->state['action'] = 'new';
+ if ($id != -1) {
+ $this->state['artid'] = $id;
+ }
} elseif ($id > 0) {
$this->nntp->group($group);
if ($this->_newPost($id)) {
- $subject = preg_replace("/^re\s*:\s*/i", '', 'Re: '.$this->post->headers['subject']);
+ $subject = 'Re: ' . preg_replace("/^re\s*:\s*/i", '', $this->post->headers['subject']);
$body = utf8_encode($this->post->name." "._b_("a écrit"))." :\n"
. wrap($this->post->get_body(), "> ")
. $this->profile['sig'] ? "\n\n-- \n". $this->profile['sig'] : '';
. '<input type="file" name="newpj" size="40"/></td></tr>';
}
$html .= '<tr><th colspan="2">';
- if ($id > 0) {
- $html .= '<input type="hidden" name="artid" value="'.$id.'" />';
+ if ($id != -1) {
+ $html .= '<input type="hidden" name="artid" value="' . $id . '" />';
}
$html .= '<input type="hidden" name="action" value="new" />'
. '<input type="submit" value="' . _b_('Envoyer le message') . '" /></th></tr>'
$msgids = $banana->nntp->xhdr('Message-ID', $arg);
$refs = $banana->nntp->xhdr('References', $arg);
- if (is_array($this->ids)) {
+ if (is_array(@$this->ids)) {
$this->ids = array_merge($this->ids, array_flip($msgids));
} else {
$this->ids = array_flip($msgids);
foreach ($msgids as $id=>$msgid) {
$msg = new BananaSpoolHead($dates[$id], $subjects[$id], $froms[$id]);
- if (isset($ref[$id])) {
- $refs[$id] = str_replace('><', '> <', $refs[$id]);
- $msgrefs = preg_split("/[ \t]/", strtr($refs[$id], $this->ids));
- $parents = preg_grep('/^\d+$/', $msgrefs);
- $msg->parent = array_pop($parents);
- $msg->parent_direct = preg_match('/^\d+$/', array_pop($msgrefs));
- } else {
- $msg->parent = null;
- $msg->parent_direct = null;
- }
+ $refs[$id] = str_replace('><', '> <', @$refs[$id]);
+ $msgrefs = preg_split("/[ \t]/", strtr($refs[$id], $this->ids));
+ $parents = preg_grep('/^\d+$/', $msgrefs);
+ $msg->parent = array_pop($parents);
+ $msg->parent_direct = preg_match('/^\d+$/', array_pop($msgrefs));
if (isset($this->overview[$id])) {
$msg->desc = $this->overview[$id]->desc;