[pmwiki-users] Duplicate mail posts

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Mon May 29 14:14:12 CDT 2006


I posted an example of getting duplicate mail posts on this page

The first was sent 2006-05-29 15:59:55 +0200, and the
second was sent on 2006-05-29 16:00:03 +0200.

Here's the first part of my farmconfig.php

   // Determine if mail notification is enabled for this page
   $EnableMailPosts = setupMailNotification($pagename);

   // Configure variables related to mail notification
   $MailPostsMessage = "Recent wiki posts:\n"
     ."  (http://wiki.lyx.org/Field/AllRecentChanges)\n"
     ."  (http://wiki.lyx.org/devel/Field/AllRecentChanges)\n"

   $MailPostsTo=$isBetaSite ? "chr at md.kth.se" : "lyx-docs at lists.lyx.org";
   $MailPostsDelay=1800;     // wait for initial post to age 30 minutes

   // require at least 24 hours between mails
   $MailPostsSquelch= $isBetaSite ? 10 : 24*3600;

   // ...ItemFmt is overriden for the other fields in their
   local/config.php       $MailPostsItemFmt =
     "* http://wiki.lyx.org/\$Group/\$Name - \$PostTime by \$A\uthor";
   $MailPostsTimeFmt = "%H:%M %e/%m";

The code above invokes a function, setupMailNotification(), which looks 
like this:

// Check to see if mailposts should be enabled. 
// Use this function as follows: 
//      $EnableMailPosts = setupMailNotification($pagename); 
// where '$pagename' is typically the current page. 
function setupMailNotification($pagename){
   $Group = FmtPageName('$Group', $pagename);
   $Page = FmtPageName('$Group.$Name', $pagename);

   // Groups for which mail notification is disabled
   $IgnoredGroups = array("SiteTest", "Test", "Playground", "PersonalChr");
   $IgnoredPages = array();

   // Determine if mail notification should be enabled or not
   return !in_array($Group, $IgnoredGroups) && !in_array($Page, $IgnoredPages);

I'm not sure if there's any other information I could add to make more 
sense of this.


Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr

More information about the pmwiki-users mailing list