Gossamer Forum
Home : Products : Links 2.0 : Customization :

Re: [willdeb] case sensitive unsubscribe

Quote Reply
Re: [willdeb] case sensitive unsubscribe In reply to
Ok, not gonna guarantee this will work, as it isn't tested, and I have never really done much with subscribe.cgi Wink

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 Tongue

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!
Subject Author Views Date
Thread case sensitive unsubscribe willdeb 3345 Jun 3, 2002, 7:44 AM
Thread Re: [willdeb] case sensitive unsubscribe
Andy 3299 Jun 3, 2002, 8:39 AM
Thread Re: [Andy] case sensitive unsubscribe
Paul 3288 Jun 3, 2002, 8:56 AM
Post Re: [Paul] case sensitive unsubscribe
Andy 3297 Jun 3, 2002, 9:00 AM
Thread Re: [willdeb] case sensitive unsubscribe
Andy 3298 Jun 3, 2002, 9:07 AM
Thread Re: [Andy] case sensitive unsubscribe
willdeb 3295 Jun 3, 2002, 9:37 AM
Post Re: [willdeb] case sensitive unsubscribe
willdeb 3289 Jun 29, 2002, 6:31 PM