old header were to complicated for nothin. drop class Header, and treat it from Post
[banana.git] / article.php
... / ...
CommitLineData
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
10require_once("include/session.inc.php");
11require_once("include/misc.inc.php");
12require_once("include/format.inc.php");
13require_once("include/config.inc.php");
14require_once("include/NetNNTP.inc.php");
15require_once("include/spool.inc.php");
16require_once("include/post.inc.php");
17require_once("include/profile.inc.php");
18require_once("include/password.inc.php");
19require_once("include/error.inc.php");
20
21$profile = getprofile();
22require_once("include/header.inc.php");
23
24if (isset($_REQUEST['group'])) {
25 $group=htmlentities(strtolower($_REQUEST['group']));
26}
27if (isset($_REQUEST['id'])) {
28 $id=htmlentities(strtolower($_REQUEST['id']));
29}
30
31$nntp = new nntp($news['server']);
32if (!$nntp) error("nntpsock");
33if ($news['user']!="anonymous") {
34 $result = $nntp->authinfo($news["user"],$news["pass"]);
35 if (!$result) error("nntpauth");
36}
37$spool = new spool($nntp,$group,$profile['display'],$profile['lastnews']);
38if (!$spool) error("nntpspool");
39$nntp->group($group);
40
41$post = new NNTPPost($nntp,$id);
42if (!$post) {
43 if ($nntp->lasterrorcode == "423") {
44 $spool->delid($id);
45 }
46 error("nntpart");
47}
48
49$ndx = $spool->getndx($id);
50
51?>
52<h1>
53 <?php echo _b_('Message'); ?>
54</h1>
55
56<?php
57if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->headers))) {
58?>
59<p class="<?php echo $css['error']?>">
60 <?php echo _b_('Voulez-vous vraiment annuler ce message ?'); ?>
61</p>
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" />
67 <input type="submit" name="action" value="<?php echo _b_('OK'); ?>" />
68</form>
69<?
70}
71
72displayshortcuts();
73?>
74
75<table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0"
76summary="<?php echo _b_('Contenu du message'); ?>">
77 <tr>
78 <th colspan="2">
79 <?php echo _b_('En-têtes'); ?>
80 </th>
81 </tr>
82<?php
83foreach ($news['headdisp'] as $nick) {
84 if (isset($post->headers[$nick]))
85 echo "<tr><td class=\"{$css['bicoltitre']}\">".header_translate($nick)."</td>"
86 ."<td>".formatdisplayheader($nick,$post->headers[$nick],$spool)
87 ."</td></tr>\n";
88}
89?>
90 <tr>
91 <th colspan="2">
92 <?php echo _b_('Corps'); ?>
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">
102 <?php echo _b_('Aperçu'); ?>
103 </th>
104 </tr>
105 <tr>
106 <td class="<?php echo $css['nopadd']?>" colspan="2">
107 <table class="<?php echo $css['overview']?>" cellpadding="0"
108 cellspacing="0" summary="overview">
109<?php
110$spool->disp($ndx-$news['threadtop'],$ndx+$news['threadbottom'],$ndx);
111?>
112 </table>
113 </td>
114 </tr>
115</table>
116<?php
117displayshortcuts();
118
119require_once("include/footer.inc.php");
120?>