Fixes and improvements to search.

This commit is contained in:
Retro_Guy 2024-01-07 15:52:50 -07:00
parent c11338cf39
commit e3d63f6a75
3 changed files with 77 additions and 101 deletions

View File

@ -668,7 +668,7 @@ function groups_show($gruppen)
$new_style_off = '</i></b>';
$new = true;
}
$groupdisplay .= 'href="' . $file_thread . '?group=' . _rawurlencode($g->name) . '"><span class="np_group_line_text">' . $new_style_on . group_display_name($g->name) . $new_style_off . "</span></a>\n";
$groupdisplay .= 'href="' . $file_thread . '?group=' . urlencode($g->name) . '"><span class="np_group_line_text">' . $new_style_on . group_display_name($g->name) . $new_style_off . "</span></a>\n";
if ($new) {
echo '</i></b>';
}
@ -678,9 +678,9 @@ function groups_show($gruppen)
$overview_dbh = null;
if (isset($userdata[$g->name])) {
$groupdisplay .= '</span><p class="np_group_user_tools">';
$groupdisplay .= '<a class="np_group_user_tools" href="index.php?unsub=' . _rawurlencode($g->name) . '">(unsubscribe)</a>';
$groupdisplay .= '<a class="np_group_user_tools" href="index.php?unsub=' . urlencode($g->name) . '">(unsubscribe)</a>';
if ($new) {
$groupdisplay .= '&nbsp;<a href="overboard.php?thisgroup=' . _rawurlencode($g->name) . '&time=' . $userdata[$g->name] . '"><b>(new)</b></a> ';
$groupdisplay .= '&nbsp;<a href="overboard.php?thisgroup=' . urlencode($g->name) . '&time=' . $userdata[$g->name] . '"><b>(new)</b></a> ';
}
$groupdisplay .= '</p';
}

View File

