abade8576fb1080a7cbfbf3e173c23b54c2f0a08
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("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 include("include/post.inc.php");
16 require("include/spool.inc.php");
17 require("include/password.inc.php");
18 require("include/profile.inc.php");
19 include("include/wrapper.inc.php");
21 $profile=getprofile();
22 require($profile['locale']);
24 require("include/header.inc.php");
26 if (isset($_REQUEST['group'])) {
27 $group=htmlentities(strtolower($_REQUEST['group']));
29 $group=htmlentities(strtolower(strtok(str_replace(" ","",$_REQUEST['newsgroups']),",")));
32 if (isset($_REQUEST['id'])) {
33 $id=htmlentities(strtolower($_REQUEST['id']));
36 //$mynntp = new nntp($news['server'],120,1);
37 $mynntp = new nntp($news['server']);
39 echo "<p class=\"error\">\n\t".$locale['error']['connect']."\n</p>";
40 require("include/footer.inc.php");
44 if ($news['user']!="anonymous") {
45 $result = $mynntp->authinfo($news["user"],$news["pass"]);
47 echo "<p class=\"error\">\n\t".$locale['error']['credentials']
49 require("include/footer.inc.php");
53 $spool = new spool($mynntp,$group,$profile['display'],
54 $profile['lastnews']);
56 echo "<p class=\"error\">\n\t".$locale['error']['group']."\n</p>";
57 require("footer.inc.php");
61 if (isset($_REQUEST['first']) && ($_REQUEST['first']>sizeof($spool->overview
)))
62 $_REQUEST['first']=sizeof($spool->overview
);
63 $first = (isset($_REQUEST['first'])?
64 (floor($_REQUEST['first']/$max)*$max+
1):1);
65 $last = (isset($_REQUEST['first'])?
66 (floor($_REQUEST['first']/$max+
1)*$max):$max);
68 if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
69 (isset($_SESSION['bananapostok'])) && ($_SESSION['bananapostok'])) {
70 switch ($_REQUEST['type']) {
72 $mid = array_search($id,$spool->ids
);
73 $mynntp->group($group);
74 $post = new post($mynntp,$id);
76 if (checkcancel($post->headers
)) {
77 $message = 'From: '.$profile['name']."\n"
78 ."Newsgroups: $group\n"
79 ."Subject: cmsg $mid\n"
81 ."Control: cancel $mid\n"
83 ."Message canceled with Banana";
84 $result = $mynntp->post($message);
87 $text="<p class=\"normal\">".$locale['post']['canceled']
90 $text="<p class=\"error\">".$locale['post']['badcancel']
94 $text="<p class=\"error\">\n\t".$locale['post']['rghtcancel']
99 $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body']));
100 $message = 'From: '.$profile['name']."\n"
101 ."Newsgroups: ".stripslashes(str_replace(" ","",
102 $_REQUEST['newsgroups']))."\n"
103 ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
104 .(isset($profile['org'])?
"Organization: ".$profile['org']."\n":"")
105 .($_REQUEST['followup']!=''?
'Followup-To: '
106 .stripslashes($_REQUEST['followup'])."\n":"")
109 .wrap($body,"",$news['wrap']);
110 $result = $mynntp->post($message);
112 $text="<p class=\"normal\">".$locale['post']['posted']."</p>";
114 $text="<p class=\"error\">".$locale['post']['badpost']."</p>";
118 $rq=$mynntp->group($group);
119 $post = new post($mynntp,$id);
121 $refs = (isset($post->headers
->references
)?
122 $post->headers
->references
." ":"").$post->headers
->msgid
;
125 $body = preg_replace("/\n\.[ \t\r]*\n/m","\n..\n",stripslashes($_REQUEST['body']));
126 $message = 'From: '.$profile['name']."\n"
127 ."Newsgroups: ".stripslashes($_REQUEST['newsgroups'])."\n"
128 ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
129 .(isset($profile['org'])?
"Organization: ".$profile['org']."\n":"")
130 .($_REQUEST['followup']!=''?
'Followup-To: '
131 .stripslashes($_REQUEST['followup'])."\n":"")
132 ."References: $refs\n"
135 .wrap($body,"",$news['wrap']);
136 $result = $mynntp->post($message);
138 $text="<p class=\"normal\">".$locale['post']['posted']."</p>";
140 $text="<p class=\"error\">".$locale['post']['badpost']."</p>";
144 $_SESSION['bananapostok']=false
;
145 $spool = new spool($mynntp,$group,$profile['display'],
146 $profile['lastnews']);
148 echo "<p class=\"error\">\n\t".$locale['error']['group']."\n</p>";
149 require("include/footer.inc.php");
156 <div
class="<?php echo $css['title']?>">
157 <?php
echo $locale['thread']['group_b'].$group
158 .$locale['thread']['group_a'];?
>
168 <table
class="<?php echo $css['bicol']?>" cellpadding
="0" cellspacing
="0" border
="0"
169 summary
="<?php echo $locale['thread']['summary'];?>">
171 <th
class="<?php echo $css['date']?>">
172 <?php
echo $locale['thread']['date'];?
>
174 <th
class="<?php echo $css['subject']?>">
175 <?php
echo $locale['thread']['subject'];?
>
177 <th
class="<?php echo $css['from']?>">
178 <?php
echo $locale['thread']['author'];?
>
182 $spool->disp($first,$last);
188 require("include/footer.inc.php");