2020-11-29 01:55:31 +01:00
|
|
|
<?php
|
|
|
|
session_start();
|
|
|
|
|
|
|
|
header("Expires: ".gmdate("D, d M Y H:i:s",time()+(3600*24))." GMT");
|
|
|
|
header("Cache-Control: max-age=100");
|
|
|
|
header("Pragma: cache");
|
|
|
|
|
|
|
|
include "config.inc.php";
|
|
|
|
include "auth.inc";
|
|
|
|
include "$file_newsportal";
|
|
|
|
|
2021-06-18 12:10:34 +02:00
|
|
|
$logfile=$logdir.'/newsportal.log';
|
|
|
|
throttle_hits();
|
2022-02-09 06:51:20 +01:00
|
|
|
write_access_log();
|
2022-01-12 00:19:54 +01:00
|
|
|
if(isset($_COOKIE['mail_name'])) {
|
2022-01-20 05:05:06 +01:00
|
|
|
if($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
|
|
|
|
$userfile=$spooldir.'/'.strtolower($_COOKIE['mail_name']).'-articleviews.dat';
|
|
|
|
}
|
2022-01-12 00:19:54 +01:00
|
|
|
}
|
2020-11-29 01:55:31 +01:00
|
|
|
// register parameters
|
|
|
|
$id=$_REQUEST["id"];
|
|
|
|
$group=_rawurldecode($_REQUEST["group"]);
|
2021-04-02 08:23:14 +02:00
|
|
|
|
|
|
|
$findsection = get_section_by_group($group);
|
|
|
|
if(trim($findsection) !== $config_name) {
|
|
|
|
$newurl = preg_replace("|/$config_name/|", "/$findsection/", $_SERVER['REQUEST_URI']);
|
|
|
|
header("Location: $newurl");
|
|
|
|
die();
|
|
|
|
}
|
2022-01-12 00:19:54 +01:00
|
|
|
|
2021-08-01 13:23:35 +02:00
|
|
|
if(strpos($id, '@') !== false) {
|
|
|
|
if($CONFIG['article_database'] == '1') {
|
2021-08-03 08:49:16 +02:00
|
|
|
$database = $spooldir.'/articles-overview.db3';
|
|
|
|
$articles_dbh = rslight_db_open($database);
|
2021-12-18 23:01:11 +01:00
|
|
|
$articles_query = $articles_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid');
|
|
|
|
$articles_query->execute(['messageid' => $id]);
|
2021-08-01 13:40:23 +02:00
|
|
|
$found = 0;
|
2021-08-01 13:23:35 +02:00
|
|
|
while ($row = $articles_query->fetch()) {
|
|
|
|
$id = $row['number'];
|
2021-12-18 23:01:11 +01:00
|
|
|
$group = $row['newsgroup'];
|
2021-08-01 13:40:23 +02:00
|
|
|
$found = 1;
|
2021-08-01 13:23:35 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
$dbh = null;
|
2021-08-01 13:40:23 +02:00
|
|
|
if($found) {
|
|
|
|
$newurl = 'article-flat.php?id='.$id.'&group='.$group.'#'.$id;
|
|
|
|
header("Location: $newurl");
|
|
|
|
die();
|
|
|
|
}
|
2021-08-01 13:23:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-29 01:55:31 +01:00
|
|
|
if(isset($_REQUEST["first"]))
|
|
|
|
$first=$_REQUEST["first"];
|
|
|
|
|
2021-05-03 11:11:37 +02:00
|
|
|
$_SESSION['rsactive'] = true;
|
|
|
|
|
2021-04-17 03:23:13 +02:00
|
|
|
$location = $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_STRING'];
|
2021-06-17 09:00:12 +02:00
|
|
|
$_SESSION['return_page'] = $location.'#'.$id;
|
2021-04-17 03:23:13 +02:00
|
|
|
|
2022-02-09 06:51:20 +01:00
|
|
|
// file_put_contents($accessfile, "\n".format_log_date()." ".$config_name." ".$group.":".$id, FILE_APPEND);
|
2022-01-20 09:00:49 +01:00
|
|
|
if($userdata) {
|
2022-01-12 00:19:54 +01:00
|
|
|
$userdata[$group] = time();
|
|
|
|
file_put_contents($userfile, serialize($userdata));
|
|
|
|
}
|
|
|
|
|
2020-11-29 01:55:31 +01:00
|
|
|
if(isset($frames_on) && $frames_on === true) {
|
|
|
|
?>
|
|
|
|
<script>
|
|
|
|
var contentURL=window.location.pathname+window.location.search+window.location.hash;
|
|
|
|
if ( window.self !== window.top ) {
|
|
|
|
/* Great! now we move along */
|
|
|
|
} else {
|
|
|
|
window.location.href = '../index.php?content='+encodeURIComponent(contentURL);
|
|
|
|
}
|
|
|
|
top.history.replaceState({}, 'Title', 'index.php?content='+encodeURIComponent(contentURL));
|
|
|
|
</script>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
$message=message_read($id,0,$group);
|
|
|
|
|
|
|
|
if (!$message) {
|
|
|
|
header ("HTTP/1.0 404 Not Found");
|
|
|
|
$subject=$title;
|
|
|
|
$title.=' - Article not found';
|
|
|
|
if($ns!=false)
|
|
|
|
nntp_close($ns);
|
|
|
|
} else {
|
|
|
|
$subject=htmlspecialchars($message->header->subject);
|
|
|
|
header("Last-Modified: ".date("r", $message->header->date));
|
|
|
|
$title.= ' - '.$group.' - '.$subject;
|
|
|
|
}
|
|
|
|
include "head.inc";
|
|
|
|
echo '<h1 class="np_thread_headline">';
|
|
|
|
echo '<a href="'.$file_index.'" target='.$frame['menu'].'>'.basename(getcwd()).'</a> / ';
|
|
|
|
echo '<a href="'.$file_thread.'?group='.rawurlencode($group).'" target='.$frame["content"].'>'.htmlspecialchars(group_display_name($group)).'</a> / '.$subject.'</h1>';
|
|
|
|
|
2021-12-31 10:41:53 +01:00
|
|
|
if(!$message) {
|
|
|
|
echo "Article not found";
|
|
|
|
include "tail.inc";
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2020-11-29 01:55:31 +01:00
|
|
|
if($message) {
|
|
|
|
// load thread-data and get IDs of the actual subthread
|
|
|
|
$thread=thread_load($group);
|
|
|
|
$subthread=thread_getsubthreadids($message->header->id,$thread);
|
|
|
|
if($thread_articles == false) {
|
|
|
|
sort($subthread);
|
|
|
|
}
|
|
|
|
// If no page is set, lets look, if we can calculate the page by
|
|
|
|
// the message-number
|
|
|
|
if(!isset($first)) {
|
|
|
|
$first=intval(array_search($id,$subthread)/$articleflat_articles_per_page)*
|
|
|
|
$articleflat_articles_per_page+1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// which articles are exactly on this page?
|
|
|
|
$pageids=array();
|
|
|
|
for($i=$first-1; (($i<count($subthread)) &&
|
|
|
|
($i<$first+$articleflat_articles_per_page-1)); $i++) {
|
|
|
|
$pageids[]=$subthread[$i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// display the thread on top
|
|
|
|
// change some of the default threadstyle-values
|
|
|
|
$thread_show["replies"]=true;
|
|
|
|
$thread_show["threadsize"]=false;
|
|
|
|
$thread_show["lastdate"]=false;
|
|
|
|
$thread_show["latest"]=false;
|
|
|
|
$thread_show["author"]=true;
|
|
|
|
//message_thread($message->header->id,$group,$thread,$pageids);
|
|
|
|
message_thread($message->header->id,$group,$thread,false);
|
|
|
|
echo '<br>';
|
|
|
|
echo '<a name="start"></a>';
|
|
|
|
// navigation line
|
|
|
|
echo '<table cellpadding="0" cellspacing="0" width="100%" class="np_buttonbar"><tr>';
|
|
|
|
// Article List button
|
|
|
|
echo '<td>';
|
|
|
|
echo '<form action="'.$file_thread.'">';
|
|
|
|
echo '<input type="hidden" name="group" value="'.rawurlencode($group).'"/>';
|
|
|
|
echo '<button class="np_button_link" type="submit">'.htmlspecialchars(group_display_name($group)).'</button>';
|
|
|
|
echo '</form>';
|
|
|
|
echo '</td>';
|
|
|
|
// Pages
|
|
|
|
echo '<td class="np_pages" width="100%" align="right">';
|
|
|
|
echo articleflat_pageselect($group,$id,count($subthread),$first);
|
|
|
|
echo '</td></tr></table>';
|
|
|
|
foreach($pageids as $subid) {
|
|
|
|
flush();
|
|
|
|
$message=message_read($subid,0,$group);
|
|
|
|
echo '<a name="'.$subid.'"> </a>';
|
|
|
|
message_show($group,$subid,0,$message,$articleflat_chars_per_articles);
|
|
|
|
if ((!$CONFIG['readonly']) && ($message)) {
|
|
|
|
echo '<form action="'.$file_post.'">'.
|
|
|
|
'<input type="hidden" name="id" value="'.urlencode($subid).'">'.
|
|
|
|
'<input type="hidden" name="type" value="reply">'.
|
|
|
|
'<input type="hidden" name="group" value="'.urlencode($group).'">'.
|
|
|
|
'<input type="submit" value="'.$text_article["button_answer"].
|
|
|
|
'">'.
|
|
|
|
'</form>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// navigation line
|
|
|
|
echo '<table cellpadding="0" cellspacing="0" width="100%" class="np_buttonbar"><tr>';
|
|
|
|
// Article List button
|
|
|
|
echo '<td>';
|
|
|
|
echo '<form action="'.$file_thread.'">';
|
|
|
|
echo '<input type="hidden" name="group" value="'.rawurlencode($group).'"/>';
|
|
|
|
echo '<button class="np_button_link" type="submit">'.htmlspecialchars(group_display_name($group)).'</button>';
|
|
|
|
echo '</form>';
|
|
|
|
echo '</td>';
|
|
|
|
// Pages
|
|
|
|
echo '<td class="np_pages" width="100%" align="right">';
|
|
|
|
echo articleflat_pageselect($group,$id,count($subthread),$first);
|
|
|
|
echo '</td></tr></table>';
|
|
|
|
}
|
|
|
|
include "tail.inc";
|
|
|
|
?>
|