Version 3.2.3
This commit is contained in:
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: 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 );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user