Search by email address when clicking username for search
This commit is contained in:
parent
9f6572e1be
commit
8141c8221e
|
@ -396,7 +396,7 @@ function show_header($head,$group,$local_poster=false) {
|
|||
echo '<i>';
|
||||
}
|
||||
if ($head->name != "") {
|
||||
echo create_name_link($head->name);
|
||||
echo create_name_link($head->name, $head->from);
|
||||
} else {
|
||||
if(isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) {
|
||||
echo truncate_email($head->from);
|
||||
|
|
|
@ -727,7 +727,7 @@ function thread_format_subject($c,$group,$highlightids=false) {
|
|||
$started = $fromoutput[0];
|
||||
}
|
||||
$return.='<div id="datebox">';
|
||||
$return.='<p class=np_posted_date_left>By: '.create_name_link($started).' on <i>'.date("D, j M Y",$newdate).'</i></p>';
|
||||
$return.='<p class=np_posted_date_left>By: '.create_name_link($started, $c->from).' on <i>'.date("D, j M Y",$newdate).'</i></p>';
|
||||
$return.='</div>';
|
||||
}
|
||||
return($return);
|
||||
|
@ -848,29 +848,7 @@ function thread_format_lastmessage($c,$group='') {
|
|||
} else {
|
||||
$return.='<p class=np_posted_date_left>'.get_date_interval(date("D, j M Y H:i T",$c->date_thread)).'</p>';
|
||||
}
|
||||
$return.='<p class=np_posted_date_left>By: '.create_name_link($poster_name).'</p>';
|
||||
/*
|
||||
// if the address the anonymous address, only return the name
|
||||
if($c->from==$anonym_address)
|
||||
return $c->name;
|
||||
$return="";
|
||||
if($thread_show["authorlink"])
|
||||
$return .= '<a href="mailto:'.trim($c->from).'">';
|
||||
if (trim($c->name)!="") {
|
||||
$return .= htmlspecialchars(trim($c->name));
|
||||
} else {
|
||||
if (isset($c->username)) {
|
||||
$s = strpos($c->username,"%");
|
||||
if ($s != false) {
|
||||
$return .= htmlspecialchars(substr($c->username,0,$s));
|
||||
} else {
|
||||
$return .= htmlspecialchars($c->username);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($thread_show["authorlink"])
|
||||
$return .= "</a>";
|
||||
*/
|
||||
$return.='<p class=np_posted_date_left>By: '.create_name_link($poster_name, $name_from).'</p>';
|
||||
return($return);
|
||||
}
|
||||
|
||||
|
|
|
@ -679,7 +679,7 @@ function groups_show($gruppen) {
|
|||
$groupdisplay.=get_date_interval(date("D, j M Y H:i T",$lastarticleinfo->date));
|
||||
$groupdisplay.='<table><tr><td>';
|
||||
$groupdisplay.='<font class="np_last_posted_date">by: ';
|
||||
$groupdisplay.=create_name_link($lastarticleinfo->name);
|
||||
$groupdisplay.=create_name_link($lastarticleinfo->name, $lastarticleinfo->from);
|
||||
$groupdisplay.='</td></tr></table>';
|
||||
}
|
||||
$groupdisplay.="\n";
|
||||
|
@ -1275,13 +1275,16 @@ function format_log_date() {
|
|||
return date('M d H:i:s');
|
||||
}
|
||||
|
||||
function create_name_link($name) {
|
||||
function create_name_link($name, $data=null) {
|
||||
global $CONFIG;
|
||||
$name = preg_replace('/\"/', '', $name);
|
||||
if(strpos($name, '...@') !== false && (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true)) {
|
||||
$return = '<span class="visited">'.substr(htmlspecialchars($name),0,20).'</span>';
|
||||
if($data) {
|
||||
$data = urlencode(base64_encode($data));
|
||||
}
|
||||
if (strpos($name, '...@') !== false && (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true)) {
|
||||
$return = '<span class="visited">'.substr(htmlspecialchars($name),0,20).'</span>';
|
||||
} else {
|
||||
$return = '<a href="search.php?command=search&searchpoint=Poster&terms='.$name.'"><span class="visited">'.substr(htmlspecialchars($name),0,20).'</span></a>';
|
||||
$return = '<a href="search.php?command=search&searchpoint=Poster&terms='.$name.'&data='.$data.'"><span class="visited">'.substr(htmlspecialchars($name),0,20).'</span></a>';
|
||||
}
|
||||
return($return);
|
||||
}
|
||||
|
|
|
@ -273,18 +273,25 @@ foreach($files as $article) {
|
|||
$isfrom = explode("From: ", $articlefrom[0]);
|
||||
$articlefrom[0] = $isfrom[1];
|
||||
}
|
||||
$fromoutput = explode("<", html_entity_decode($articlefrom[0]));
|
||||
|
||||
// Just an email address?
|
||||
if(strlen($fromoutput[0]) < 2) {
|
||||
preg_match("/\<([^\)]*)\@/", html_entity_decode($articlefrom[0]), $fromaddress);
|
||||
$fromoutput[0] = $fromaddress[1];
|
||||
}
|
||||
if(strpos($fromoutput[0], "(")) {
|
||||
preg_match("/\(([^\)]*)\)/", html_entity_decode($articlefrom[0]), $fromaddress);
|
||||
$fromoutput[0] = $fromaddress[1];
|
||||
}
|
||||
|
||||
$fromline = address_decode($articlefrom[0],"nirgendwo");
|
||||
if (!isset($fromline[0]["host"])) $fromline[0]["host"]="";
|
||||
$name_from=$fromline[0]["mailbox"]."@".$fromline[0]["host"];
|
||||
$name_username=$fromline[0]["mailbox"];
|
||||
if (!isset($fromline[0]["personal"])) {
|
||||
$poster_name=$fromline[0]["mailbox"];
|
||||
} else {
|
||||
$poster_name=$fromline[0]["personal"];
|
||||
}
|
||||
if(trim($poster_name) == '') {
|
||||
$fromoutput = explode("<", html_entity_decode($c->name));
|
||||
if(strlen($fromoutput[0]) < 1) {
|
||||
$poster_name = $fromoutput[1];
|
||||
} else {
|
||||
$poster_name = $fromoutput[0];
|
||||
}
|
||||
}
|
||||
$fromoutput[0] = $poster_name;
|
||||
|
||||
if(($results % 2) != 0){
|
||||
$this_output = '<tr class="np_result_line1"><td class="np_result_line1" style="word-wrap:break-word";>';
|
||||
} else {
|
||||
|
@ -305,9 +312,9 @@ foreach($files as $article) {
|
|||
$poster_name = $fromoutput[0];
|
||||
}
|
||||
if($local_poster) {
|
||||
$this_output.= '<p class=np_ob_posted_date>Posted: '.$date_interval.' by: <i>'.create_name_link(mb_decode_mimeheader($poster_name)).'</i></p>';
|
||||
$this_output.= '<p class=np_ob_posted_date>Posted: '.$date_interval.' by: <i>'.create_name_link(mb_decode_mimeheader($poster_name), $name_from).'</i></p>';
|
||||
} else {
|
||||
$this_output.= '<p class=np_ob_posted_date>Posted: '.$date_interval.' by: '.create_name_link(mb_decode_mimeheader($poster_name)).'</p>';
|
||||
$this_output.= '<p class=np_ob_posted_date>Posted: '.$date_interval.' by: '.create_name_link(mb_decode_mimeheader($poster_name), $name_from).'</p>';
|
||||
}
|
||||
# Try to display useful snippet
|
||||
if($stop=strpos($body, "begin 644 "))
|
||||
|
|
|
@ -8,6 +8,7 @@ include "newsportal.php";
|
|||
throttle_hits();
|
||||
|
||||
$snippet_size = 100;
|
||||
//echo $_REQUEST['data']." :: ".base64_decode(urldecode($_REQUEST['data']));
|
||||
|
||||
if(!isset($_POST['key']) || !password_verify($CONFIG['thissitekey'], $_POST['key'])) {
|
||||
include "head.inc";
|
||||
|
@ -15,17 +16,7 @@ include "head.inc";
|
|||
echo '<h1 class="np_thread_headline">';
|
||||
echo '<a href="'.$file_index.'" target='.$frame['menu'].'>'.basename(getcwd()).'</a> / ';
|
||||
echo 'search</h1>';
|
||||
echo '<table cellpadding="0" cellspacing="0" class="np_buttonbar"><tr>';
|
||||
// View Latest button
|
||||
if (isset($overboard) && ($overboard == true)) {
|
||||
echo '<td>';
|
||||
echo '<form target="'.$frame['content'].'" action="overboard.php">';
|
||||
echo '<button class="np_button_link" type="submit">'.$text_thread["button_overboard"].'</button>';
|
||||
echo '</form>';
|
||||
echo '</td>';
|
||||
} else {
|
||||
// echo htmlspecialchars($CONFIG['title_full']);
|
||||
}
|
||||
echo '<table cellpadding="0" cellspacing="0" class="np_buttonbar"><tr>';
|
||||
if(isset($_GET['group'])) {
|
||||
$searching = $_GET['group'];
|
||||
} else {
|
||||
|
@ -68,6 +59,9 @@ if ($_GET['searchpoint'] == 'Poster') {
|
|||
echo '<input type="hidden" name="group" value="'.$_GET['group'].'">';
|
||||
}
|
||||
echo '<input type="hidden" name="key" value="'.password_hash($CONFIG['thissitekey'], PASSWORD_DEFAULT).'">';
|
||||
if(isset($_GET['data'])) {
|
||||
echo '<input type="hidden" name="data" value="'.$_GET['data'].'">';
|
||||
}
|
||||
|
||||
?>
|
||||
</tr>
|
||||
|
@ -158,7 +152,11 @@ $results=0;
|
|||
if($_POST['searchpoint'] == 'body') {
|
||||
$overview = get_body_search($group, $_POST['terms']);
|
||||
} else {
|
||||
$overview = get_header_search($group, $_POST['terms']);
|
||||
if(isset($_REQUEST['data'])) {
|
||||
$overview = get_header_search($group, base64_decode(urldecode($_REQUEST['data'])));
|
||||
} else {
|
||||
$overview = get_header_search($group, $_POST['terms']);
|
||||
}
|
||||
}
|
||||
foreach($overview as $overviewline) {
|
||||
/* Find section for links */
|
||||
|
|
Loading…
Reference in New Issue