Fix searching user by link in search.php

This commit is contained in:
Retro_Guy 2022-02-25 05:14:20 +00:00
parent 5f8aa0c785
commit 6c64fd5afd
1 changed files with 24 additions and 21 deletions

View File

@ -36,7 +36,11 @@ include "head.inc";
echo '</tr>'; echo '</tr>';
echo '<tr></tr>'; echo '<tr></tr>';
echo '<tr>'; echo '<tr>';
echo '<td>Search Terms:&nbsp'; if(!isset($_REQUEST['data'])) {
echo '<td>Search Terms:&nbsp';
} else {
echo '<td>Search Poster:&nbsp';
}
echo '<input name="terms" type="text" id="terms" value="'.$_GET[terms].'"></td>'; echo '<input name="terms" type="text" id="terms" value="'.$_GET[terms].'"></td>';
echo '</tr><tr></tr><tr><td>'; echo '</tr><tr></tr><tr><td>';
@ -205,25 +209,25 @@ $results=0;
echo '<a href="'.$groupurl.'">'.$overviewline['newsgroup'].'</a>'; echo '<a href="'.$groupurl.'">'.$overviewline['newsgroup'].'</a>';
echo '</p>'; echo '</p>';
$fromline = address_decode($overviewline['name'],"nirgendwo");
$articlefrom[0] = $overviewline['name']; if (!isset($fromline[0]["host"])) $fromline[0]["host"]="";
$fromoutput = explode("<", html_entity_decode($articlefrom[0])); $name_from=$fromline[0]["mailbox"]."@".$fromline[0]["host"];
// Just an email address? $name_username=$fromline[0]["mailbox"];
if(strlen($fromoutput[0]) < 2) { if (!isset($fromline[0]["personal"])) {
preg_match("/\<([^\)]*)\@/", html_entity_decode($articlefrom[0]), $fromaddress); $poster_name=$fromline[0]["mailbox"];
$fromoutput[0] = $fromaddress[1]; } else {
} $poster_name=$fromline[0]["personal"];
if(strpos($fromoutput[0], "(")) { }
preg_match("/\(([^\)]*)\)/", html_entity_decode($articlefrom[0]), $fromaddress); if(trim($poster_name) == '') {
$fromoutput[0] = $fromaddress[1]; $fromoutput = explode("<", html_entity_decode($c->name));
} if(strlen($fromoutput[0]) < 1) {
if((isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) && (strpos($fromoutput[0], '@') !== false)) { $poster_name = $fromoutput[1];
$poster_name = truncate_email($fromoutput[0]); } else {
} else { $poster_name = $fromoutput[0];
$poster_name = $fromoutput[0]; }
} }
$poster_name = trim(mb_decode_mimeheader($poster_name), " \n\r\t\v\0\"");
echo '<p class=np_ob_posted_date>Posted: '.$newdate.' by: '.create_name_link($poster_name).'</p>'; echo '<p class=np_ob_posted_date>Posted: '.$newdate.' by: '.create_name_link($poster_name, $name_from).'</p>';
if($_POST['searchpoint'] == 'body') { if($_POST['searchpoint'] == 'body') {
$snip = strip_tags(quoted_printable_decode($overviewline['snippet']), '<strong><font><i>'); $snip = strip_tags(quoted_printable_decode($overviewline['snippet']), '<strong><font><i>');
} else { } else {
@ -234,7 +238,6 @@ $results=0;
echo '</td></tr>'; echo '</td></tr>';
if($results++ > ($maxdisplay - 2)) if($results++ > ($maxdisplay - 2))
break; break;
// }
} }
echo '</table>'; echo '</table>';