22283f94b741a330d9c42163a83599ddef1eb223
2 /********************************************************************************
3 * article.php : article page
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
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");
21 $profile=getprofile();
22 require($profile['locale']);
24 require("include/header.inc.php");
26 if (isset($_REQUEST['group'])) {
27 $group=htmlentities(strtolower($_REQUEST['group']));
29 if (isset($_REQUEST['id'])) {
30 $id=htmlentities(strtolower($_REQUEST['id']));
33 $mynntp = new nntp($news['server']);
35 echo "<p class=\"error\">\n\t".$locale['error']['connect']."\n</p>";
36 require("include/footer.inc.php");
40 if ($news['user']!="anonymous") {
41 $result = $mynntp->authinfo($news["user"],$news["pass"]);
43 echo "<p class=\"error\">\n\tYou have provided bad credentials to "
44 ."the server. Good bye !\n</p>";
45 require("include/footer.inc.php");
49 $spool = new spool($mynntp,$group,$profile['display'],$profile['lastnews']);
51 echo "<p class=\"error\">\n\tError while accessing group.\n</p>";
52 require("include/footer.inc.php");
55 $mynntp->group($group);
57 $post = new post($mynntp,$id);
59 if ($mynntp->lasterrorcode
== "423") {
62 echo "<p class=\"error\">\n\tError while reading message.\n</p>";
63 require("include/footer.inc.php");
67 $ndx = $spool->getndx($id);
70 <div
class="<?php echo $css['title']?>">
71 <?php
echo $locale['article']['message'];?
>
75 if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->headers
))) {
77 <p
class="<?php echo $css['error']?>">
78 <?php
echo $locale['article']['cancel'];?
>
79 <form action
="thread.php" method
="post">
80 <input type
="hidden" name
="group" value
="<?php echo $group;?>" />
81 <input type
="hidden" name
="id" value
="<?php
83 <input type
="hidden" name
="type" value
="cancel" />
84 <input type
="submit" name
="action" value
="<?php echo
85 $locale['article']['okbtn'];?>" />
94 <table
class="<?php echo $css['bicol']?>" cellpadding
="0" cellspacing
="0"
95 summary
="<?php echo $locale['article']['summary'];?>">
98 <?php
echo $locale['article']['headers'];?
>
102 foreach ($news['headdisp'] as $nick => $real) {
103 if (isset($post->headers
->$nick))
104 echo "<tr><td class=\"{$css['bicoltitre']}\">$real</td>"
105 ."<td>".formatdisplayheader($nick,$post->headers
->$nick,$spool)
111 <?php
echo $locale['article']['body'];?
>
116 <pre
><?php
echo formatbody($post->body
); ?
></pre
>
121 <?php
echo $locale['article']['overview'];?
>
125 <td
class="<?php echo $css['nopadd']?>" colspan
="2">
126 <table
class="<?php echo $css['overview']?>" cellpadding
="0"
127 cellspacing
="0" summary
="overview">
129 $spool->disp($ndx-$news['threadtop'],$ndx+
$news['threadbottom'],$ndx);
138 require("include/footer.inc.php");