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,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Update the profile views counter
|
||||
* Last Updated: $LastChangedDate: 2010-11-17 08:50:12 -0500 (Wed, 17 Nov 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 Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 7206 $
|
||||
* @file twitfacesync.php Task to update data from Twitter and Facebook (photos, statuses, etc)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-04-19 23:03:31 -0400 (Tue, 19 Apr 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8397 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,69 +17,57 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to update data from Twitter and Facebook (photos, statuses, etc)
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @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
|
||||
* @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;
|
||||
}
|
||||
@@ -94,8 +75,7 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
@@ -106,20 +86,28 @@ class task_item
|
||||
|
||||
if ( IPSLib::fbc_enabled() !== TRUE && IPSLib::twitter_enabled() !== TRUE )
|
||||
{
|
||||
$this->class->appendTaskLog( $this->task, "Nothing to update" );
|
||||
$this->class->unlockTask( $this->task );
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch members
|
||||
// Fetch members / Edit - only complete members
|
||||
// @link http://community.invisionpower.com/tracker/issue-29269-display-names-not-always-shown-in-status-updates
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'member_id',
|
||||
'from' => 'members',
|
||||
'where' => '( (twitter_id != \'\' AND tc_lastsync < ' . $_sync .') OR (fb_uid > 0 AND fb_lastsync < ' . $_sync . ') ) AND last_visit > ' . $_active,
|
||||
'order' => 'last_visit DESC',
|
||||
'limit' => array( 0, 100 ) ) );
|
||||
$this->DB->build( array( 'select' => 'm.member_id',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => '( (m.twitter_id != \'\' AND m.tc_lastsync < ' . $_sync .') OR (m.fb_uid > 0 AND m.fb_lastsync < ' . $_sync . ') ) AND p.partial_id ' . $this->DB->buildIsNull(true) . ' AND m.last_visit > ' . $_active,
|
||||
'order' => 'm.last_visit DESC',
|
||||
'limit' => array( 0, 100 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'members_partial' => 'p' ),
|
||||
'where' => 'p.partial_member_id=m.member_id',
|
||||
'type' => 'left',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
@@ -142,8 +130,8 @@ class task_item
|
||||
/* We have a linked member and options, so check if they haven't sync'd in 24 hours and have been active in the past 90 days... */
|
||||
try
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
|
||||
$facebook = new facebook_connect( ipsRegistry::instance(), null, null, true );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$facebook = new $classToLoad( ipsRegistry::instance(), null, null, true );
|
||||
|
||||
$_member = $facebook->syncMember( $member, $member['fb_token'], $member['fb_uid'] );
|
||||
|
||||
@@ -179,8 +167,8 @@ class task_item
|
||||
if ( ! empty( $member['twitter_id'] ) and ! empty( $member['tc_bwoptions'] ) )
|
||||
{
|
||||
/* We have a linked member and options, so check if they haven't sync'd in 3 hours and have been active in the past 90 days... */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' );
|
||||
$twitter = new twitter_connect( ipsRegistry::instance() );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$twitter = new $classToLoad( ipsRegistry::instance() );
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user