01ec8b32911dbba3358295e32ff4b3f2281c98fb
2 /********************************************************************************
3 * post.php : posting page
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 require("include/session.inc.php");
11 require("include/encoding.inc.php");
12 require("include/format.inc.php");
13 require("include/config.inc.php");
14 require("include/NetNNTP.inc.php");
15 require("include/post.inc.php");
16 require("include/spool.inc.php");
17 require("include/password.inc.php");
18 require("include/profile.inc.php");
19 require("include/wrapper.inc.php");
20 require("include/error.inc.php");
22 $profile = getprofile();
23 require($profile['locale']);
25 require("include/header.inc.php");
26 if (isset($_REQUEST['group'])) {
27 $group=htmlentities(strtolower($_REQUEST['group']));
29 if (isset($_REQUEST['id'])) {
30 $id=htmlentities(strtolower($_REQUEST['id']));
37 $nntp = new nntp($news['server']);
38 if (!$nntp) error("nntpsock");
39 if ($news['user']!="anonymous") {
40 $result = $nntp->authinfo($news["user"],$news["pass"]);
41 if (!$result) error("nntpauth");
44 if (isset($group) && isset($id) && isset($_REQUEST['type']) &&
45 ($_REQUEST['type']=='followup')) {
46 $rq=$nntp->group($group);
47 $post = new post($nntp,$id);
49 $subject = (preg_match("/^re:/i",$post->headers
->subject
)?
"":"Re: ")
50 .$post->headers
->subject
;
51 if ($profile['dropsig']) {
52 $cutoff=strpos($post->body
,"\n-- \n");
54 $quotetext = substr($post->body
,0,strpos($post->body
,"\n-- \n"));
56 $quotetext = $post->body
;
59 $quotetext = $post->body
;
61 $body = $post->headers
->name
." wrote :\n".wrap($quotetext, "> ");
62 if (isset($post->headers
->followup
))
63 $target=$post->headers
->followup
;
65 $target=$post->headers
->newsgroups
;
71 <div
class="<?php echo $css['title']?>">
72 <?php
echo $locale['post']['title'];?
>
80 <form action
="thread.php" method
="post">
81 <table
class="<?php echo $css['bicol']?>" cellpadding
="0" cellspacing
="0" border
="0">
84 <?php
echo $locale['post']['headers'];?
>
88 <td
class="<?php echo $css['bicoltitre'];?>">
89 <?php
echo $locale['post']['name'];?
>
92 <?php
echo htmlentities($profile['name']); ?
>
96 <td
class="<?php echo $css['bicoltitre'];?>">
97 <?php
echo $locale['post']['subject'];?
>
100 <input type
="text" name
="subject" value
="<?php echo
101 (isset($subject)?$subject:"");?>" />
105 <td
class="<?php echo $css['bicoltitre'];?>">
106 <?php
echo $locale['post']['newsgroups'];?
>
109 <input type
="text" name
="newsgroups" value
="<?php echo
110 (isset($target)?$target:"");?>" />
114 <td
class="<?php echo $css['bicoltitre'];?>">
115 <?php
echo $locale['post']['fu2'];?
>
118 <input type
="text" name
="followup" value
="" />
122 <td
class="<?php echo $css['bicoltitre'];?>">
123 <?php
echo $locale['post']['organization'];?
>
126 <?php
echo $profile['org']; ?
>
131 <?php
echo $locale['post']['body'];?
>
135 <td
class="<?php echo $css['bicolvpadd'];?>" colspan
="2">
136 <textarea name
="body" cols
="90" rows
="16"><?php
echo
137 (isset($body)?
htmlentities($body):"").
138 ($profile['sig']!=''?
"\n\n-- \n".htmlentities($profile['sig']):"");?
></textarea
>
142 <td
class="<?php echo $css['bouton']?>" colspan
="2">
144 if (isset($group) && isset($id) && isset($_REQUEST['type'])
145 && ($_REQUEST['type']=='followup')) {
147 <input type
="hidden" name
="type" value
="followupok" />
148 <input type
="hidden" name
="group" value
="<?php echo $group;?>" />
149 <input type
="hidden" name
="id" value
="<?php echo $id;?>" />
153 <input type
="hidden" name
="type" value
="new" />
157 <input type
="submit" name
="action" value
="OK" />
164 require("include/footer.inc.php");