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