Notify Once SP1/1.1
1.0
Tired of receiving an email everytime someone replied to a message you're watching? Then try the new and improved "Notify Once"!
No longer will your inbox be flooded with almost identical emails - instead receive a single message saying one or more users have replied.
As an added bonus, zero length .mail files are now deleted!
How to install: Apply the mod file, upload the modified files! (not difficult is it!)
Note: This mod is incompatible with notify plus!
BHRA Webmaster
http://www.bhra.org.uk
###############################################################################
Sources/Post.pl
# Notify any members who have notification turned on for this thread.
$FORM{'subject'} = $msub;
foreach $curmail (@mails) {
chomp $curmail;
if ($curmail ne $settings[2]) {
&sendmail($curmail,"$txt{'127'}\: $subject","$txt{'128'}, $subject, $txt{'129'} $cgi;action=display;num=$thread\n\n$txt{'130'}");
}
}
my $i = 0;
my $found = 0;
foreach $curmail (@mails) {
chomp $curmail;
($curmail, $mail_sent) = split(/\|/,$curmail);
if ($curmail ne $settings[2] && $mail_sent != 1) {
&sendmail($curmail,"$txt{'127'}\: $subject","$txt{'128'}, $subject, $txt{'129'} $cgi;action=display;num=$thread\n\n$txt{'130'}");
$mail_sent = 1; $found = 1;
}
$mails[$i] = "$curmail|$mail_sent\n";
$i++;
}
if ($found == 1) {
fopen(FILE, ">$datadir/$thread.mail");
print FILE @mails;
fclose(FILE);
}
###############################################################################
sources/Display.pl
# Add 1 to the number of views of this thread.
# Update notification file that the thread has been viewed.
if($enable_notification && $username ne 'Guest' && -e("$datadir/$viewnum.mail")) {
my $i = 0;
my $found = 0;
fopen(FILE, "$datadir/$viewnum.mail");
@mails = ;
fclose(FILE);
foreach $curmail (@mails) {
chomp $curmail;
($curmail, $mail_sent) = split(/\|/,$curmail);
if ($curmail eq $settings[2] && $mail_sent == 1) {
$mail_sent = 0; $found = 1;
}
$mails[$i] = "$curmail|$mail_sent\n";
$i++;
}
if ($found == 1) {
fopen(FILE, ">$datadir/$viewnum.mail");
print FILE @mails;
fclose(FILE);
}
}
###############################################################################
sources/Notify.pl
if($settings[2] eq "$curmail") { $isonlist = 1; }
($curmail, $mail_sent) = split(/\|/,$curmail);
print FILE "$settings[2]\n";
print FILE "$settings[2]|0\n";
if($settings[2] ne $curmail) { print FILE "$curmail\n"; }
($curmail, $mail_sent) = split(/\|/,$curmail);
if($settings[2] ne $curmail) { print FILE "$curmail|$mail_sent\n"; }
if($settings[2] ne "$curmail") { print FILE "$curmail\n"; }
}
fclose(FILE);
($curmail, $mail_sent) = split(/\|/,$curmail);
if($settings[2] ne "$curmail") { print FILE "$curmail|$mail_sent\n"; }
}
fclose(FILE);
if (-z "$datadir/$thread.mail") { unlink("$datadir/$thread.mail"); }
if($settings[2] ne $curmail) { print FILE "$curmail\n"; }
}
fclose(FILE);
($curmail, $mail_sent) = split(/\|/,$curmail);
if($settings[2] ne $curmail) { print FILE "$curmail|$mail_sent\n"; }
}
fclose(FILE);
if (-z "$datadir/$threadno.mail") { unlink("$datadir/$threadno.mail"); }
if ($entry eq $settings[2]) {
($entry, $mail_sent) = split(/\|/,$entry);
###############################################################################
english.lng
$txt{'128'} = "A reply";
$txt{'129'} = "has been posted to a topic you are watching.\n\nView it at";
$txt{'128'} = "One or more replies have been posted to the topic";
$txt{'129'} = "that you are watching.\n\nView it at";