Make new mail notification more obvious and cleanup rslight-lib.php
This commit is contained in:
parent
49a15058f3
commit
ba92f8dd2f
|
@ -159,7 +159,7 @@ foreach($menulist as $menu) {
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
}
|
}
|
||||||
if($unread) {
|
if($unread) {
|
||||||
$motd = 'You have unread mail. <a href="../spoolnews/mail.php">Click Here</a>';
|
$motd = '<center>*** You have unread mail. <a href="../spoolnews/mail.php">Click Here</a> ***</center>';
|
||||||
}
|
}
|
||||||
if(strlen($motd) > 0) {
|
if(strlen($motd) > 0) {
|
||||||
echo '<div class="np_last_posted_date"><h1 class="np_thread_headline">'.$motd.'</h1></div>';
|
echo '<div class="np_last_posted_date"><h1 class="np_thread_headline">'.$motd.'</h1></div>';
|
||||||
|
|
|
@ -269,6 +269,8 @@ function prepare_post($filename) {
|
||||||
if(stripos($line, "Newsgroups: ") === 0) {
|
if(stripos($line, "Newsgroups: ") === 0) {
|
||||||
$ngroups=explode(': ', $line);
|
$ngroups=explode(': ', $line);
|
||||||
$newsgroups=$ngroups[1];
|
$newsgroups=$ngroups[1];
|
||||||
|
$lines++;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ngroups = preg_split("/(\ |\,)/", trim($newsgroups));
|
$ngroups = preg_split("/(\ |\,)/", trim($newsgroups));
|
||||||
|
@ -411,8 +413,17 @@ function process_post($message, $group) {
|
||||||
fputs($postfilehandle,"X-Rslight-Original-Group: ".$orig_newsgroups."\r\n");
|
fputs($postfilehandle,"X-Rslight-Original-Group: ".$orig_newsgroups."\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$is_header = 1;
|
||||||
|
$lines = 0;
|
||||||
foreach($message as $line) {
|
foreach($message as $line) {
|
||||||
if(stripos($line, "Newsgroups: ") === 0) {
|
if(trim($line) == "" || $lines > 0) {
|
||||||
|
$is_header=0;
|
||||||
|
$lines++;
|
||||||
|
}
|
||||||
|
if($is_header == 0) {
|
||||||
|
$body.=$line."\n";
|
||||||
|
}
|
||||||
|
if(stripos($line, "Newsgroups: ") === 0 && $is_header == 1) {
|
||||||
fputs($postfilehandle, "Newsgroups: ".$newsgroups."\r\n");
|
fputs($postfilehandle, "Newsgroups: ".$newsgroups."\r\n");
|
||||||
} else {
|
} else {
|
||||||
fputs($postfilehandle, $line."\r\n");
|
fputs($postfilehandle, $line."\r\n");
|
||||||
|
|
Loading…
Reference in New Issue