Skip to Content.
Sympa Menu

en - Re: [sympa-users] Listowner setting message topics for subscribers...

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Peter Farmer <address@concealed>
  • To: address@concealed
  • Cc: "Gavin Younger" <address@concealed>
  • Subject: Re: [sympa-users] Listowner setting message topics for subscribers...
  • Date: Thu, 19 Oct 2006 17:03:44 +0800

On Thursday 19 October 2006 12:15 am, Gavin Younger wrote:
> I'm currently looking at the 'message topics' feature of Sympa
> (currently using v 5.2) and am wondering whether it is is possible for a
> listowner to be able to define message topics for individual
> subscribers (similar to the way a listowner can set a subscriber's
> reception mode by clicking their address on the review list)... It's
> possible for a subscriber to do this, but can't find a way for a
> listowner to set this on their behalf...
>

Gavin,

The 5.2 code base doesnt support that functionality, but I have modified my
installation to support it . Below are the basic changes you need to add.
Regards
Peter Farmer

You'll need to add the following code to the wwwsympa.fcgi program in the
do_editsubscriber subroutine - just before the code for handling bounces is
ok :

#msg_topic
$param->{'current_subscriber'}{'sub_user_topic'} = 0;
foreach my $user_topic (split /,/
$param->{'current_subscriber'{'topics'}) {
$param->{'current_subscriber'}{'topic_checked'}{$user_topic} = 1;
$param->{'current_subscriber'}{'sub_user_topic'}++;
}
if ($param->{'current_subscriber'}{'reception'} eq 'mail') {
$param->{'current_subscriber'}{'possible_topic'} = 1;
}

if ($list->is_there_msg_topic()) {
foreach my $top (@{$list->{'admin'}{'msg_topic'}}) {
if (defined $top->{'name'}) {
push (@{$param->{'available_topics'}},$top);
}
}
}



You'll also need to add the following code to the editsubscriber.tt2
template (just after the the lines for the Visibility or Language inputs).
This is a simplistic version - a bit unwieldy if you have a lot of topics,
but obviously you could imprive the markup to handle this it better.

[%IF available_topics %]
<tr>
<th><label for="topics">[%|loc%]Topic subscription
:[%END%]</label></th>
<td>
[%IF current_subscriber.possible_topic %]
[% FOREACH t = available_topics %]
[%IF current_subscriber.topic_checked.${t.name} %]
<input type="checkbox" name="topic_[%t.name%]" value="1"
checked="1"> [% t.title %] </input>
[%ELSE%]
<input type="checkbox" name="topic_[%t.name%]" value="1">
[% t.title %] </input>
[%END%]
<br />
[% END %]
[%IF current_subscriber.topic_checked.other %]
<input type="checkbox" name="topic_other" value="1"
checked="1"/> [%|loc%]Other (messages not tagged) [%END%]
[%ELSE%]
<input type="checkbox" name="topic_other" value="1" />
[%|loc%]Other (messages not tagged) [%END%]
[%END%] <br />

[%IF sub_user_topic %]
<br />
<input type="checkbox" name="no_topic" value="1">
[%|loc%]Disable topics subscription[%END%]</input>
<br />
[%END%]

[%ELSE%]
<i>Not possible in current reception mode</i>
[%END%]
</td>
</tr>



Archive powered by MHonArc 2.6.19+.

Top of Page