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("locales/locales.inc.php");
11 require("include/session.inc.php");
12 require("include/encoding.inc.php");
13 require("include/format.inc.php");
14 require("include/config.inc.php");
15 require("include/NetNNTP.inc.php");
16 include("include/post.inc.php");
17 require("include/spool.inc.php");
18 require("include/password.inc.php");
19 require("include/profile.inc.php");
20 include("include/wrapper.inc.php");
22 require("include/header.inc.php");
24 $profile = getprofile();
26 if (isset($_REQUEST['group'])) {
27 $group=htmlentities(strtolower($_REQUEST['group']));
29 $group=htmlentities(strtolower(strtok(str_replace(" ","",$_REQUEST['newsgroups']),",")));
31 $id=htmlentities(strtolower($_REQUEST['id']));
33 //$mynntp = new nntp($news['server'],120,1);
34 $mynntp = new nntp($news['server']);
36 echo "<p class=\"error\">\n\t".$locale['error']['connect']."\n</p>";
37 require("include/footer.inc.php");
41 if ($news['user']!="anonymous") {
42 $result = $mynntp->authinfo($news["user"],$news["pass"]);
44 echo "<p class=\"error\">\n\t".$locale['error']['credentials']
46 require("include/footer.inc.php");
50 $spool = new spool($mynntp,$group,$profile['display'],
51 $profile['lastnews']);
53 echo "<p class=\"error\">\n\t".$locale['error']['group']."\n</p>";
54 require("footer.inc.php");
58 if ($_REQUEST['first']>sizeof($spool->overview
))
59 $_REQUEST['first']=sizeof($spool->overview
);
60 $first = (isset($_REQUEST['first'])?
61 (floor($_REQUEST['first']/$max)*$max+
1):1);
62 $last = (isset($_REQUEST['first'])?
63 (floor($_REQUEST['first']/$max+
1)*$max):$max);
65 if (isset($_REQUEST['action']) && (isset($_REQUEST['type']))) {
66 switch ($_REQUEST['type']) {
68 $mid = array_search($id,$spool->ids
);
69 $mynntp->group($group);
70 $post = new post($mynntp,$id);
72 if (checkcancel($post->headers
)) {
73 $message = 'From: '.$profile['name']."\n"
74 ."Newsgroups: $group\n"
75 ."Subject: cmsg $mid\n"
77 ."Control: cancel $mid\n"
79 ."Message canceled with Banana";
80 $result = $mynntp->post($message);
83 $text="<p class=\"normal\">".$locale['post']['canceled']
86 $text="<p class=\"error\">".$locale['post']['badcancel']
90 $text="<p class=\"error\">\n\t".$locale['post']['rghtcancel']
95 $message = 'From: '.$profile['name']."\n"
96 ."Newsgroups: ".stripslashes(str_replace(" ","",
97 $_REQUEST['newsgroups']))."\n"
98 ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
99 .($_REQUEST['followup']!=''?
'Followup-To: '
100 .stripslashes($_REQUEST['followup'])."\n":"")
103 .wrap(stripslashes($_REQUEST['body']),"",$news['wrap']);
104 $result = $mynntp->post($message);
106 $text="<p class=\"normal\">".$locale['post']['posted']."</p>";
108 $text="<p class=\"error\">".$locale['post']['badpost']."</p>";
112 $rq=$mynntp->group($group);
113 $post = new post($mynntp,$id);
115 $refs = $post->headers
->references
." ".$post->headers
->msgid
;
118 $message = 'From: '.$profile['name']."\n"
119 ."Newsgroups: ".stripslashes($_REQUEST['newsgroups'])."\n"
120 ."Subject: ".stripslashes($_REQUEST['subject'])."\n"
121 .($_REQUEST['followup']!=''?
'Followup-To: '
122 .stripslashes($_REQUEST['followup'])."\n":"")
123 ."References: $refs\n"
126 .wrap(stripslashes($_REQUEST['body']),"",$news['wrap']);
127 $result = $mynntp->post($message);
129 $text="<p class=\"normal\">".$locale['post']['posted']."</p>";
131 $text="<p class=\"error\">".$locale['post']['badpost']."</p>";
135 $spool = new spool($mynntp,$group,$profile['display'],
136 $profile['lastnews']);
138 echo "<p class=\"error\">\n\t".$locale['error']['group']."\n</p>";
139 require("include/footer.inc.php");
147 <?php
echo $locale['thread']['group_b'].$group
148 .$locale['thread']['group_a'];?
>
156 <table
class="bicol" cellpadding
="0" cellspacing
="0" border
="0"
157 summary
="<?php echo $locale['thread']['summary'];?>">
160 <?php
echo $locale['thread']['date'];?
>
163 <?php
echo $locale['thread']['subject'];?
>
166 <?php
echo $locale['thread']['author'];?
>
170 $spool->disp($first,$last);
176 require("include/footer.inc.php");