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 | |
0d407ce1 |
10 | require_once("include/session.inc.php"); |
cced14b6 |
11 | require_once("include/misc.inc.php"); |
0d407ce1 |
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/spool.inc.php"); |
16 | require_once("include/post.inc.php"); |
17 | require_once("include/profile.inc.php"); |
18 | require_once("include/password.inc.php"); |
19 | require_once("include/error.inc.php"); |
90962c86 |
20 | |
e2cae7e3 |
21 | $profile = getprofile(); |
0d407ce1 |
22 | require_once("include/header.inc.php"); |
90962c86 |
23 | |
84ca00bc |
24 | if (isset($_REQUEST['group'])) { |
25 | $group=htmlentities(strtolower($_REQUEST['group'])); |
26 | } |
27 | if (isset($_REQUEST['id'])) { |
28 | $id=htmlentities(strtolower($_REQUEST['id'])); |
29 | } |
90962c86 |
30 | |
a3b667fe |
31 | $nntp = new nntp($news['server']); |
32 | if (!$nntp) error("nntpsock"); |
90962c86 |
33 | if ($news['user']!="anonymous") { |
a3b667fe |
34 | $result = $nntp->authinfo($news["user"],$news["pass"]); |
66583932 |
35 | if (!$result) error("nntpauth"); |
90962c86 |
36 | } |
a3b667fe |
37 | $spool = new spool($nntp,$group,$profile['display'],$profile['lastnews']); |
38 | if (!$spool) error("nntpspool"); |
39 | $nntp->group($group); |
90962c86 |
40 | |
579d24a9 |
41 | $post = new NNTPPost($nntp,$id); |
90962c86 |
42 | if (!$post) { |
a3b667fe |
43 | if ($nntp->lasterrorcode == "423") { |
84ca00bc |
44 | $spool->delid($id); |
90962c86 |
45 | } |
a3b667fe |
46 | error("nntpart"); |
90962c86 |
47 | } |
48 | |
84ca00bc |
49 | $ndx = $spool->getndx($id); |
90962c86 |
50 | |
51 | ?> |
40e27a11 |
52 | <h1> |
0a65ec9d |
53 | <?php echo _b_('Message'); ?> |
40e27a11 |
54 | </h1> |
90962c86 |
55 | |
56 | <?php |
5c33c608 |
57 | if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->headers))) { |
90962c86 |
58 | ?> |
84ca00bc |
59 | <p class="<?php echo $css['error']?>"> |
0a65ec9d |
60 | <?php echo _b_('Voulez-vous vraiment annuler ce message ?'); ?> |
90962c86 |
61 | </p> |
641bfc1e |
62 | <form action="thread.php" method="post"> |
63 | <input type="hidden" name="group" value="<?php echo $group;?>" /> |
64 | <input type="hidden" name="id" value="<?php |
65 | echo $id;?>" /> |
66 | <input type="hidden" name="type" value="cancel" /> |
0a65ec9d |
67 | <input type="submit" name="action" value="<?php echo _b_('OK'); ?>" /> |
641bfc1e |
68 | </form> |
90962c86 |
69 | <? |
70 | } |
71 | |
72 | displayshortcuts(); |
73 | ?> |
74 | |
84ca00bc |
75 | <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" |
0a65ec9d |
76 | summary="<?php echo _b_('Contenu du message'); ?>"> |
90962c86 |
77 | <tr> |
78 | <th colspan="2"> |
0a65ec9d |
79 | <?php echo _b_('En-têtes'); ?> |
90962c86 |
80 | </th> |
81 | </tr> |
82 | <?php |
23148be4 |
83 | foreach ($news['headdisp'] as $nick) { |
90962c86 |
84 | if (isset($post->headers->$nick)) |
e2cae7e3 |
85 | echo "<tr><td class=\"{$css['bicoltitre']}\">".header_translate($nick)."</td>" |
90962c86 |
86 | ."<td>".formatdisplayheader($nick,$post->headers->$nick,$spool) |
87 | ."</td></tr>\n"; |
88 | } |
89 | ?> |
90 | <tr> |
91 | <th colspan="2"> |
0a65ec9d |
92 | <?php echo _b_('Corps'); ?> |
90962c86 |
93 | </th> |
94 | </tr> |
95 | <tr> |
96 | <td colspan="2"> |
97 | <pre><?php echo formatbody($post->body); ?></pre> |
98 | </td> |
99 | </tr> |
100 | <tr> |
101 | <th colspan="2"> |
0a65ec9d |
102 | <?php echo _b_('Aperçu'); ?> |
90962c86 |
103 | </th> |
104 | </tr> |
105 | <tr> |
84ca00bc |
106 | <td class="<?php echo $css['nopadd']?>" colspan="2"> |
107 | <table class="<?php echo $css['overview']?>" cellpadding="0" |
108 | cellspacing="0" summary="overview"> |
90962c86 |
109 | <?php |
110 | $spool->disp($ndx-$news['threadtop'],$ndx+$news['threadbottom'],$ndx); |
111 | ?> |
112 | </table> |
113 | </td> |
114 | </tr> |
115 | </table> |
116 | <?php |
117 | displayshortcuts(); |
118 | |
0d407ce1 |
119 | require_once("include/footer.inc.php"); |
90962c86 |
120 | ?> |