Give user option to reply to Followup-To or original groups.

This commit is contained in:
Retro_Guy 2024-02-29 11:37:59 -07:00
parent ac845dfed3
commit 1cb7f1068f
3 changed files with 31 additions and 4 deletions

View File

@ -497,7 +497,7 @@ function show_header($head, $group, $local_poster = false)
function show_header_short($head, $group, $local_poster = false)
{
global $article_show, $text_header, $file_article, $file_thread, $attachment_show;
global $file_attachment, $anonym_address, $CONFIG;
global $file_attachment, $anonym_address, $CONFIG, $config_name;
if (isset($_COOKIE['tzo'])) {
$offset = $_COOKIE['tzo'];
} else {
@ -535,18 +535,22 @@ function show_header_short($head, $group, $local_poster = false)
&nbsp;<a href="#" onclick="CopyToClipboard('<?php echo $head->id; ?>');return false;" style="text-decoration: none" title="Copy message-id to clipboard"><i>copy mid</i></a>
<?php
echo '&nbsp;&nbsp;Newsgroups: ';
$ngroups = preg_replace("/\,|\ /", "\t", $head->newsgroups);
$ngroups = explode("\t", $ngroups);
echo "&nbsp;";
// echo "&nbsp;";
foreach ($ngroups as $onegroup) {
if ($s = get_section_by_group($onegroup)) {
echo '<a href="' . $file_thread . '?group=' . urlencode($onegroup) . '"> ' . $onegroup . " </a>";
echo '<a href="' . $file_thread . '?group=' . urlencode($onegroup) . '" title="Visit ' . $onegroup . '"> ' . $onegroup . " </a>";
} else {
echo " ".$onegroup." ";
}
}
echo "<br />";
if (isset($head->followup) && ($article_show["Followup"]) && ($head->followup != "")) {
echo $text_header["followup"] . htmlspecialchars($head->followup) . "<br>\n";
}
if ($article_show["trigger_headers"]) {
echo '<input type="checkbox" class="np_header_button_checkbox" id="trigger_headers" title="Show headers" />';
echo '<div class="display_headers_on">' . display_full_headers($head->number, $group, $head->name, $head->from) . '</div>';

View File

@ -1398,7 +1398,7 @@ function create_name_link($name, $data = null)
if ((strpos($name, '...@') !== false && (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true)) && ! $data) {
$return = '<span class="visited">' . substr(htmlspecialchars($name), 0, 20) . '</span>';
} else {
$return = '<a href="search.php?command=search&searchpoint=Poster&terms=' . $name . '&data=' . $data . '"><span class="visited">' . substr(htmlspecialchars($name), 0, 20) . '</span></a>';
$return = '<a href="search.php?command=search&searchpoint=Poster&terms=' . $name . '&data=' . $data . '" title="Search by user"><span class="visited">' . substr(htmlspecialchars($name), 0, 20) . '</span></a>';
}
return ($return);
}

View File

@ -93,6 +93,12 @@ if (disable_page_by_user_agent($client_device, "bot", "Post")) {
global $synchro_user, $synchro_pass;
// check to which groups the user is allowed to post to
$thisgroup = _rawurldecode($_REQUEST['group']);
// Is this a reply to an article containing Followup-To?
if(isset($_REQUEST['fgroups'])) {
$thisgroup = $_REQUEST['fgroups'];
}
$newsgroups = $thisgroup;
if ($_REQUEST['returngroup']) {
$returngroup = $_REQUEST['returngroup'];
@ -324,8 +330,11 @@ if ($type == "reply") {
}
}
$subject = $head->subject;
// Offer choice of whether to use Followup-To
$has_followup = false;
if (isset($head->followup) && ($head->followup != "")) {
$newsgroups = $head->followup;
$has_followup = $head->newsgroups;
} else {
$newsgroups = $head->newsgroups;
}
@ -373,6 +382,20 @@ if ($show == 1) {
echo 'value="' . htmlspecialchars($subject) . '" ';
echo 'size="40" maxlength="' . $thread_maxSubject . '"></td>';
echo '</tr><tr>';
if($has_followup) {
echo '<td align="right">';
echo '<input type="radio" id="hasfollowup" name="fgroups" value="' . $head->followup . '" checked>';
echo '</td><td>';
echo '<label for="followup">' . $head->followup . ' (followup-to is set)</label></td>';
echo '</tr><tr>';
echo '<tr><td align="right">';
echo '<input type="radio" id="nofollowup" name="fgroups" value="' . $head->newsgroups . '">';
echo '</td><td>';
echo '<label for="newsgroups">' . $head->newsgroups . '</label>';
echo '</tr><tr>';
}
echo '<td align="right"><b>' . $text_post["name"] . '</b></td>';
echo '<td align="left">';
if (! isset($name) && $CONFIG['anonuser'])