Sorry for the lng delay of replies to this thread but I was upset at getting screamed at to send this guy my files which are crutial to my companies' unique independance and have been deemed classified by my partners. I can however release an example of where to place the mod in your nph-build.cgi:
# Print HTML Header
$use_html ?
print qq|<html><head><tittle>Links Manager: Building Pages</title></head>
<BASE TARGET="_top">
<BODY BGCOLOR=#FFFFFF><H2><TT>Building Pages</TT></H2>
<PRE>| :
print qq|Building Pages\n|;
print "Pages built on " . $date . " at " . $time . "\n";
print "--------------------------------------------------------\n\n";
----- THIS IS THE BEGINING OF THE MOD -----
###### Send Out Newsletter ########
##Configure It Here##
$list_file = "/data1/hypermart.net/simsearch/cgi-bin/newsletter/newsletter.dat";
$mailprog = '/var/qmail/bin/qmail-inject';
$sendday = 'Friday';
####
my @days = qw!Sunday Monday Tuesday Wednesday Thursday Friday Saturday!;
my $day = $days[(localtime(time))[6]];
if ($day eq $sendday) {
if (! (-e "$db_backup_path/$date.db")) {
print "Sending Newsletter..\n";
## Sending E-Mail For Newest Websites ##
# Find The New Sites And Add Them To The Email
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name. Reason: $!");
@lines = <DB>;
close DB;
LINE: foreach $line (@lines) {
next LINE if ($line =~ /^#/);
next LINE if ($line =~ /^\s*$/);
chomp $line;
@fields = &split_decode ($line);
if (!$fields[$db_modified]) {
print "Warning! Bad Line (no date!): $line\n";
next LINE;
}
my (%rec) = @_;
my $days_old = &days_old($fields[$db_modified]);
if ($days_old <= 7) {
$numbersite += 1;
if ($newsites) {
$newsites .= "<bR><A href=http://www.simsearch.com/cgi-bin/SimSearch/jump.cgi?ID=$fields[$db_key]> $fields[$db_title]</a> - $fields[$db_description]<br>$fields[$db_modified] - $fields[$db_contact_name] - $fields[$db_contact_email]<br>";
} else {
$newsites = "<bR><A href=http://www.simsearch.com/cgi-bin/SimSearch/jump.cgi?ID=$fields[$db_key]> $fields[$db_title]</a> - $fields[$db_description]<br>$fields[$db_modified] - $fields[$db_contact_name] - $fields[$db_contact_email]<br>";
}
}
}
####
sub clean
{
chomp($member);
$member=~ s/^\s+//;
$member=~ s/\s+$//;
}
open(LIST,"$list_file");
@addresses=<LIST>;
close(LIST);
foreach $member(@addresses)
{
open (MAIL, "|$mailprog -t $member") | | die "Can't open $mailprog!\n";
print MAIL "From: SimSearch \<webmaster\@simsearch\.hypermart.net\>\n";
print MAIL "Subject: Weekly Newsletter\n";
print MAIL "Content-Type: text/html \n";
print MAIL "To: $member\n";
print MAIL "<html>\n";
print MAIL "<p>SimSearch's Automated Newsletter, sent out every $sendday. To Unsubscribe or Visit goto <A href=http://www.simsearch.com>http://www.simsearch.com</a> and mark unsubscribe on the newsletter. Sending you this week's newest links ($numbersite Links):</p><hr><hr><br>";
print MAIL "$newsites";
print MAIL "</html>\n";
close (MAIL);
$x++;
}
########################################
print "Done.\n\n";
}
else {
print "Newsletter already exists for today.. skipping..\n\n";
}
}
else {
print "Newsletter not sent today..<br>";
}
##############################################
------THIS IS THE END OF THE MOD!!!-----
# Back up Database..
if (! (-e "$db_backup_path/$date.db")) {
print "Backing up database to $db_backup_path/$date.db . . .\n";
use File::Copy;
copy ($db_file_name, "$db_backup_path/$date.db") or &cgierr ("unable to make backup $db_backup_path/$date.db! Reason: $!");
print "Done.\n\n";
}
else {
print "Backup Database already exists for today.. skipping..\n\n";
}
That's how the MOD appears in my nph-build.cgi file.
I'm not sure if it's Links 2.0 compatible but someone let me know please if you have gotten it to work in 2.0. Thanks.
------------------
The RelayMan
simsearch.hyperart.net mdhealyjr@adelphia.net