Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -49,7 +49,7 @@ class _cleanup extends \IPS\Task
|
||||
/* Delete old validating members */
|
||||
if ( \IPS\Settings::i()->validate_day_prune )
|
||||
{
|
||||
$select = \IPS\Db::i()->select( 'core_validating.member_id, core_members.member_posts', 'core_validating', array( 'core_validating.new_reg=1 AND core_validating.coppa_user<>1 AND core_validating.entry_date<? AND core_validating.lost_pass<>1 AND core_validating.user_verified=0 AND core_members.member_posts < 1 AND core_validating.do_not_delete=0', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->validate_day_prune . 'D' ) )->getTimestamp() ) )->join( 'core_members', 'core_members.member_id=core_validating.member_id' );
|
||||
$select = \IPS\Db::i()->select( 'core_validating.member_id, core_members.member_posts', 'core_validating', array( 'core_validating.new_reg=1 AND core_validating.coppa_user<>1 AND core_validating.entry_date<? AND core_validating.lost_pass<>1 AND core_validating.user_verified=0 AND !(core_members.members_bitoptions2 & 16384 ) AND core_members.member_posts < 1 AND core_validating.do_not_delete=0', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->validate_day_prune . 'D' ) )->getTimestamp() ) )->join( 'core_members', 'core_members.member_id=core_validating.member_id' );
|
||||
|
||||
foreach ( $select as $row )
|
||||
{
|
||||
@@ -249,6 +249,8 @@ class _cleanup extends \IPS\Task
|
||||
$member->warn_level -= $warning->points;
|
||||
$member->save();
|
||||
|
||||
\IPS\Db::i()->update( 'core_members_warn_logs', array( 'wl_removed_on' => $warning->expire_date ), array( 'wl_id=?', $warning->id ) );
|
||||
|
||||
$warning->expire_date = 0;
|
||||
$warning->save();
|
||||
}
|
||||
@@ -266,7 +268,6 @@ class _cleanup extends \IPS\Task
|
||||
/* Reset expired "moderate content till.." timestamps */
|
||||
\IPS\Db::i()->update( 'core_members', array( 'mod_posts' => 0 ), array( 'mod_posts != -1 and mod_posts <?', time() ) );
|
||||
|
||||
|
||||
/* Set expired announcements inactive */
|
||||
\IPS\Db::i()->update( 'core_announcements', array( 'announce_active' => 0 ), array( 'announce_active = 1 and announce_end > 0 and announce_end <?', time() ) );
|
||||
|
||||
@@ -300,20 +301,11 @@ class _cleanup extends \IPS\Task
|
||||
/* Delete old core statistic caches */
|
||||
\IPS\Db::i()->delete( 'core_item_statistics_cache', array( 'cache_added < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P1D' ) )->getTimestamp() ) );
|
||||
|
||||
/* Delete alerts */
|
||||
\IPS\Db::i()->delete( 'core_alerts', array( 'alert_end > 0 and alert_end < ?', time() ) );
|
||||
|
||||
/* Truncate the output caches table */
|
||||
\IPS\Output\Cache::i()->deleteExpired( TRUE );
|
||||
|
||||
/* Turn on things for cloud 2 */
|
||||
if ( \IPS\CIC2 AND \IPS\Cicloud\getForcedArchiving() )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'archive' ) );
|
||||
|
||||
/* 12 years is the cutoff if archiving is forced, so if it's over 12 years, drop the value down */
|
||||
if( \IPS\Settings::i()->archive_last_post_cloud > 12 )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'archive_last_post_cloud' => 12 ) );
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user