[Mailman-Users] Codes

Tokio Kikuchi tkikuchi at is.kochi-u.ac.jp
Tue Feb 22 11:14:23 CET 2005


Hi,

PeteBell wrote:

> Hi again!
> 
> Thank you for taking the time to give such a helpful and detailed answer!
> 
> I was hoping I could just change my PHP to something about if the code 
> is greater than 279 then hide the member. But it looks a little more 
> difficult than that.
> 
> It's also difficult when you consider that I don't have access to either 
> mailman or python.  Where do I get this thing "member_status" you refer to?

This is what you call 'code'.

if your php program read like this:
if ($code > 279) { ... }
then you only have to change like so:
if ($code & 16) { ... }

You can browse the mailman source code from
http://sourceforge.net/projects/mailman/ -> cvs -> browse
http://cvs.sourceforge.net/viewcvs.py/mailman/

> 
> Thanks again
> Regards
> Pete
> 
> 
> On 22 Feb 2005, at 00:44, Tokio Kikuchi wrote:
> 
>> Hi, again.
>>
>> PeteBell wrote:
>>
>>> Thanks very much.
>>> One more thing, please.  As you can see below, your email arrived 
>>> with rather strange formatting and each line was broken in odd 
>>> places.  Can I just check:
>>> Do you mean that all the following mean "hide"?...
>>> 280 and 314
>>> And 264 means "SHOW"?
>>> Or are you trying to explain something more complex which I am not 
>>> understanding?
>>> Cheers
>>> Pete, UK
>>> On 21 Feb 2005, at 12:07, Tokio Kikuchi wrote:
>>>
>>>> >>> 280 & 16
>>>> 16
>>>> >>> 264 & 16
>>>> 0
>>>> >>> 314 & 16
>>>> 16
>>
>> This is python interactive mode operations.
>>
>> Quote the keys to the value again.
>>
>>> # Bitfield for user options.  See DEFAULT_NEW_MEMBER_OPTIONS above to 
>>> set
>>> # defaults for all new lists.
>>> Digests             = 0 # handled by other mechanism, doesn't need a 
>>> flag.
>>> DisableDelivery     = 1 # Obsolete; use set/getDeliveryStatus()
>>> DontReceiveOwnPosts = 2 # Non-digesters only
>>> AcknowledgePosts    = 4
>>> DisableMime         = 8 # Digesters only
>>> ConcealSubscription = 16
>>> SuppressPasswordReminder = 32
>>> ReceiveNonmatchingTopics = 64
>>> Moderate = 128
>>> DontReceiveDuplicates = 256
>>
>>
>>
>> Take number 280. This is 256 + 16 + 8
>>                  = DontReceiveDuplicates
>>                    + ConcealSubscription
>>                    + DisableMime
>> So the member doesn't want receive list mail if his address is in Cc: 
>> list, not want to list his address in the roster page, and he want 
>> plain text digest if he move to digest mode.
>>
>> 264 = 256 + 8 = DontReceiveDuplicates
>>                   + DisableMime
>> Similar to above but this member doesn't care if his address is listed 
>> in roster page.
>>
>> 314 = 256 + 32 + 16 + 8 + 2
>>                = DontReceiveDuplicates
>>                  + SuppressPasswordReminder
>>                  + ConcealSubscription
>>                  + DisableMime
>>                  + DontReceiveOwnPosts
>> This member doesn't want to get monthly password reminder, and doesn't 
>> want to receive his own posts adding the options of the first member.
>>
>> There should be many combination of numbers which indicate 'hide' 
>> status but there is a nice operation to get this; 'bitwise and'. So, 
>> if you get members subscription status code in say member_status, then 
>> you should write a program like:
>>
>> if member_status & 16:
>>     print 'Hide this member.'
>> else:
>>     print 'Expose this menber.'
>>
>> This is Python code and not PHP in which you are wirting, but the 
>> logic should be clear. You can refer to the php '&' operation manual at
>> http://www.php.net/manual/en/language.operators.bitwise.php
>> (After quick googling).
>>
>> Cheers,

-- 
Tokio Kikuchi, tkikuchi@ is.kochi-u.ac.jp
http://weather.is.kochi-u.ac.jp/




More information about the Mailman-Users mailing list