Trim Poster search to avoid partial email matches

This commit is contained in:
Retro_Guy 2022-03-04 09:22:20 +00:00
parent 4bee83df61
commit 1fac7da654
2 changed files with 20 additions and 6 deletions

View File

@ -366,10 +366,9 @@ foreach($files as $article) {
}
}
$results = 1;
foreach($new_overboard as $result) {
if(($results % 2) != 0){
if(($results % 2) == 0){
echo '<tr class="np_result_line1"><td class="np_result_line1" style="word-wrap:break-word";>';
} else {
echo '<tr class="np_result_line2"><td class="np_result_line2" style="word-wrap:break-word";>';
@ -393,19 +392,28 @@ foreach($files as $article) {
echo '</body></html>';
function show_overboard_header($grouplist) {
global $text_thread, $text_article, $file_index, $file_thread;
global $text_thread, $text_article, $file_index, $file_thread, $user_time;
if (isset($_GET['thisgroup'])) {
echo '<h1 class="np_thread_headline">';
echo '<a href="'.$file_index.'" target='.$frame['menu'].'>'.basename(getcwd()).'</a> / ';
echo '<a href="'.$file_thread.'?group='.rawurlencode($grouplist[0]).'" target='.$frame[content].'>'.htmlspecialchars(group_displaY_name($grouplist[0])).'</a> / ';
echo ' latest</h1>';
if (isset($user_time)) {
echo ' new messages</h1>';
} else {
echo ' latest</h1>';
}
echo '<table cellpadding="0" cellspacing="0" class="np_buttonbar"><tr>';
// Refresh button
echo '<td>';
echo '<form action="overboard.php">';
echo '<input type="hidden" name="thisgroup" value="'.$_GET['thisgroup'].'"/>';
echo '<button class="np_button_link" type="submit">'.$text_article["refresh"].'</button>';
if (isset($user_time)) {
echo '<button class="np_button_link" type="submit">overboard</button>';
} else {
echo '<button class="np_button_link" type="submit">'.$text_article["refresh"].'</button>';
}
echo '</form>';
echo '</td>';
// Article List button

View File

@ -338,8 +338,14 @@ function get_header_search($group, $terms) {
$stmt = $dbh->prepare("SELECT * FROM $table WHERE newsgroup=:group AND ".$_POST['searchpoint']." like :terms ESCAPE '\' ORDER BY date DESC");
$stmt->bindParam(':group', $group);
$stmt->bindParam(':terms', $searchterms);
$check = "/(\s|\(|<)".trim($searchterms, '\%')."/i";
$stmt->execute();
while($found = $stmt->fetch()) {
if(isset($_REQUEST['data']) && ($_REQUEST['searchpoint'] == 'name')) {
if(!preg_match($check, $found['name'])) {
continue;
}
}
$article_stmt->bindParam(':number', $found['number']);
$article_stmt->execute();
$found_snip = $article_stmt->fetch();