90962c86 |
1 | <?php |
2 | /******************************************************************************** |
3 | * article.php : article page |
4 | * ------------- |
5 | * |
6 | * This file is part of the banana distribution |
7 | * Copyright: See COPYING files that comes with this distribution |
8 | ********************************************************************************/ |
9 | |
90962c86 |
10 | require("include/session.inc.php"); |
11 | require("include/encoding.inc.php"); |
12 | require("include/wrapper.inc.php"); |
13 | require("include/format.inc.php"); |
14 | require("include/config.inc.php"); |
15 | require("include/NetNNTP.inc.php"); |
16 | require("include/spool.inc.php"); |
17 | require("include/post.inc.php"); |
18 | require("include/profile.inc.php"); |
19 | require("include/password.inc.php"); |
a3b667fe |
20 | require("include/error.inc.php"); |
90962c86 |
21 | |
90962c86 |
22 | $profile=getprofile(); |
e2625e72 |
23 | require($profile['locale']); |
24 | |
25 | require("include/header.inc.php"); |
90962c86 |
26 | |
84ca00bc |
27 | if (isset($_REQUEST['group'])) { |
28 | $group=htmlentities(strtolower($_REQUEST['group'])); |
29 | } |
30 | if (isset($_REQUEST['id'])) { |
31 | $id=htmlentities(strtolower($_REQUEST['id'])); |
32 | } |
90962c86 |
33 | |
a3b667fe |
34 | $nntp = new nntp($news['server']); |
35 | if (!$nntp) error("nntpsock"); |
90962c86 |
36 | if ($news['user']!="anonymous") { |
a3b667fe |
37 | $result = $nntp->authinfo($news["user"],$news["pass"]); |
38 | if (!$result) erro("nntpauth"); |
90962c86 |
39 | } |
a3b667fe |
40 | $spool = new spool($nntp,$group,$profile['display'],$profile['lastnews']); |
41 | if (!$spool) error("nntpspool"); |
42 | $nntp->group($group); |
90962c86 |
43 | |
a3b667fe |
44 | $post = new post($nntp,$id); |
90962c86 |
45 | if (!$post) { |
a3b667fe |
46 | if ($nntp->lasterrorcode == "423") { |
84ca00bc |
47 | $spool->delid($id); |
90962c86 |
48 | } |
a3b667fe |
49 | error("nntpart"); |
90962c86 |
50 | } |
51 | |
84ca00bc |
52 | $ndx = $spool->getndx($id); |
90962c86 |
53 | |
54 | ?> |
84ca00bc |
55 | <div class="<?php echo $css['title']?>"> |
90962c86 |
56 | <?php echo $locale['article']['message'];?> |
57 | </div> |
58 | |
59 | <?php |
5c33c608 |
60 | if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->headers))) { |
90962c86 |
61 | ?> |
84ca00bc |
62 | <p class="<?php echo $css['error']?>"> |
90962c86 |
63 | <?php echo $locale['article']['cancel'];?> |
64 | <form action="thread.php" method="post"> |
65 | <input type="hidden" name="group" value="<?php echo $group;?>" /> |
66 | <input type="hidden" name="id" value="<?php |
84ca00bc |
67 | echo $id;?>" /> |
90962c86 |
68 | <input type="hidden" name="type" value="cancel" /> |
69 | <input type="submit" name="action" value="<?php echo |
70 | $locale['article']['okbtn'];?>" /> |
71 | </form> |
72 | </p> |
73 | <? |
74 | } |
75 | |
76 | displayshortcuts(); |
77 | ?> |
78 | |
84ca00bc |
79 | <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" |
90962c86 |
80 | summary="<?php echo $locale['article']['summary'];?>"> |
81 | <tr> |
82 | <th colspan="2"> |
83 | <?php echo $locale['article']['headers'];?> |
84 | </th> |
85 | </tr> |
86 | <?php |
819e5b3e |
87 | foreach ($news['headdisp'] as $nick => $real) { |
90962c86 |
88 | if (isset($post->headers->$nick)) |
84ca00bc |
89 | echo "<tr><td class=\"{$css['bicoltitre']}\">$real</td>" |
90962c86 |
90 | ."<td>".formatdisplayheader($nick,$post->headers->$nick,$spool) |
91 | ."</td></tr>\n"; |
92 | } |
93 | ?> |
94 | <tr> |
95 | <th colspan="2"> |
96 | <?php echo $locale['article']['body'];?> |
97 | </th> |
98 | </tr> |
99 | <tr> |
100 | <td colspan="2"> |
101 | <pre><?php echo formatbody($post->body); ?></pre> |
102 | </td> |
103 | </tr> |
104 | <tr> |
105 | <th colspan="2"> |
106 | <?php echo $locale['article']['overview'];?> |
107 | </th> |
108 | </tr> |
109 | <tr> |
84ca00bc |
110 | <td class="<?php echo $css['nopadd']?>" colspan="2"> |
111 | <table class="<?php echo $css['overview']?>" cellpadding="0" |
112 | cellspacing="0" summary="overview"> |
90962c86 |
113 | <?php |
114 | $spool->disp($ndx-$news['threadtop'],$ndx+$news['threadbottom'],$ndx); |
115 | ?> |
116 | </table> |
117 | </td> |
118 | </tr> |
119 | </table> |
120 | <?php |
121 | displayshortcuts(); |
122 | |
123 | require("include/footer.inc.php"); |
124 | ?> |