Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief digest Task
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @since 08 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -39,18 +39,25 @@ class _digest extends \IPS\Task
|
||||
/* Doing daily or weekly this run? */
|
||||
$frequencies = array( 'daily', 'weekly' );
|
||||
$frequency = $frequencies[ array_rand( $frequencies ) ];
|
||||
|
||||
/* Grab some members to send digests to. */
|
||||
$members = \IPS\DB::i()->select( 'follow_member_id', 'core_follow', array( 'follow_notify_do=1 AND follow_visible=1 AND follow_notify_freq = ? AND follow_notify_sent < ?', $frequency, ( $frequency == 'daily' ) ? time() - 86400 : time() - 604800 ), 'follow_member_id ASC', array( 0, 50 ), 'follow_member_id' );
|
||||
|
||||
/* Grab some members to send digests to. */
|
||||
$members = \IPS\Db::i()->select( 'follow_member_id, follow_notify_sent', 'core_follow', array( 'follow_notify_do=1 AND follow_visible=1 AND follow_notify_freq = ? AND follow_notify_sent < ?', $frequency, ( $frequency == 'daily' ) ? time() - 86400 : time() - 604800 ), 'follow_notify_sent ASC', array( 0, 50 ), NULL, NULL, \IPS\Db::SELECT_DISTINCT );
|
||||
|
||||
if( !count( $members ) )
|
||||
{
|
||||
/* Nothing to send */
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
$memberIDs = array();
|
||||
foreach( $members as $member )
|
||||
{
|
||||
$memberIDs[] = $member['follow_member_id'];
|
||||
}
|
||||
|
||||
/* Fetch the member's follows so we can build their digest */
|
||||
$follows = \IPS\DB::i()->select( '*', 'core_follow', array( 'follow_notify_do=1 AND follow_notify_freq=? AND follow_visible=1 AND follow_notify_sent < ? AND ' . \IPS\Db::i()->in( 'follow_member_id', iterator_to_array( $members ) ), $frequency, time() - 86400 ), 'follow_member_id ASC, follow_app ASC, follow_area ASC' );
|
||||
|
||||
$follows = \IPS\Db::i()->select( '*', 'core_follow', array( 'follow_notify_do=1 AND follow_notify_freq=? AND follow_visible=1 AND follow_notify_sent < ? AND ' . \IPS\Db::i()->in( 'follow_member_id', $memberIDs ), $frequency, time() - 86400 ), 'follow_notify_sent ASC, follow_app ASC, follow_area ASC' );
|
||||
|
||||
$groupedFollows = array();
|
||||
foreach( $follows as $follow )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user