phpBB Digests

Digest sending posts from "foe" even when "remove posts" set - phpBB Digests

Digest sending posts from "foe" even when "remove posts" set

Postby QuiltingChaos » Thu Nov 10, 2011 12:25 am

People are still receiving posts from their foes in the digest, even though the filter
"Remove posts from my foes:" is set on "yes"

Is their something else that needs to be changed in the UCP?

Thanks.
QuiltingChaos
Registered User
 
Posts: 13
Joined: Fri May 13, 2011 8:38 pm

Re: Digest sending posts from "foe" even when "remove posts" set

Postby MarkDHamill » Thu Nov 10, 2011 1:07 am

Thank you for reporting this. This is definitely a bug and was introduced when I rewrote mail_digests.php for efficiency. Unfortunately, there is no simple solution and this will take a while to figure out and provide a patch. I'll try to work on it this weekend and will post the solution here when I have it.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Digest sending posts from "foe" even when "remove posts" set

Postby MarkDHamill » Fri Nov 11, 2011 12:37 am

Okay, here is a patch. No patch is needed for versions 2.2.16 or before. Otherwise edit mail_digests.php as follows:

Around like 1182 replace:


Code: Select all
      // Put posts in the digests, assuming they should not be filtered out
      foreach ($rowset as $post_row)
      {


with:

Code: Select all
      // Fetch foes, if any but only if they want foes filtered out
      if ($user_row['user_digest_remove_foes'] == 1)
      {
      
         unset($foes);
         // Fetch your foes
         $sql3 = 'SELECT zebra_id
               FROM ' . ZEBRA_TABLE . '
               WHERE user_id = ' . $user_row['user_id'] . ' AND foe = 1';
         $result3 = $db->sql_query($sql3);
         while ($row3 = $db->sql_fetchrow($result3))
         {
            $foes[] = (int) $row3['zebra_id'];
         }
         $db->sql_freeresult($result3);
               
      }
      
      // Put posts in the digests, assuming they should not be filtered out
      foreach ($rowset as $post_row)
      {
         
         // Exclude post if from a foe
         if ($user_row['user_digest_remove_foes'] == 1 && in_array($post_row['poster_id'], $foes))
         {
            continue;
         }


Sorry for the error.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA