Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Task: Prunes subscribed topics
* Last Updated: $LastChangedDate: 2009-08-24 20:56:22 -0400 (Mon, 24 Aug 2009) $
* Last Updated: $LastChangedDate: 2010-07-07 08:09:48 -0400 (Wed, 07 Jul 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 5041 $
* @version $Rev: 6609 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -162,6 +164,52 @@ class task_item
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $deadid ) . ")" );
}
//-----------------------------------------
// Delete old topic redirects
//-----------------------------------------
if ( intval( $this->settings['topic_redirect_prune'] ) > 0 )
{
$time = time() - ( $this->settings['topic_redirect_prune'] * 86400 );
$tids = array();
$fids = array();
/* Grab topics ensuring we use the index */
$this->DB->build( array( 'select' => 'tid, moved_to, forum_id',
'from' => 'topics',
'where' => 'forum_id > 0 AND pinned=0 AND last_post < ' . $time . " AND state='link'",
'limit' => array( 0, 150 ) ) );
$this->DB->execute();
while ( $row = $this->DB->fetch() )
{
/* ensure it's a moved topic */
if ( $row['moved_to'] )
{
$tids[] = $row['tid'];
$fids[ $row['forum_id'] ]++;
}
}
if ( count( $tids ) > 0 )
{
$this->DB->delete( 'topics', "tid IN (" . implode( ",", $tids ) . ")" );
if ( count( $fids ) )
{
foreach( $fids as $f => $count )
{
/* remove the count */
$this->DB->force_data_type = array( 'topics' => 'int' );
$this->DB->update( 'forums', array( 'topics' => 'minus:' . $count ), 'id=' . intval( $f ) );
}
}
}
$redirectsDeleted = intval( count( $tids ) );
}
//-----------------------------------------
// Remove old XML-RPC logs...
//-----------------------------------------
@@ -179,7 +227,7 @@ class task_item
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_dailycleanout'], $xmlrpc_logs_deleted, $_attach_count, $deleted ) );
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_dailycleanout'], $xmlrpc_logs_deleted, $_attach_count, $deleted, $redirectsDeleted ) );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!