Version 4.1.19.4
This commit is contained in:
1 parent
2bd5025018
commit
0dc2aee5ed
312 files changed
+53730
-32118
No files matched your search
@@ -135,6 +135,12 @@ class _Digest
|
||||
{
|
||||
$item = $class::load( $follow['follow_rel_id'] );
|
||||
|
||||
/* Check the view permission */
|
||||
if( !$item->canView( $this->member ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach( $item->comments( 5, NULL, 'date', 'asc', NULL, FALSE, \IPS\DateTime::ts( $follow['follow_notify_sent'] ?: $follow['follow_added'] ) ) as $comment )
|
||||
{
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ class _Profanity extends \IPS\Patterns\ActiveRecord implements \JsonSerializable
|
||||
$good = NULL;
|
||||
foreach( $tags AS $tag )
|
||||
{
|
||||
if ( $tag->hasAttribute( 'href' ) )
|
||||
if ( $tag->hasAttribute( 'href' ) and !$tag->hasAttribute( 'data-mentionid' ) )
|
||||
{
|
||||
if ( \IPS\Settings::i()->ipb_url_filter_option == 'none' )
|
||||
{
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Vkontakte Profile Sync
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @since 13 Jun 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\core\ProfileSync;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Facebook Profile Sync
|
||||
*/
|
||||
class _VK extends ProfileSyncAbstract
|
||||
{
|
||||
/**
|
||||
* @brief Login handler key
|
||||
*/
|
||||
public static $loginKey = 'vkontakte';
|
||||
|
||||
/**
|
||||
* @brief Icon
|
||||
*/
|
||||
public static $icon = 'vk';
|
||||
|
||||
/**
|
||||
* Is connected?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function connected()
|
||||
{
|
||||
return ( $this->member->vk_uid and $this->member->vk_token );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get photo
|
||||
*
|
||||
* @return \IPS\Http\Url|null
|
||||
*/
|
||||
public function photo()
|
||||
{
|
||||
try
|
||||
{
|
||||
$response = \IPS\Http\Url::external( "https://api.vk.com/method/users.get?user_id={$this->member->vk_uid}&v=5.29&access_token={$this->member->vk_token}&fields=photo_400_orig" )->request()->get()->decodeJson();
|
||||
if ( isset( $response['response'][0]['photo_400_orig'] ))
|
||||
{
|
||||
$file = \IPS\Http\Url::external( $response['response'][0]['photo_400_orig'] )->import( 'core_Profile' );
|
||||
$photo = \IPS\Image::create( $file->contents() );
|
||||
|
||||
if ( ( $photo->width > $photo->height ) OR ( $photo->height > $photo->width ) )
|
||||
{
|
||||
if ( $photo->width > $photo->height )
|
||||
{
|
||||
$difference = $photo->width - $photo->height;
|
||||
$photo->cropToPoints( ceil( $difference / 2 ), 0, ceil( $photo->width - ( $difference / 2 ) ), $photo->height );
|
||||
$file->replace( (string) $photo );
|
||||
}
|
||||
else if ( $photo->height > $photo->width )
|
||||
{
|
||||
$difference = $photo->height - $photo->width;
|
||||
$photo->cropToPoints( 0, ceil( $difference / 2 ), $photo->width, ceil( $photo->height - ( $difference / 2 ) ) );
|
||||
$file->replace( (string) $photo );
|
||||
}
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cover photo
|
||||
*
|
||||
* @return \IPS\File|NULL
|
||||
*/
|
||||
/*public function cover()
|
||||
{
|
||||
$response = \IPS\Http\Url::external( "https://api.vk.com/method/users.get?user_id={$this->member->vk_uid}&v=5.29&access_token={$this->member->vk_token}&fields=photo_100" )->request()->get()->decodeJson();
|
||||
if ( isset( $response['response'][0]['photo_100'] ) )
|
||||
{
|
||||
return \IPS\Http\Url::external( $response['response'][0]['photo_100'] )->import( 'core_Profile' );
|
||||
}
|
||||
return NULL;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Get name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function name()
|
||||
{
|
||||
try
|
||||
{
|
||||
$response = \IPS\Http\Url::external( "https://api.vk.com/method/users.get?user_id={$this->member->vk_uid}&v=5.29&access_token={$this->member->vk_token}" )->request()->get()->decodeJson();
|
||||
if ( isset( $response['response'][0]['first_name'], $response['response'][0]['last_name'] ) )
|
||||
{
|
||||
return $response['response'][0]['first_name'].' '.$response['response'][0]['last_name'];
|
||||
}
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
*
|
||||
* @return \IPS\core\Statuses\Status|null
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
try
|
||||
{
|
||||
$response = \IPS\Http\Url::external( "https://api.vk.com/method/users.get?user_id={$this->member->vk_uid}&v=5.29&access_token={$this->member->vk_token}&fields=status" )->request()->get()->decodeJson();
|
||||
if ( !empty( $response['response'][0]['status'] ) )
|
||||
{
|
||||
|
||||
$status = \IPS\core\Statuses\Status::createItem( $this->member, $this->member->ip_address, new \IPS\DateTime( ) );
|
||||
$status->content = nl2br( $response['response'][0]['status'], FALSE );
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e ) { }
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disassociate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _disassociate()
|
||||
{
|
||||
$this->member->vk_uid = 0;
|
||||
$this->member->vk_token = NULL;
|
||||
$this->member->save();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -704,17 +704,6 @@ class _Install
|
||||
'lang_id' => 1,
|
||||
'lang_short' => $locale,
|
||||
'lang_title' => "English (USA)",
|
||||
'lang_default' => 0,
|
||||
'lang_isrtl' => 0,
|
||||
'lang_protected' => 1,
|
||||
'lang_order' => 2
|
||||
)
|
||||
);
|
||||
|
||||
\IPS\Db::i()->insert( 'core_sys_lang', array(
|
||||
'lang_id' => 2,
|
||||
'lang_short' => 'ru_RU',
|
||||
'lang_title' => "Русский (RU)",
|
||||
'lang_default' => 1,
|
||||
'lang_isrtl' => 0,
|
||||
'lang_protected' => 1,
|
||||
|
||||
@@ -781,32 +781,6 @@ class _Upgrade
|
||||
*/
|
||||
protected function step5( $data )
|
||||
{
|
||||
if(!\IPS\Db::i()->select( 'lang_id', 'core_sys_lang', 'lang_short LIKE "ru_RU%"')->count()) {
|
||||
|
||||
$max = \IPS\Db::i()->select( 'MAX(lang_order)', 'core_sys_lang' )->first();
|
||||
/* Insert the actual language */
|
||||
|
||||
$insertId = \IPS\Db::i()->insert( 'core_sys_lang', array(
|
||||
'lang_short' => 'ru_RU',
|
||||
'lang_title' => "Русский (RU)",
|
||||
'lang_isrtl' => 0,
|
||||
'lang_order' => ++$max
|
||||
)
|
||||
);
|
||||
|
||||
/* Copy over language strings */
|
||||
$default = \IPS\Lang::defaultLanguage();
|
||||
$prefix = \IPS\Db::i()->prefix;
|
||||
$defaultStmt = \IPS\Db::i()->prepare( "INSERT INTO `{$prefix}core_sys_lang_words` ( `lang_id`, `word_app`, `word_key`, `word_default`, `word_custom`, `word_default_version`, `word_custom_version`, `word_js`, `word_export` ) SELECT {$insertId} AS `lang_id`, `word_app`, `word_key`, `word_default`, NULL AS `word_custom`, `word_default_version`, NULL AS `word_custom_version`, `word_js`, `word_export` FROM `{$prefix}core_sys_lang_words` WHERE `lang_id`={$default} AND `word_export`=1" );
|
||||
$defaultStmt->execute();
|
||||
$customStmt = \IPS\Db::i()->prepare( "INSERT INTO `{$prefix}core_sys_lang_words` ( `lang_id`, `word_app`, `word_key`, `word_default`, `word_custom`, `word_default_version`, `word_custom_version`, `word_js`, `word_export` ) SELECT {$insertId} AS `lang_id`, `word_app`, `word_key`, `word_default`, `word_custom`, `word_default_version`, `word_custom_version`, `word_js`, `word_export` FROM `{$prefix}core_sys_lang_words` WHERE `lang_id`={$default} AND `word_export`=0" );
|
||||
$customStmt->execute();
|
||||
|
||||
unset( \IPS\Data\Store::i()->languages );
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
}
|
||||
return $this->appLoop( $data, function( $app ) use ($data)
|
||||
{
|
||||
if ( !isset( $data[2] ) )
|
||||
|
||||
@@ -194,6 +194,7 @@ class _Stream extends \IPS\Node\Model
|
||||
$stream->include_comments = TRUE;
|
||||
$stream->date_relative_days = 365;
|
||||
$stream->date_type = 'relative';
|
||||
$stream->default_view = 'expanded';
|
||||
$stream->baseUrl = \IPS\Http\Url::internal( "app=core&module=discover&controller=streams", 'front', 'discover_all' );
|
||||
return $stream;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user