More stuff ?
[mspang/www.git] / newsgroup / article.php
1 <?
2   header("Expires: ".gmdate("D, d M Y H:i:s",time()+(3600*24))." GMT");
3
4
5   // register parameters
6   $id=$_REQUEST["id"];
7   $group=$_REQUEST["group"];
8
9   include "config.inc.php";
10
11   /*
12   $thread_show["replies"]=true;
13   $thread_show["lastdate"]=false;
14   $thread_show["threadsize"]=false;
15   */
16
17   include "auth.inc";
18   include "$file_newsportal";
19
20   $message=message_read($id,0,$group);
21   if (!$message) {
22     header ("HTTP/1.0 404 Not Found");
23     $subject=$title;
24     $title.=' - Article not found';
25     if($ns!=false)
26     nntp_close($ns);
27   } else {
28     $subject=htmlspecialchars($message->header->subject);
29     header("Last-Modified: ".date("r", $message->header->date));
30     $title.= ' - '.$subject;
31   }
32   include "head.inc";
33
34   // has the user read-rights on this article?
35   if((function_exists("npreg_group_has_read_access") &&
36       !npreg_group_has_read_access($group)) ||
37      (function_exists("npreg_group_is_visible") &&
38       !npreg_group_is_visible($group))) {
39     die("access denied");
40   }
41
42
43 ?>
44
45
46
47 <h1 class="np_article_headline"><?=htmlspecialchars($subject) ?></h1>
48
49 <table cellpadding="0" cellspacing="0" width="100%" class="np_buttonbar"><tr>
50 <? 
51   echo '<td class="np_button"><a class="np_button" href="'.
52        $file_index.'">'.$text_thread["button_grouplist"].'</a></td>';
53   echo '<td class="np_button"><a class="np_button" href="'.
54        $file_thread.'?group='.urlencode($group).'">'.$text_article["back_to_group"].'</a></td>';
55   if ((!$readonly) && ($message) &&
56       (!function_exists("npreg_group_has_write_access") ||
57              npreg_group_has_write_access($group)))
58     echo '<td class="np_button"> <a class="np_button" href="'.
59          $file_post.'?type=reply&id='.urlencode($id).
60          '&group='.urlencode($group).'">'.$text_article["button_answer"].
61          '</a></td>';
62
63    if(function_exists(npreg_user_is_moderator) && npreg_user_is_moderator($group)) {
64      echo '<td class="np_button"><a class="np_button" href="'.$file_cancel.'?type=reply&id='.urlencode($id).
65           '&group='.urlencode($group).'">'.$text_article["button_cancel"].'</a></td>';
66     }
67
68 ?>
69 <td width="100%">&nbsp;</td></tr></table>
70
71 <? 
72   if (!$message)
73     // article not found
74     echo $text_error["article_not_found"];
75   else {
76     if($article_showthread)
77       $thread=thread_cache_load($group);
78     //echo "<br>";
79     message_show($group,$id,0,$message);
80     if($article_showthread)
81       message_thread($message->header->id,$group,$thread); 
82
83   }
84   include "tail.inc";
85 ?>