@ -355,26 +355,20 @@ if ($show == 1) {
if (isset($error))
echo "<p>$error</p>";
?>
<form action="<?php echo $file_post?>" method="post" name="postform"
enctype="multipart/form-data">
echo '<form action="' . $file_post . '" method="post" name="postform"';
echo 'enctype="multipart/form-data">';
<div class="np_post_header">
<table>
<tr>
<td align="right"><b><?php echo $text_header["subject"] ?></b></td>
<td><input class="post" type="text"
name="<?php echo md5($fieldencrypt."subject")?>"
value="<?php
echo htmlspecialchars($subject);
?>"
size="40" maxlength="80"></td>
</tr>
<tr>
<td align="right"><b><?php echo $text_post["name"]?></b></td>
<td align="left">
<?php
echo '<div class="np_post_header">';
echo '<table><tr>';
echo '<td align="right"><b>' . $text_header["subject"] . '</b></td>';
echo '<td><input class="post" type="text" ';
echo 'name="' . md5($fieldencrypt . "subject") . '" ';
echo 'value="' . htmlspecialchars($subject) . '" ';
echo 'size="40" maxlength="' . $thread_maxSubject . '"></td>';
echo '</tr><tr>';
echo '<td align="right"><b>' . $text_post["name"] . '</b></td>';
echo '<td align="left">';
if (! isset($name) && $CONFIG['anonuser'])
$name = $CONFIG['anonusername'];
if (isset($form_noname) && $form_noname === true) {
@ -391,13 +385,9 @@ if ($show == 1) {
if ($CONFIG['anonuser'])
echo '&nbsp;or "' . $CONFIG['anonusername'] . '" with no password';
}
?>
</td>
</tr>
<tr>
<td align="right"><b><?php echo $text_post["password"]?></b></td>
<td align="left">
<?php
echo '</td></tr><tr>';
echo '<td align="right"><b><?php echo $text_post["password"]?></b></td>';
echo '<td align="left">';
// if (strcmp($user, $CONFIG['anonusername']) === 0) {
// $logged_in = false;
// }
@ -409,49 +399,37 @@ if ($show == 1) {
echo '<input class="post" type="password" name="' . md5($fieldencrypt . "email") . '"';
echo 'size="40" maxlength="40">';
}
?>
</td
</tr>
<?php
echo '</td></tr>';
// May we post encrypted messages to this group?
if (check_encryption_groups($newsgroups)) {
?>
<tr>
<td align="left"><input type="checkbox" name="encryptthis"
value="encrypt"> <b>Encrypt to:</b></td>
<td><input type="text" name="encryptto"
value="<?php echo $fromname;?>"></td>
</tr>
<?php
echo '<tr>';
echo '<td align="left"><input type="checkbox" name="encryptthis"';
echo 'value="encrypt"> <b>Encrypt to:</b></td>';
echo '<td><input type="text" name="encryptto" value="'.$fromname.'"></td>';
echo '</tr>';
}
?>
</table>
</div>
echo '</table></div>';
echo '<div class="np_post_body">';
echo '<table><tr>';
echo '<td><b>'.$text_post["message"].'</b><br> <textarea ';
echo 'class="postbody" id="postbody" ';
echo 'name="' . md5($fieldencrypt . "body") . '" wrap="soft">';
<div class="np_post_body">
<table>
<tr>
<td><b><?php echo $text_post["message"];?></b><br> <textarea
class="postbody" id="postbody"
name="<?php echo md5($fieldencrypt."body")?>" wrap="soft"><?php
if ((isset($bodyzeile)) && ($post_autoquote))
echo htmlspecialchars($bodyzeile);
if (is_string($body))
echo htmlspecialchars($body);
?>
</textarea></td>
</tr>
<tr>
<td>
<?php if(!$post_autoquote) { ?>
<input type="hidden" id="hidebody"
value="<?php
echo '</textarea></td></tr><tr><td>';
if (! $post_autoquote) {
echo '<input type="hidden" id="hidebody"';
echo 'value="';
if (isset($bodyzeile))
echo htmlspecialchars($bodyzeile);
?>"> <script language="JavaScript">
echo '">';
?>
<script language="JavaScript">
<!--
function quoten() {
document.getElementById("postbody").value=document.getElementById("hidebody").value;
@ -464,16 +442,19 @@ function quoten() {
<input type="submit" value="<?php echo $text_post["button_post"];?>">
<?php if ($setcookies==true) { ?>
&nbsp;<input tabindex="100" type="Button" name="quote"
value="<?php echo $text_post["quote"]?>"
onclick="quoten(); this.style.visibility= 'hidden';"> &nbsp;<input
type="checkbox" name="abspeichern" value="ja" checked>
&nbsp;
<input tabindex="100" type="Button" name="quote"
value="<?php echo $text_post["quote"]?>"
onclick="quoten(); this.style.visibility= 'hidden';">
&nbsp;
<input type="checkbox" name="abspeichern" value="ja" checked>
<?php echo $text_post["remember"];?>
<?php } ?>
&nbsp;<input type="file" name="photo" id="fileSelect" value="fileSelect"
accept="image/*,audio/*,text/*,application/pdf">
</td>
</tr>
&nbsp;
<input type="file" name="photo" id="fileSelect" value="fileSelect"
accept="image/*,audio/*,text/*,application/pdf">
</td>
</tr>
<?php
@ -483,19 +464,21 @@ function quoten() {
echo '</td></tr>';
}
?>
</table>
</div>
<input type="hidden" name="type" value="post"> <input type="hidden"
name="newsgroups" value="<?php echo htmlspecialchars($newsgroups); ?>">
<input type="hidden" name="references"
value="<?php echo htmlentities($references); ?>"> <input type="hidden"
name="group" value="<?php echo htmlspecialchars($newsgroups); ?>"> <input
type="hidden" name="returngroup"
value="<?php echo htmlspecialchars($head->followup); ?>"> <input
type="hidden" name="fielddecrypt"
value="<?php echo htmlspecialchars($fieldencrypt);?>">
</div>
<input type="hidden" name="type" value="post">
<input type="hidden" name="newsgroups"
value="<?php echo htmlspecialchars($newsgroups); ?>">
<input type="hidden" name="references"
value="<?php echo htmlentities($references); ?>">
<input type="hidden" name="group"
value="<?php echo htmlspecialchars($newsgroups); ?>">
<input type="hidden" name="returngroup"
value="<?php echo htmlspecialchars($head->followup); ?>">
<input type="hidden" name="fielddecrypt"
value="<?php echo htmlspecialchars($fieldencrypt);?>">
</form>
<?php } } ?>

View File

@ -11,11 +11,10 @@ include "newsportal.php";
$snippet_size = 100;
if (isset($_GET['group'])) {
$search_group = urldecode($_GET['group']);
}
if (isset($_POST['group'])) {
$search_group = urldecode($_POST['group']);
if (isset($_REQUEST['group'])) {
$search_group = urldecode($_REQUEST['group']);
} else {
$search_group = null;
}
if (isset($_REQUEST['data']) && $_REQUEST['data'] == '') {
@ -33,6 +32,9 @@ if ((! isset($_POST['key']) || ! password_verify($CONFIG['thissitekey'], $_POST[
echo '<h1 class="np_thread_headline">';
echo '<a href="' . $file_index . '" target=' . $frame['menu'] . '>' . basename(getcwd()) . '</a> / ';
if ($search_group) {
echo '<a href="' . $file_thread . '?group=' . urlencode($search_group) . '" target=' . $frame['menu'] . '>' . $search_group . '</a> / ';
}
echo 'search</h1>';
echo '<table cellpadding="0" cellspacing="0" class="np_buttonbar"><tr>';
if (isset($search_group)) {
@ -62,7 +64,6 @@ if ((! isset($_POST['key']) || ! password_verify($CONFIG['thissitekey'], $_POST[
echo '<input name="terms" type="text" id="terms"></td>';
}
echo '</tr><tr></tr><tr><td>';
if (isset($_GET['searchpoint']) && $_GET['searchpoint'] == 'Poster') {
if ($CONFIG['article_database'] == '1') {
echo '<input type="radio" name="searchpoint" value="body"/>Body&nbsp;';
@ -82,7 +83,7 @@ if ((! isset($_POST['key']) || ! password_verify($CONFIG['thissitekey'], $_POST[
echo '<tr>';
echo '<td><input name="command" type="hidden" id="command" value="Search" readonly="readonly"></td>';
if (isset($search_group)) {
echo '<input type="hidden" name="group" value="' . $search_group . '">';
echo '<input type="hidden" name="group" value="' . urlencode($search_group) . '">';
}
echo '<input type="hidden" name="key" value="' . password_hash($CONFIG['thissitekey'], PASSWORD_DEFAULT) . '">';
if (isset($_GET['data'])) {
@ -120,16 +121,11 @@ $title .= ' - search results for: ' . $_POST['terms'];
include "head.inc";
ob_start();
if (isset($_POST['thisgroup'])) {
echo '<h1 class="np_thread_headline">' . $grouplist[0] . ' (latest)</h1>';
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="' . $grouplist[0] . '"/>';
echo '<button class="np_button_link" type="submit">' . $text_article["back_to_group"] . '</button>';
echo '</form>';
echo '</td>';
if (isset($search_group)) {
echo '<h1 class="np_thread_headline">';
echo '<a href="' . $file_index . '" target=' . $frame['menu'] . '>' . basename(getcwd()) . '</a> / ';
echo '<a href="' . $file_thread . '?group=' . urlencode($search_group) . '" target=' . $frame['menu'] . '>' . $search_group . '</a> / ';
echo 'search results for: ' . $_POST['terms'] . '</h1>';
// Newsgroups button (hidden)
echo '<td>';
echo '<form action="' . $file_index . '">';
@ -161,9 +157,6 @@ if (isset($_COOKIE['tzo'])) {
$offset = $CONFIG['timezone'];
}
$overview = array();
if (trim($search_group = '')) {
$search_group = null;
}
if ($_POST['searchpoint'] == 'body') {
$overview = get_body_search($search_group, $_POST['terms']);
} else {