Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -1,20 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Deactivate expired announcements
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 7003 $
* @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' ) )
@@ -23,65 +17,51 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to expire announcements
*
*/
class task_item
{
/**
* Parent task manager class
* Object that stores the parent task manager class
*
* @var object
* @var $class
*/
protected $class;
/**
* This task data
* Array that stores the task data
*
* @var array
* @var $task
*/
protected $task = array();
/**
* Prevent logging
*
* @var boolean
*/
protected $restrict_log = false;
protected $task = array();
/**
* Registry Object Shortcuts
*
* @var object
*
* @var $registry
* @var $lang
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**
* Constructor
*
* @param object ipsRegistry reference
* @param object Parent task class
* @param array This task data
* @return void
* @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->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->class = $class;
$this->task = $task;
}
@@ -89,7 +69,7 @@ class task_item
/**
* Run this task
*
* @return void
* @return @e void
*/
public function runTask()
{
@@ -1,21 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Prunes subscribed topics
* Last Updated: $LastChangedDate: 2010-07-07 08:09:48 -0400 (Wed, 07 Jul 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 6609 $
* @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' ) )
@@ -24,75 +17,66 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to prune daily old topic subscriptions
*
*/
class task_item
{
/**
* Parent task manager class
*
* @access protected
* @var object
*/
* Object that stores the parent task manager class
*
* @var $class
*/
protected $class;
/**
* This task data
*
* @access protected
* @var array
*/
protected $task = array();
/**
* Prevent logging
*
* @access protected
* @var boolean
*/
protected $restrict_log = false;
/**
* Registry Object Shortcuts
*/
* 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 $request;
protected $lang;
protected $member;
protected $cache;
/**
* Constructor
*
* @access public
* @param object ipsRegistry reference
* @param object Parent task class
* @param array This task data
* @return void
*/
* 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->request =& $this->registry->fetchRequest();
$this->settings =& $this->registry->fetchSettings();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @access public
* @return void
*/
* Run this task
*
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
@@ -107,30 +91,32 @@ class task_item
if ( $this->settings['subs_autoprune'] > 0 )
{
$time = time() - ($this->settings['subs_autoprune'] * 86400);
$this->DB->build( array( 'select' => 'tr.trid',
'from' => array( 'tracker' => 'tr' ),
'where' => 't.last_post < ' . $time,
'add_join' => array(
array( 'from' => array( 'topics' => 't' ),
'where' => 't.tid=tr.topic_id',
'type' => 'left'
)
)
$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['trid'];
$trids[] = $r['like_lookup_id'];
}
if (count($trids) > 0)
{
$this->DB->delete( 'tracker', "trid IN (" . implode( ",", $trids ) . ")" );
$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) );
$deleted = intval( count($trids) );
}
//-----------------------------------------
@@ -140,7 +126,7 @@ class task_item
$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->build( array( "select" => '*', 'from' => 'attachments', 'where' => "attach_rel_id=0 AND attach_date < {$time_cutoff}" ) );
$this->DB->execute();
while( $killmeh = $this->DB->fetch() )
@@ -157,7 +143,7 @@ class task_item
$deadid[] = $killmeh['attach_id'];
}
$_attach_count = count( $deadid );
$_attach_count = count( $deadid );
if ( $_attach_count )
{
@@ -177,7 +163,7 @@ class task_item
/* 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'",
'where' => 'pinned=0 AND moved_on < ' . $time . " AND state='link'",
'limit' => array( 0, 150 ) ) );
$this->DB->execute();
@@ -201,7 +187,7 @@ class task_item
foreach( $fids as $f => $count )
{
/* remove the count */
$this->DB->force_data_type = array( 'topics' => 'int' );
$this->DB->setDataType( 'topics', 'int' );
$this->DB->update( 'forums', array( 'topics' => 'minus:' . $count ), 'id=' . intval( $f ) );
}
}
@@ -235,5 +221,4 @@ class task_item
$this->class->unlockTask( $this->task );
}
}
@@ -1,20 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Send the daily digest emails
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 7003 $
* @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' ) )
@@ -23,65 +17,51 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to send out the daily digest emails
*
*/
class task_item
{
/**
* Parent task manager class
* Object that stores the parent task manager class
*
* @var object
* @var $class
*/
protected $class;
/**
* This task data
* Array that stores the task data
*
* @var array
* @var $task
*/
protected $task = array();
/**
* Prevent logging
*
* @var boolean
*/
protected $restrict_log = false;
protected $task = array();
/**
* Registry Object Shortcuts
*
* @var object
*
* @var $registry
* @var $lang
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**
* Constructor
*
* @param object ipsRegistry reference
* @param object Parent task class
* @param array This task data
* @return void
* @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->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->registry = $registry;
$this->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
@@ -89,7 +69,7 @@ class task_item
/**
* Run this task
*
* @return void
* @return @e void
*/
public function runTask()
{
@@ -101,13 +81,10 @@ class task_item
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/digest.php', 'digestLibrary', 'forums' );
$digest = new $classToLoad( $this->registry );
$digest->digest_time = 'daily';
$digest->digest_type = 'topic';
$digest->runDigest();
$digest->runDigest( 'daily', 'topic' );
$digest->digest_time = 'daily';
$digest->digest_type = 'forum';
$digest->runDigest();
$digest->runDigest( 'daily', 'forum' );
//-----------------------------------------
// Log to log table - modify but dont delete
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -0,0 +1,180 @@
<?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 );
}
}
@@ -1,20 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Update the rss import
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 7003 $
* @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!
* $Author: bfarber $
* @since -
* $LastChangedDate: 2011-05-20 00:17:42 -0400 (Fri, 20 May 2011) $
* @version v3.2.3
* $Revision: 8847 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -23,38 +17,48 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to import RSS feeds defined in the ACP
*
*/
class task_item
{
/**
* Parent task manager class
* Integer used to limit the number
* of RSS feeds parsed per cycle
*
* @var object
* @var $limit
*/
protected $class;
/**
* This task data
*
* @var array
*/
protected $task = array();
/**
* Prevent logging
*
* @var boolean
*/
protected $restrict_log = false;
protected $limit = 10;
/**
* Limit
* Object that stores the parent task manager class
*
* @var integer
* @var $class
*/
protected $limit = 10;
protected $class;
/**
* Array that stores the task data
*
* @var $task
*/
protected $task = array();
/**
* Registry Object Shortcuts
*
* @var $registry
* @var $DB
* @var $settings
* @var $request
* @var $lang
* @var $member
* @var $memberData
* @var $cache
* @var $caches
*/
protected $registry;
protected $DB;
@@ -69,24 +73,24 @@ class task_item
/**
* Constructor
*
* @param object ipsRegistry reference
* @param object Parent task class
* @param array This task data
* @return void
* @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->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->class = $class;
$this->task = $task;
}
@@ -94,18 +98,14 @@ class task_item
/**
* Run this task
*
* @return void
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// INIT
//-----------------------------------------
/* Init vars */
$feeds_to_update = array();
$time = time();
$t_minus_30 = time() - ( 30 * 60 );
@@ -115,17 +115,15 @@ class task_item
//-----------------------------------------
$this->DB->build( array( 'select' => '*',
'from' => 'rss_import',
'where' => 'rss_import_enabled=1 AND rss_import_last_import <= '.$t_minus_30,
'order' => 'rss_import_last_import ASC',
'limit' => array( $this->limit )
) );
'from' => 'rss_import',
'where' => 'rss_import_enabled=1 AND rss_import_last_import <= '.$t_minus_30,
'order' => 'rss_import_last_import ASC',
'limit' => array( $this->limit )
) );
$rss_main_query = $this->DB->execute();
if ( $this->DB->getTotalRows( $rss_main_query ) )
{
define( 'IN_ACP', 1 );
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_admin/rss/import.php', 'admin_forums_rss_import' );
$rss = new $classToLoad();
$rss->makeRegistryShortcuts( $this->registry );
@@ -148,7 +146,7 @@ class task_item
// Do the update now...
//-----------------------------------------
if ( count( $feeds_to_update ) )
if ( count($feeds_to_update) )
{
$rss->rssImportRebuildCache( implode( ",", $feeds_to_update), 0, 1 );
}
@@ -1,21 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Update topic views
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 5713 $
* @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' ) )
@@ -24,83 +17,69 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to update the topic views from the temporary table
*
*/
class task_item
{
/**
* Parent task manager class
*
* @access protected
* @var object
*/
* Object that stores the parent task manager class
*
* @var $class
*/
protected $class;
/**
* This task data
*
* @access protected
* @var array
*/
protected $task = array();
/**
* Prevent logging
*
* @access protected
* @var boolean
*/
protected $restrict_log = false;
/**
* Registry Object Shortcuts
*/
* 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 $request;
protected $lang;
protected $member;
protected $cache;
/**
* Constructor
*
* @access public
* @param object ipsRegistry reference
* @param object Parent task class
* @param array This task data
* @return void
*/
* 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->request =& $this->registry->fetchRequest();
$this->settings =& $this->registry->fetchSettings();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @access public
* @return void
*/
* Run this task
*
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Enabled?
//-----------------------------------------
/* Update delayed? */
if ( ! $this->settings['update_topic_views_immediately'] )
{
//-----------------------------------------
@@ -129,7 +108,7 @@ class task_item
$this->DB->update( 'topics', 'views=views+' . intval( $r['topicviews'] ), "tid=" . intval($r['views_tid']), false, true );
$ids[] = $r['views_tid'];
$ids[ $r['views_tid'] ] = $r['views_tid'];
//-----------------------------------------
// Running longer than 30 seconds?
@@ -162,6 +141,7 @@ class task_item
// 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'] );
}
@@ -171,5 +151,4 @@ class task_item
$this->class->unlockTask( $this->task );
}
}
@@ -1,20 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Send the weekly digest emails
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 7003 $
* @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' ) )
@@ -23,65 +17,51 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to send out the weekly digest emails
*
*/
class task_item
{
/**
* Parent task manager class
* Object that stores the parent task manager class
*
* @var object
* @var $class
*/
protected $class;
/**
* This task data
* Array that stores the task data
*
* @var array
* @var $task
*/
protected $task = array();
/**
* Prevent logging
*
* @var boolean
*/
protected $restrict_log = false;
protected $task = array();
/**
* Registry Object Shortcuts
*
* @var object
*
* @var $registry
* @var $lang
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**
* Constructor
*
* @param object ipsRegistry reference
* @param object Parent task class
* @param array This task data
* @return void
* @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->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->class = $class;
$this->task = $task;
}
@@ -89,7 +69,7 @@ class task_item
/**
* Run this task
*
* @return void
* @return @e void
*/
public function runTask()
{
@@ -101,13 +81,10 @@ class task_item
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/digest.php', 'digestLibrary', 'forums' );
$digest = new $classToLoad( $this->registry );
$digest->digest_time = 'weekly';
$digest->digest_type = 'topic';
$digest->runDigest();
$digest->digest_time = 'weekly';
$digest->digest_type = 'forum';
$digest->runDigest();
$digest->runDigest( 'weekly', 'topic' );
$digest->runDigest( 'weekly', 'forum' );
//-----------------------------------------
// Log to log table - modify but dont delete