Do not truncate poster name in message view. Move From to below Subject if Subject is long.
This commit is contained in:
parent
4f75012597
commit
a013047794
|
@ -453,7 +453,7 @@ function show_header($head, $group, $local_poster = false)
|
||||||
echo '<i>';
|
echo '<i>';
|
||||||
}
|
}
|
||||||
if ($head->name != "") {
|
if ($head->name != "") {
|
||||||
echo create_name_link($head->name, $head->from);
|
echo create_name_link($head->name, $head->from, false);
|
||||||
} else {
|
} else {
|
||||||
if (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) {
|
if (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) {
|
||||||
echo truncate_email($head->from);
|
echo truncate_email($head->from);
|
||||||
|
@ -568,10 +568,13 @@ function show_header_short($head, $group, $local_poster = false)
|
||||||
global $file_attachment, $CONFIG, $config_name, $sitelink;
|
global $file_attachment, $CONFIG, $config_name, $sitelink;
|
||||||
global $OVERRIDES;
|
global $OVERRIDES;
|
||||||
|
|
||||||
|
// If Subject: is longer than this, place From: below Subject: in short short_header
|
||||||
|
$maxsubjectlength = 70;
|
||||||
|
|
||||||
echo '<div class="np_article_header">';
|
echo '<div class="np_article_header">';
|
||||||
|
|
||||||
if ($head->name != "") {
|
if ($head->name != "") {
|
||||||
$displayname = create_name_link($head->name, $head->from);
|
$displayname = create_name_link($head->name, $head->from, false);
|
||||||
} else {
|
} else {
|
||||||
if (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) {
|
if (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) {
|
||||||
$displayname = truncate_email($head->from);
|
$displayname = truncate_email($head->from);
|
||||||
|
@ -581,7 +584,7 @@ function show_header_short($head, $group, $local_poster = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Where to show From in short_headers
|
// Where to show From in short_headers
|
||||||
if (isset($OVERRIDES['short_header_show_from_in_subject']) && $OVERRIDES['short_header_show_from_in_subject'] == true) {
|
if (isset($OVERRIDES['short_header_show_from_in_subject']) && $OVERRIDES['short_header_show_from_in_subject'] == true && strlen($head->subject) < $maxsubjectlength) {
|
||||||
echo '<span class="short_header_subject">';
|
echo '<span class="short_header_subject">';
|
||||||
echo htmlspecialchars($head->subject);
|
echo htmlspecialchars($head->subject);
|
||||||
echo '</span><span class="short_header_from_with_subject">';
|
echo '</span><span class="short_header_from_with_subject">';
|
||||||
|
|
|
@ -1741,20 +1741,27 @@ function format_log_date()
|
||||||
return date('M d H:i:s');
|
return date('M d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_name_link($name, $data = null)
|
function create_name_link($name, $data = null, $truncate = true)
|
||||||
{
|
{
|
||||||
global $CONFIG;
|
global $CONFIG;
|
||||||
$name = preg_replace('/\"/', '', $name);
|
$name = preg_replace('/\"/', '', $name);
|
||||||
|
|
||||||
|
if ($truncate) {
|
||||||
|
$trimlength = 20;
|
||||||
|
} else {
|
||||||
|
$trimlength = null;
|
||||||
|
}
|
||||||
|
|
||||||
if ($data) {
|
if ($data) {
|
||||||
$data = urlencode(base64_encode($data));
|
$data = urlencode(base64_encode($data));
|
||||||
}
|
}
|
||||||
if ((strpos($name, '...@') !== false && (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true)) && ! $data) {
|
if ((strpos($name, '...@') !== false && (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true)) && ! $data) {
|
||||||
$return = '<span class="visited">' . substr(htmlspecialchars($name), 0, 20) . '</span>';
|
$return = '<span class="visited">' . substr(htmlspecialchars($name), 0, $trimlength) . '</span>';
|
||||||
} else {
|
} else {
|
||||||
if (isset($_COOKIE['mail_name'])) {
|
if (isset($_COOKIE['mail_name'])) {
|
||||||
$return = '<a href="search.php?command=search&searchpoint=Poster&terms=' . $name . '&data=' . $data . '" title="Search or Block by user"><span class="visited">' . substr(htmlspecialchars($name), 0, 20) . '</span></a>';
|
$return = '<a href="search.php?command=search&searchpoint=Poster&terms=' . $name . '&data=' . $data . '" title="Search or Block by user"><span class="visited">' . substr(htmlspecialchars($name), 0, $trimlength) . '</span></a>';
|
||||||
} else {
|
} else {
|
||||||
$return = '<a href="search.php?command=search&searchpoint=Poster&terms=' . $name . '&data=' . $data . '" title="Search by user"><span class="visited">' . substr(htmlspecialchars($name), 0, 20) . '</span></a>';
|
$return = '<a href="search.php?command=search&searchpoint=Poster&terms=' . $name . '&data=' . $data . '" title="Search by user"><span class="visited">' . substr(htmlspecialchars($name), 0, $trimlength) . '</span></a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ($return);
|
return ($return);
|
||||||
|
|
Loading…
Reference in New Issue