[pmwiki-devel] keep notify script from reporting multiple edits by same author

Frank Schweickert f.schweickert at uva.nl
Mon Oct 5 11:53:02 CDT 2009


With every update of pmwiki I have to keep track of my modifications of 
script/notify.php
So, maybe this suggestion can make it somehow into the official 
distribution some day:

I purge my notification messages by deleting multiple edits of the same 
author at the same page,
keeping only the last edit. My way is probably not the most efficient, 
but it was a quick
fix that works for me... so if anybody would like to implement something 
like this (maybe as an option)...?

I have introduced

##########
function dedup($var) {                             #fsmod: delete 
earlier entries of same page and same author
   global $Author, $pagename;
   $aut = strpos ($var,urlencode(" {$Author}:"));
   $page = strpos ($var,urlencode(" $pagename "));
   return (!$aut || !$page);
   }
##########

and call it in function NotifyUpdate before $nnow = time(); last in 
foreach($nlist as $n){...}

##########
    foreach($mailto as $m) {
      $notify[$m]=array_filter($notify[$m],"dedup");     #fsmod function 
dedup above
      $notify[$m][] = $item;
##########


Best regards,
Frank





pmwiki-devel-request at pmichaud.com wrote:
> Send pmwiki-devel mailing list submissions to
> 	pmwiki-devel at pmichaud.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
> or, via email, send a message with subject or body 'help' to
> 	pmwiki-devel-request at pmichaud.com
>
> You can reach the person managing the list at
> 	pmwiki-devel-owner at pmichaud.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of pmwiki-devel digest..."
>
>
> Today's Topics:
>
>    1. Re: check authorization requirements for a given page
>       (Frank Schweickert)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 02 Oct 2009 00:46:21 +0200
> From: Frank Schweickert <f.schweickert at uva.nl>
> Subject: Re: [pmwiki-devel] check authorization requirements for a
> 	given page
> To: Hans <design5 at softflow.co.uk>
> Cc: pmwiki-devel at pmichaud.com
> Message-ID: <4AC5313D.3050301 at uva.nl>
> Content-Type: text/plain; charset="us-ascii"
>
> An HTML attachment was scrubbed...
> URL: http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20091002/bac5e144/attachment-0001.html 
>
> ------------------------------
>
> _______________________________________________
> pmwiki-devel mailing list
> pmwiki-devel at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
>
>
> End of pmwiki-devel Digest, Vol 36, Issue 2
> *******************************************
>
>   


-- 
_______________________________________________________________________
Dr. Frank F. Schweickert
AMSTEL Institute, Faculty of Science, University of Amsterdam
Science Park 904, Amsterdam, Room C2-1.22
Postal address: Postbus 94224, 1090 GE Amsterdam
Phone: +31 20 525-8475 (secr. -5886)
http://www.science.uva.nl/amstel
http://www.natsim.net




More information about the pmwiki-devel mailing list