Ok, not gonna guarantee this will work, as it isn't tested, and I have never really done much with subscribe.cgi
Ok, open up subscribe.cgi, and replace the
unsubscribe sub routine with the following;
Code:
sub unsubscribe {
# -----------------------------------------------------------
# Removes a user from a mailing list.
#
my %in = @_;
my $in_list = $db_email_name;
my $list = lc($in_list);
# Check that the user is already subscribed.
my $in_email = $in{'email'};
my $email = lc($in_email); # lower case the in email...
my $name = $in{'name'};
my $users_r = &get_users ($list);
${$users_r}{$email} or &site_html_mailing_error ("The email address: $email is not subscribed to this list.") and return;
# Made it this far, so let's remove the user.
delete ${$users_r}{$email};
open (LIST, ">$list") or &cgierr ("Unable to open list: $list. Reason: $!");
if ($db_use_flock) { flock (LIST, 2) or &cgierr ("Unable to get exlusive lock! Reason: $!"); }
foreach (sort keys %{$users_r}) {
print LIST "$_$db_delim${$users_r}{$_}\n";
}
close LIST;
# Go to the success page.
&site_html_mailing ('unsubscribe');
}
Give it a go..but make sure you have a backup of the old script first
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package | GLinks ULTRA Package PRO Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins!