# PHP News Reader # Copyright (C) 2001-2003 Shen Chang-Da # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. include('utils.inc.php'); $title .= " - $strReplyDetail"; # ------------------------------------------------------------------- $artnum = $_GET['artnum']; if( $_POST['content'] != '' ) { $server = $_POST['server']; $group = $_POST['group']; if( verifying( $server, $group ) == -1 ) session_error( $server, $group ); if( $post_restriction ) readonly_error( $server, $group ); $email = $_POST['email']; $refid = $_POST['refid']; $authormail = $_POST['authormail']; if( $auto_slash ) { $nickname = stripslashes($_POST['nickname']); $content = stripslashes($_POST['content']); $subject = stripslashes($_POST['subject']); } else { $nickname = $_POST['nickname']; $content = $_POST['content']; $subject = $_POST['subject']; } $artconv = get_conversion( $_POST['charset'], $curr_charset ); $nhd = nnrp_open( $server ); if( ! ( $nhd && nnrp_authenticate( $nhd ) ) ) { html_head('ERROR'); echo "
$strConnectServerError - " . $server . " $strConnectServerError - " . $server . "
\n";
html_foot();
html_tail();
exit;
}
if( ! $onlymail ) {
if( $artconv['back'] ) {
nnrp_post_begin( $nhd, $artconv['back']($nickname), $email, $artconv['back']($subject), $group, $artconv['back']($organization), $refid, $auth_email, $_POST['charset'] );
nnrp_post_write( $nhd, $artconv['back']($content) );
if( $CFG['post_signature'] )
nnrp_post_write( $nhd, $artconv['back']($CFG['post_signature']) );
}
else {
nnrp_post_begin( $nhd, $nickname, $email, $subject, $group, $organization, $refid, $auth_email, $_POST['charset'] );
nnrp_post_write( $nhd, $content );
if( $CFG['post_signature'] )
nnrp_post_write( $nhd, $CFG['post_signature'] );
}
nnrp_post_finish( $nhd );
nnrp_close($nhd);
}
html_head( "$group - $subject" );
$time = strftime($CFG['time_format']);
if( !$post_restriction && $replymail ) {
$mime_headers = "Mime-Version: 1.0\nContent-Type: text/plain; charset=\"" . $_POST['charset'] . "\"\nContent-Transfer-Encoding: 8bit\n";
if( $artconv['back'] )
mail( $authormail, $artconv['back']($subject), $artconv['back']($content), "From: $email\n$mail_add_header\n$mime_headers" );
else
mail( $authormail, $subject, $content, "From: $email\n$mail_add_header" );
}
$subject = htmlspecialchars( $subject );
echo <<$strArticlePosted
$strAuthor: $nickname ($email) $strTime: $time $strSubject: $subject $strGroup: $group
EOT;
echo '' . htmlspecialchars($content, ENT_NOQUOTES ) . "
\n";
echo "
\n";
html_delay_close( 2000 );
html_tail();
}
elseif( $artnum != '' ) {
$server = $_GET['server'];
$group = $_GET['group'];
# echo "server[$server] group[$group]
\n";
if( verifying( $server, $group ) == -1 )
session_error( $server, $group );
if( $post_restriction )
readonly_error( $server, $group );
$nhd = nnrp_open( $server );
if( ! ( $nhd && nnrp_authenticate( $nhd ) ) ) {
html_head('ERROR');
echo "
\n";
html_foot();
html_tail();
exit;
}
list( $code, $count, $lowmark, $highmark ) = nnrp_group( $nhd, $group );
$artinfo = nnrp_head( $nhd, $artnum, $news_charset[$curr_catalog] );
if( !$artinfo )
kill_myself();
$artconv = get_conversion( $artinfo['charset'], $curr_charset );
if( $artconv['to'] ) {
$from = $artconv['to']( $artinfo['name'] );
$email = $artconv['to']( $artinfo['mail'] );
$subject = $artconv['to']( $artinfo['subject'] );
$org = $artconv['to']( $artinfo['org'] );
}
else {
$from = $artinfo['name'];
$email = $artinfo['mail'];
$subject = $artinfo['subject'];
$org = $artinfo['org'];
}
$date = $artinfo['date'];
$msgid = $artinfo['msgid'];
if( !preg_match( '/^Re: /i', $subject ) )
$subject = 'Re: ' . $subject ;
html_head( "$group - $subject" );
?>
# $subject = str_replace( '"', '\"', $subject );
echo "