Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -1,99 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* @file announcements.php Task to expire announcements
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to expire announcements
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Deactivate expired announcements
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/announcements.php', 'public_forums_forums_announcements' );
|
||||
$announcements = new $classToLoad();
|
||||
$announcements->makeRegistryShortcuts( $this->registry );
|
||||
$announcements->announceRetireExpired();
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_announcements'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file announcements.php Task to expire announcements
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to expire announcements
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Deactivate expired announcements
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/announcements.php', 'public_forums_forums_announcements' );
|
||||
$announcements = new $classToLoad();
|
||||
$announcements->makeRegistryShortcuts( $this->registry );
|
||||
$announcements->announceRetireExpired();
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_announcements'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -1,224 +1,222 @@
|
||||
<?php
|
||||
/**
|
||||
* @file dailycleanout.php Task to prune daily old topic subscriptions
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-05-02 18:07:19 -0400 (Mon, 02 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8586 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to prune daily old topic subscriptions
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete old subscriptions
|
||||
//-----------------------------------------
|
||||
|
||||
$deleted = 0;
|
||||
$trids = array();
|
||||
|
||||
if ( $this->settings['subs_autoprune'] > 0 )
|
||||
{
|
||||
$time = time() - ($this->settings['subs_autoprune'] * 86400);
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'l.like_lookup_id',
|
||||
'from' => array( 'core_like' => 'l' ),
|
||||
'where' => 't.last_post < ' . $time,
|
||||
'add_join' => array(
|
||||
array( 'from' => array( 'topics' => 't' ),
|
||||
'where' => "t.tid=l.like_rel_id AND l.like_app='forums' AND l.like_area='topics'",
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$trids[] = $r['like_lookup_id'];
|
||||
}
|
||||
|
||||
if (count($trids) > 0)
|
||||
{
|
||||
$this->DB->delete( 'core_like', "like_lookup_id IN ('" . implode( "','", $trids ) . "')" );
|
||||
$this->DB->delete( 'core_like_cache', "like_cache_id IN ('" . implode( "','", $trids ) . "')" );
|
||||
}
|
||||
|
||||
$deleted = intval( count($trids) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete old unattached uploads
|
||||
//-----------------------------------------
|
||||
|
||||
$time_cutoff = time() - 7200;
|
||||
$deadid = array();
|
||||
|
||||
$this->DB->build( array( "select" => '*', 'from' => 'attachments', 'where' => "attach_rel_id=0 AND attach_date < {$time_cutoff}" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $killmeh = $this->DB->fetch() )
|
||||
{
|
||||
if ( $killmeh['attach_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
|
||||
}
|
||||
if ( $killmeh['attach_thumb_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
|
||||
}
|
||||
|
||||
$deadid[] = $killmeh['attach_id'];
|
||||
}
|
||||
|
||||
$_attach_count = count( $deadid );
|
||||
|
||||
if ( $_attach_count )
|
||||
{
|
||||
$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' => 'pinned=0 AND moved_on < ' . $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->setDataType( 'topics', 'int' );
|
||||
$this->DB->update( 'forums', array( 'topics' => 'minus:' . $count ), 'id=' . intval( $f ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$redirectsDeleted = intval( count( $tids ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove old XML-RPC logs...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['xmlrpc_log_expire'] > 0 )
|
||||
{
|
||||
$time = time() - ( $this->settings['xmlrpc_log_expire'] * 86400 );
|
||||
|
||||
$this->DB->delete( 'api_log', "api_log_date < {$time}" );
|
||||
|
||||
$xmlrpc_logs_deleted = $this->DB->getAffectedRows();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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, $redirectsDeleted ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file dailycleanout.php Task to prune daily old topic subscriptions
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since -
|
||||
* $LastChangedDate: 2012-01-13 11:28:34 -0500 (Fri, 13 Jan 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10138 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to prune daily old topic subscriptions
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete old subscriptions
|
||||
//-----------------------------------------
|
||||
|
||||
$deleted = 0;
|
||||
$trids = array();
|
||||
|
||||
if ( $this->settings['subs_autoprune'] > 0 )
|
||||
{
|
||||
$time = time() - ($this->settings['subs_autoprune'] * 86400);
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'l.like_lookup_id',
|
||||
'from' => array( 'core_like' => 'l' ),
|
||||
'where' => 't.last_post < ' . $time,
|
||||
'add_join' => array(
|
||||
array( 'from' => array( 'topics' => 't' ),
|
||||
'where' => "t.tid=l.like_rel_id AND l.like_app='forums' AND l.like_area='topics'",
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$trids[] = $r['like_lookup_id'];
|
||||
}
|
||||
|
||||
if (count($trids) > 0)
|
||||
{
|
||||
$this->DB->delete( 'core_like', "like_lookup_id IN ('" . implode( "','", $trids ) . "')" );
|
||||
$this->DB->delete( 'core_like_cache', "like_cache_id IN ('" . implode( "','", $trids ) . "')" );
|
||||
}
|
||||
|
||||
$deleted = intval( count($trids) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete old unattached uploads
|
||||
//-----------------------------------------
|
||||
|
||||
$time_cutoff = time() - 7200;
|
||||
$deadid = array();
|
||||
|
||||
$this->DB->build( array( "select" => '*', 'from' => 'attachments', 'where' => "attach_rel_id=0 AND attach_date < {$time_cutoff}" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $killmeh = $this->DB->fetch() )
|
||||
{
|
||||
if ( $killmeh['attach_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
|
||||
}
|
||||
if ( $killmeh['attach_thumb_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
|
||||
}
|
||||
|
||||
$deadid[] = $killmeh['attach_id'];
|
||||
}
|
||||
|
||||
$_attach_count = count( $deadid );
|
||||
|
||||
if ( $_attach_count )
|
||||
{
|
||||
$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' => 'pinned=0 AND moved_on < ' . $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 )
|
||||
{
|
||||
ipsRegistry::getClass('class_forums')->forumRebuild( $f );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$redirectsDeleted = intval( count( $tids ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove old XML-RPC logs...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['xmlrpc_log_expire'] > 0 )
|
||||
{
|
||||
$time = time() - ( $this->settings['xmlrpc_log_expire'] * 86400 );
|
||||
|
||||
$this->DB->delete( 'api_log', "api_log_date < {$time}" );
|
||||
|
||||
$xmlrpc_logs_deleted = $this->DB->getAffectedRows();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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, $redirectsDeleted ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -1,101 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* @file dailydigest.php Task to send out the daily digest emails
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9373 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to send out the daily digest emails
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Send daily digests...
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/digest.php', 'digestLibrary', 'forums' );
|
||||
$digest = new $classToLoad( $this->registry );
|
||||
|
||||
$digest->runDigest( 'daily', 'topic' );
|
||||
|
||||
$digest->runDigest( 'daily', 'forum' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_dailydigest'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file dailydigest.php Task to send out the daily digest emails
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mmecham $
|
||||
* @since -
|
||||
* $LastChangedDate: 2012-03-06 09:29:21 -0500 (Tue, 06 Mar 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10393 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to send out the daily digest emails
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Send daily digests...
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
|
||||
$_like = classes_like::bootstrap( 'forums','topics' );
|
||||
$_like->sendDigestNotifications( 'daily', 500 );
|
||||
|
||||
$_like = classes_like::bootstrap( 'forums','forums' );
|
||||
$_like->sendDigestNotifications( 'daily', 500 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_dailydigest'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,180 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* @file permadelete.php Deletes posts and topics marked for deletion after specified number of days
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-09-16 17:49:58 -0400 (Fri, 16 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9505 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to send out the daily digest emails
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_mod' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Figure out how long
|
||||
//-----------------------------------------
|
||||
|
||||
$_days = $this->settings['days_to_keep_deletions'] > 0 ? intval($this->settings['days_to_keep_deletions']) : 365;
|
||||
$_ts = time() - ( $_days * 86400 );
|
||||
$posts = 0; // Number of removed posts
|
||||
$topics = 0; // Number of removed topics
|
||||
$forums = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Moderator library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
|
||||
$moderatorLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get topics
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topics', 'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'pdelete', 'oktoremove' ) ) . ' AND tdelete_time < ' . $_ts ) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$forums[ $r['forum_id'] ] = $r['forum_id'];
|
||||
|
||||
$moderatorLibrary->init( $this->registry->getClass('class_forums')->allForums[ $r['forum_id'] ], $r );
|
||||
$moderatorLibrary->topicDeleteFromDB( $r['tid'], true );
|
||||
$moderatorLibrary->clearModQueueTable( 'topic', $r['tid'] );
|
||||
$moderatorLibrary->addModerateLog( $r['forum_id'], $r['tid'], '', $r['title'], $this->lang->words['acp_deleted_a_topic'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get posts
|
||||
//-----------------------------------------
|
||||
|
||||
$_ids = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => $this->registry->getClass('class_forums')->fetchPostHiddenQuery( array( 'pdelete', 'oktoremove' ), 'p.' ) . ' AND pdelete_time < ' . $_ts,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$forums[ $r['forum_id'] ] = $r['forum_id'];
|
||||
|
||||
$moderatorLibrary->init( $this->registry->getClass('class_forums')->allForums[ $r['forum_id'] ], $r );
|
||||
$moderatorLibrary->postDeleteFromDb( $r['pid'], true );
|
||||
$moderatorLibrary->clearModQueueTable( 'post', $r['pid'] );
|
||||
|
||||
$_ids[] = $r['pid'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Rebuild forums and stats
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($forums) )
|
||||
{
|
||||
foreach( $forums as $forum )
|
||||
{
|
||||
$moderatorLibrary->forumRecount( $forum );
|
||||
}
|
||||
|
||||
$this->cache->rebuildCache( 'stats', 'global' );
|
||||
}
|
||||
|
||||
$moderatorLibrary->addModerateLog( "", "", "", implode( ',', $_ids ), sprintf( $this->lang->words['multi_post_delete'], implode( ', ', $_ids ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_permadelete'], $posts, $topics ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file permadelete.php Deletes posts and topics marked for deletion after specified number of days
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: AndyMillne $
|
||||
* @since -
|
||||
* $LastChangedDate: 2012-07-02 10:20:47 -0400 (Mon, 02 Jul 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 11019 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to send out the daily digest emails
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_mod' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Figure out how long
|
||||
//-----------------------------------------
|
||||
|
||||
$_days = $this->settings['days_to_keep_deletions'] > 0 ? intval($this->settings['days_to_keep_deletions']) : 365;
|
||||
$_ts = time() - ( $_days * 86400 );
|
||||
$posts = 0; // Number of removed posts
|
||||
$topics = 0; // Number of removed topics
|
||||
$forums = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Moderator library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
|
||||
$moderatorLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get topics
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'topics',
|
||||
'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'pdelete', 'oktoremove' ) ) . ' AND tdelete_time < ' . $_ts,
|
||||
'limit' => array( 0, 500 ) ) );
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$topics++;
|
||||
$forums[ $r['forum_id'] ] = $r['forum_id'];
|
||||
|
||||
$moderatorLibrary->init( $this->registry->getClass('class_forums')->allForums[ $r['forum_id'] ], $r );
|
||||
$moderatorLibrary->topicDeleteFromDB( $r['tid'], true );
|
||||
$moderatorLibrary->clearModQueueTable( 'topic', $r['tid'] );
|
||||
$moderatorLibrary->addModerateLog( $r['forum_id'], $r['tid'], '', $r['title'], $this->lang->words['acp_deleted_a_topic'] );
|
||||
|
||||
// Do we have a linked topic to remove?
|
||||
$linked_topic = $this->DB->buildAndFetch( array( 'select' => 'tid, forum_id', 'from' => 'topics', 'where' => "state='link' AND moved_to='" . $r['tid'] . '&' . $r['forum_id'] . "'" ) );
|
||||
|
||||
if ( $linked_topic )
|
||||
{
|
||||
$this->DB->delete( 'topics', "tid=" . $linked_topic['tid'] );
|
||||
$forums[ $linked_topic['forum_id'] ] = $linked_topic['forum_id'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get posts
|
||||
//-----------------------------------------
|
||||
|
||||
$_ids = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => $this->registry->getClass('class_forums')->fetchPostHiddenQuery( array( 'pdelete', 'oktoremove' ), 'p.' ) . ' AND pdelete_time < ' . $_ts,
|
||||
'limit' => array( 0, 500 ),
|
||||
'add_join' => array( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$posts++;
|
||||
$forums[ $r['forum_id'] ] = $r['forum_id'];
|
||||
|
||||
$moderatorLibrary->init( $this->registry->getClass('class_forums')->allForums[ $r['forum_id'] ], $r );
|
||||
$moderatorLibrary->postDeleteFromDb( $r['pid'], true );
|
||||
$moderatorLibrary->clearModQueueTable( 'post', $r['pid'] );
|
||||
|
||||
$_ids[] = $r['pid'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Rebuild forums and stats
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($forums) )
|
||||
{
|
||||
foreach( $forums as $forum )
|
||||
{
|
||||
$moderatorLibrary->forumRecount( $forum );
|
||||
}
|
||||
|
||||
$this->cache->rebuildCache( 'stats', 'global' );
|
||||
}
|
||||
|
||||
$moderatorLibrary->addModerateLog( "", "", "", implode( ',', $_ids ), sprintf( $this->lang->words['multi_post_delete'], implode( ', ', $_ids ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_permadelete'], $posts, $topics ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file rssimport.php Task to import RSS feeds defined in the ACP
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-05-20 00:17:42 -0400 (Fri, 20 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8847 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,154 +1,154 @@
|
||||
<?php
|
||||
/**
|
||||
* @file updateviews.php Task to update the topic views from the temporary table
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-05-12 22:28:10 -0400 (Thu, 12 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8754 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to update the topic views from the temporary table
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
/* Update delayed? */
|
||||
if ( ! $this->settings['update_topic_views_immediately'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Attempt to prevent timeout...
|
||||
//-----------------------------------------
|
||||
|
||||
$timeStart = time();
|
||||
$ids = array();
|
||||
$complete = true;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get SQL query
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'views_tid, COUNT(*) as topicviews',
|
||||
'from' => 'topic_views',
|
||||
'group' => 'views_tid',
|
||||
) );
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch( $o ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Update...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->update( 'topics', 'views=views+' . intval( $r['topicviews'] ), "tid=" . intval($r['views_tid']), false, true );
|
||||
|
||||
$ids[ $r['views_tid'] ] = $r['views_tid'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Running longer than 30 seconds?
|
||||
//-----------------------------------------
|
||||
|
||||
if( time() - $timeStart > 30 )
|
||||
{
|
||||
$complete = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete from table
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$complete )
|
||||
{
|
||||
if( count($ids) )
|
||||
{
|
||||
$this->DB->delete( 'topic_views', 'views_tid IN(' . implode( ',', $ids ) . ')' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->delete( 'topic_views' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_updateviews'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file updateviews.php Task to update the topic views from the temporary table
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-05-12 22:28:10 -0400 (Thu, 12 May 2011) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 8754 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to update the topic views from the temporary table
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
/* Update delayed? */
|
||||
if ( ! $this->settings['update_topic_views_immediately'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Attempt to prevent timeout...
|
||||
//-----------------------------------------
|
||||
|
||||
$timeStart = time();
|
||||
$ids = array();
|
||||
$complete = true;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get SQL query
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'views_tid, COUNT(*) as topicviews',
|
||||
'from' => 'topic_views',
|
||||
'group' => 'views_tid',
|
||||
) );
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch( $o ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Update...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->update( 'topics', 'views=views+' . intval( $r['topicviews'] ), "tid=" . intval($r['views_tid']), false, true );
|
||||
|
||||
$ids[ $r['views_tid'] ] = $r['views_tid'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Running longer than 30 seconds?
|
||||
//-----------------------------------------
|
||||
|
||||
if( time() - $timeStart > 30 )
|
||||
{
|
||||
$complete = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete from table
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$complete )
|
||||
{
|
||||
if( count($ids) )
|
||||
{
|
||||
$this->DB->delete( 'topic_views', 'views_tid IN(' . implode( ',', $ids ) . ')' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->delete( 'topic_views' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_updateviews'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -1,101 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* @file weeklydigest.php Task to send out the weekly digest emails
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9373 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to send out the weekly digest emails
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Send daily digests...
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/digest.php', 'digestLibrary', 'forums' );
|
||||
$digest = new $classToLoad( $this->registry );
|
||||
|
||||
$digest->runDigest( 'weekly', 'topic' );
|
||||
|
||||
$digest->runDigest( 'weekly', 'forum' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_weeklydigest'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file weeklydigest.php Task to send out the weekly digest emails
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to send out the weekly digest emails
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Send daily digests on a Sunday...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strtolower( date('D') ) == 'sun')
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
|
||||
$_like = classes_like::bootstrap( 'forums','topics' );
|
||||
$_like->sendDigestNotifications( 'weekly', 500 );
|
||||
|
||||
$_like = classes_like::bootstrap( 'forums','forums' );
|
||||
$_like->sendDigestNotifications( 'weekly', 500 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_weeklydigest'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user