Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

@@ -1,12 +1,11 @@
<?php
/**
* @brief Facebook Profile Sync
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 13 Jun 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\ProfileSync;
@@ -159,20 +158,21 @@ class _Facebook extends ProfileSyncAbstract
* @return \IPS\core\Statuses\Status|null
*/
public function status()
{
{
try
{
$response = \IPS\Http\Url::external( "https://graph.facebook.com/{$this->member->fb_uid}/feed" )->setQueryString( 'access_token', $this->member->fb_token )->request()->get()->decodeJson();
if ( !empty( $response['data'] ) )
{
$statusData = array_shift( $response['data'] );
if( isset( $statusData['message'] ) )
foreach( $response['data'] as $statusData )
{
$status = \IPS\core\Statuses\Status::createItem( $this->member, $this->member->ip_address, new \IPS\DateTime( $statusData['created_time'] ) );
$status->content = $this->_parseStatusText( nl2br( $statusData['message'], FALSE ) );
return $status;
if( isset( $statusData['message'] ) and ! isset( $statusData['story'] ) )
{
$status = \IPS\core\Statuses\Status::createItem( $this->member, $this->member->ip_address, new \IPS\DateTime( $statusData['created_time'] ) );
$status->content = $this->_parseStatusText( nl2br( $statusData['message'], FALSE ) );
return $status;
}
}
}
}
@@ -194,4 +194,15 @@ class _Facebook extends ProfileSyncAbstract
$this->member->fb_token = NULL;
$this->member->save();
}
/**
* Get where clause to determine whether a member account is linked to this service
*
* @param bool $invert Returns clause for members not linked
* @return array|FALSE
*/
public static function memberFilterLinkedWhere( $invert=FALSE )
{
return $invert ? array( 'fb_uid=?', 0 ) : array( 'fb_uid!=?', 0 );
}
}