This can easily be fixed...
1) Add the following variable and configuration in your
links.cfg file:
Code:
# Email Rejection Letter
$db_email_delete = 0;
This is a flag variable that you can set or reset at anytime.
0 turns off the variable.
2) Then in your
admin_html.pl file, replace the following codes:
Code:
my $reason = &load_template ('email-del.txt', \%tmp);
with the following codes:
Code:
if ($db_email_delete) {
my $reason = &load_template ('email-del.txt', \%tmp);
}
Then replace the following codes:
Code:
Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$reason</textarea>
with the following codes:
Code:
if ($db_email_delete) {
print qq|<$font>Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$reason</textarea>|;
}
else {
print qq|<$font>Email Reason: <b>Turned Off</b></font>|;
}
Then replace the following codes:
Code:
Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$db_email_reject</textarea>
with the following codes:
Code:
if {$db_email_delete) {
print qq|Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$db_email_reject</textarea>|;
}
else {
print qq|<$font>Email Reason: <b>Turned Off</b></font>|;
}
3) Then in the
db.pl file in the
sub validate_records routine, replace the following codes:
Code:
ID: foreach $id (keys %delete_list) {
if ($delete_list{$id}) { next ID; }
elsif (!$in{"reason-$id"}) { next ID; }
elsif (${$links{$id}}{'Contact Email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ | |
${$links{$id}}{'Contact Email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) {
$errstr .= ($errstr, "<li>Email Error: <strong>$id</strong>. Record deleted, but couldn't send rejection letter. Reason: Bad Email addres: '${$links{$id}}{'Contact Email'}'.");
}
else { &html_reject_email (%{$links{$id}}); }
}
with the following codes:
Code:
if ($db_email_delete) {
ID: foreach $id (keys %delete_list) {
if ($delete_list{$id}) { next ID; }
elsif (!$in{"reason-$id"}) { next ID; }
elsif (${$links{$id}}{'Contact Email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ | |
${$links{$id}}{'Contact Email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) {
$errstr .= ($errstr, "<li>Email Error: <strong>$id</strong>. Record deleted, but couldn't send rejection letter. Reason: Bad Email addres: '${$links{$id}}{'Contact Email'}'.");
}
else { &html_reject_email (%{$links{$id}}); }
}
}
That should do it...
BTW: Step 2 is more of a cosmetic add-on than anything else. This is not necessary for this code hack to work.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com * Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
[This message has been edited by AnthroRules (edited April 28, 2000).]