Gossamer Forum
Home : Products : Gossamer List : Discussion :

Re: [TheStone] Subscription list

Quote Reply
Re: [TheStone] Subscription list In reply to
Sorry to be a pain..

I tried it, most of it did work. The <%endif%> tags worked fine, so did the URL and show only subscriptions.

But it did not actually display the different lists, it only gave the following error:

Error: Variable 'subscript_list' is not a code reference (subscript_list is what I called the global).

The global you showed, I entered that as a global in LinksSQL since I could not find anywhere to enter a global or either list or community.

The code I used on the user_profile template is (did a small change, see part in red):

<%subscript_list('My Newsletter,Another Newsletter', $comm_email)%>
<%loop loop_glist_lists%>
<input name="app_glist_subscribed" type="checkbox" value="<%lst_id%>" <%if checked%>checked<%endif%>">
<%endloop%>


The Global Code I entered into LinksSQL is:

sub {
my ($lids, $email) = @_;
return unless $lids;
lib->import('PATH_TO_GLIST/private/lib');
require GT::SQL;
require GT::SQL::Condition;
my $db = GT::SQL->new('PATH_TO_GLIST/private/defs');
my %hash;
if ($email) {
my $subs_db = $db->table('Subscribers');
my $sth = $subs_db->select(['sub_list_id_fk'], { sub_email => $email });
while (my ($lid) = $sth->fetchrow_array) {
$hash{$lid} ||= 1;
}
}
my @lids = split(',', $lids);
my $db_list = $db->table('Lists');
$db_list->select_options('ORDER BY lst_title');
my $lists = $db_list->select(GT::SQL::Condition->new(lst_id => 'IN' => \@lids))->fetchall_hashref;
if (%hash) {
foreach (@$lists) {
$_->{checked} = 1 if (exists $hash{$_->{lst_id}});
}
}
return { loop_glist_lists => $lists, lists => $lids };
}

Any idea?

Thanks!
Subject Author Views Date
Thread Subscription list demon 11965 Dec 31, 2004, 1:03 AM
Thread Re: [demon] Subscription list
604 11856 Jan 4, 2005, 10:07 AM
Thread Re: [TheStone] Subscription list
demon 11843 Jan 4, 2005, 12:20 PM
Thread Re: [demon] Subscription list
604 11844 Jan 4, 2005, 1:47 PM
Thread Re: [TheStone] Subscription list
demon 11833 Jan 7, 2005, 2:43 AM
Thread Re: [demon] Subscription list
604 11828 Jan 7, 2005, 9:17 AM
Post Re: [TheStone] Subscription list
demon 11829 Jan 8, 2005, 7:36 AM
Thread Re: [TheStone] Subscription list
demon 11821 Jan 10, 2005, 5:59 AM
Thread Re: [demon] Subscription list
604 11814 Jan 10, 2005, 9:36 AM
Post Re: [TheStone] Subscription list
demon 11800 Jan 10, 2005, 9:40 AM
Thread Re: [TheStone] Subscription list
demon 11805 Jan 10, 2005, 11:38 PM
Thread Re: [demon] Subscription list
604 11808 Jan 11, 2005, 9:22 AM
Thread Re: [TheStone] Subscription list
demon 11805 Jan 11, 2005, 9:59 AM
Post Re: [demon] Subscription list
604 11801 Jan 11, 2005, 10:36 AM