f37f60d82b8cdcb703e5735c6f8dbd8a8a1f5a61
2 /********************************************************************************
3 * thread.php : group overview
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 require_once("include/session.inc.php");
11 require_once("include/encoding.inc.php");
12 require_once("include/format.inc.php");
13 require_once("include/config.inc.php");
14 require_once("include/NetNNTP.inc.php");
15 require_once("include/post.inc.php");
16 require_once("include/spool.inc.php");
17 require_once("include/password.inc.php");
18 require_once("include/profile.inc.php");
19 require_once("include/wrapper.inc.php");
20 require_once("include/error.inc.php");
22 $profile=getprofile();
23 require_once($profile['locale']);
25 require_once("include/header.inc.php");
27 if (isset($_REQUEST['group'])) {
28 $group=htmlentities(strtolower($_REQUEST['group']));
30 $group=htmlentities(strtolower(strtok(str_replace(" ","",$_REQUEST['newsgroups']),",")));
33 if (isset($_REQUEST['id'])) {
34 $id=htmlentities(strtolower($_REQUEST['id']));
37 //$nntp = new nntp($news['server'],120,1);
38 $nntp = new nntp($news['server']);
39 if (!$nntp) error("nntpsock");
40 if ($news['user']!="anonymous") {
41 $result = $nntp->authinfo($news["user"],$news["pass"]);
42 if (!$result) error("nntpauth");
44 $spool = new spool($nntp,$group,$profile['display'],
45 $profile['lastnews']);
46 if (!$spool) error("nntpspool");
48 if (isset($_REQUEST['first']) && ($_REQUEST['first']>sizeof($spool->overview
)))
49 $_REQUEST['first']=sizeof($spool->overview
);
50 $first = (isset($_REQUEST['first'])?
51 (floor($_REQUEST['first']/$max)*$max+
1):1);
52 $last = (isset($_REQUEST['first'])?
53 (floor($_REQUEST['first']/$max+
1)*$max):$max);
55 if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
56 (isset($_SESSION['bananapostok'])) && ($_SESSION['bananapostok'])) {
57 switch ($_REQUEST['type']) {
59 $mid = array_search($id,$spool->ids
);
61 $post = new NNTPPost($nntp,$id);
63 if (checkcancel($post->headers
)) {
64 $message = 'From: '.$profile['name']."\n"
65 ."Newsgroups: $group\n"
66 ."Subject: cmsg $mid\n"
68 ."Control: cancel $mid\n"
70 ."Message canceled with Banana";
71 $result = $nntp->post($message);
74 $text="<p class=\"normal\">".$locale['post']['canceled']
77 $text="<p class=\"error\">".$locale['post']['badcancel']
81 $text="<p class=\"error\">\n\t".$locale['post']['rghtcancel']
86 $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body']));
87 $message = 'From: '.$profile['name']."\n"
88 ."Newsgroups: ".stripslashes(str_replace(" ","",
89 $_REQUEST['newsgroups']))."\n"
90 ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
91 .(isset($profile['org'])?
"Organization: ".$profile['org']."\n":"")
92 .($_REQUEST['followup']!=''?
'Followup-To: '
93 .stripslashes($_REQUEST['followup'])."\n":"")
96 .wrap($body,"",$news['wrap']);
97 $result = $nntp->post($message);
99 $text="<p class=\"normal\">".$locale['post']['posted']."</p>";
101 $text="<p class=\"error\">".$locale['post']['badpost']."</p>";
105 $rq=$nntp->group($group);
106 $post = new NNTPPost($nntp,$id);
108 $refs = (isset($post->headers
->references
)?
109 $post->headers
->references
." ":"").$post->headers
->msgid
;
112 $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body']));
113 $message = 'From: '.$profile['name']."\n"
114 ."Newsgroups: ".stripslashes($_REQUEST['newsgroups'])."\n"
115 ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
116 .(isset($profile['org'])?
"Organization: ".$profile['org']."\n":"")
117 .($_REQUEST['followup']!=''?
'Followup-To: '
118 .stripslashes($_REQUEST['followup'])."\n":"")
119 ."References: $refs\n"
121 .$profile['customhdr']
123 .wrap($body,"",$news['wrap']);
124 $result = $nntp->post($message);
126 $text="<p class=\"normal\">".$locale['post']['posted']."</p>";
128 $text="<p class=\"error\">".$locale['post']['badpost']."</p>";
132 $_SESSION['bananapostok']=false
;
133 $spool = new spool($nntp,$group,$profile['display'],
134 $profile['lastnews']);
135 if (!$spool) error("nntpspool");
141 <?php
echo $locale['thread']['group_b'].$group
142 .$locale['thread']['group_a'];?
>
152 <table
class="<?php echo $css['bicol']?>" cellpadding
="0" cellspacing
="0" border
="0"
153 summary
="<?php echo $locale['thread']['summary'];?>">
155 <th
class="<?php echo $css['date']?>">
156 <?php
echo $locale['thread']['date'];?
>
158 <th
class="<?php echo $css['subject']?>">
159 <?php
echo $locale['thread']['subject'];?
>
161 <th
class="<?php echo $css['from']?>">
162 <?php
echo $locale['thread']['author'];?
>
166 $spool->disp($first,$last);
172 require_once("include/footer.inc.php");