Trim Poster search to avoid partial email matches
This commit is contained in:
parent
4bee83df61
commit
1fac7da654
|
@ -368,8 +368,7 @@ foreach($files as $article) {
|
||||||
$results = 1;
|
$results = 1;
|
||||||
|
|
||||||
foreach($new_overboard as $result) {
|
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";>';
|
echo '<tr class="np_result_line1"><td class="np_result_line1" style="word-wrap:break-word";>';
|
||||||
} else {
|
} else {
|
||||||
echo '<tr class="np_result_line2"><td class="np_result_line2" style="word-wrap:break-word";>';
|
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>';
|
echo '</body></html>';
|
||||||
|
|
||||||
function show_overboard_header($grouplist) {
|
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'])) {
|
if (isset($_GET['thisgroup'])) {
|
||||||
echo '<h1 class="np_thread_headline">';
|
echo '<h1 class="np_thread_headline">';
|
||||||
echo '<a href="'.$file_index.'" target='.$frame['menu'].'>'.basename(getcwd()).'</a> / ';
|
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 '<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>';
|
echo '<table cellpadding="0" cellspacing="0" class="np_buttonbar"><tr>';
|
||||||
// Refresh button
|
// Refresh button
|
||||||
echo '<td>';
|
echo '<td>';
|
||||||
echo '<form action="overboard.php">';
|
echo '<form action="overboard.php">';
|
||||||
echo '<input type="hidden" name="thisgroup" value="'.$_GET['thisgroup'].'"/>';
|
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 '</form>';
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
// Article List button
|
// Article List button
|
||||||
|
|
|
@ -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 = $dbh->prepare("SELECT * FROM $table WHERE newsgroup=:group AND ".$_POST['searchpoint']." like :terms ESCAPE '\' ORDER BY date DESC");
|
||||||
$stmt->bindParam(':group', $group);
|
$stmt->bindParam(':group', $group);
|
||||||
$stmt->bindParam(':terms', $searchterms);
|
$stmt->bindParam(':terms', $searchterms);
|
||||||
|
$check = "/(\s|\(|<)".trim($searchterms, '\%')."/i";
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
while($found = $stmt->fetch()) {
|
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->bindParam(':number', $found['number']);
|
||||||
$article_stmt->execute();
|
$article_stmt->execute();
|
||||||
$found_snip = $article_stmt->fetch();
|
$found_snip = $article_stmt->fetch();
|
||||||
|
|
Loading…
Reference in New Issue