Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -345,25 +345,7 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
);
|
||||
|
||||
/* Get visitor data */
|
||||
$visitors = array();
|
||||
$visitorInfo = json_decode( $this->member->pp_last_visitors, TRUE );
|
||||
if ( is_array( $visitorInfo ) and $this->member->members_bitoptions['pp_setting_count_visitors'] )
|
||||
{
|
||||
$visitorData = array();
|
||||
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( \IPS\Db::i()->in( 'member_id', array_keys( array_reverse( $visitorInfo, TRUE ) ) ) ) ), 'IPS\Member' ) AS $row )
|
||||
{
|
||||
$visitorData[$row->member_id] = $row;
|
||||
}
|
||||
|
||||
foreach( array_reverse( $visitorInfo, TRUE ) as $id => $time )
|
||||
{
|
||||
if ( isset( $visitorData[$id] ) )
|
||||
{
|
||||
$visitors[$id]['member'] = $visitorData[$id];
|
||||
$visitors[$id]['visit_time'] = $time;
|
||||
}
|
||||
}
|
||||
}
|
||||
$visitors = $this->member->profileVisitors;
|
||||
|
||||
/* Get followers */
|
||||
$followers = $this->member->followers( ( \IPS\Member::loggedIn()->isAdmin() OR \IPS\Member::loggedIn()->member_id === $this->member->member_id ) ? \IPS\Member::FOLLOW_PUBLIC + \IPS\Member::FOLLOW_ANONYMOUS : \IPS\Member::FOLLOW_PUBLIC, array( 'immediate', 'daily', 'weekly' ), NULL, array( 0, 12 ) );
|
||||
@@ -518,10 +500,14 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
/* If we requested a higher page than is allowed, redirect back to last page */
|
||||
$totalResults = $results->count( TRUE );
|
||||
|
||||
if( $totalResults AND ceil( $totalResults / $query->resultsToGet ) < $page )
|
||||
if( ceil( $totalResults / $query->resultsToGet ) < $page )
|
||||
{
|
||||
$highestPage = floor( $totalResults / $query->resultsToGet );
|
||||
\IPS\Output::i()->redirect( \IPS\Request::i()->url()->setQueryString( 'page', $highestPage ?: 1 ), NULL, 303 );
|
||||
|
||||
if ( $highestPage > 0 OR ( $highestPage == 0 AND $page > 1 ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Request::i()->url()->setQueryString( 'page', $highestPage ?: 1 ), NULL, 303 );
|
||||
}
|
||||
}
|
||||
|
||||
$pagination = trim( \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $this->member->url()->setQueryString( array( 'do' => 'content', 'all_activity' => 1 ) ), ceil( $results->count( TRUE ) / $query->resultsToGet ), $page, $query->resultsToGet ) );
|
||||
@@ -692,6 +678,12 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
$object = \IPS\Content\Reaction::load( $reaction['reaction'] );
|
||||
|
||||
/* Don't show disabled reactions */
|
||||
if( !$object->enabled )
|
||||
{
|
||||
throw new \UnderflowException;
|
||||
}
|
||||
|
||||
$reactions['given'][] = array( 'count' => $reaction['count'], 'reaction' => $object );
|
||||
}
|
||||
catch( \UnderflowException $e ){}
|
||||
@@ -703,6 +695,12 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
$object = \IPS\Content\Reaction::load( $reaction['reaction'] );
|
||||
|
||||
/* Don't show disabled reactions */
|
||||
if( !$object->enabled )
|
||||
{
|
||||
throw new \UnderflowException;
|
||||
}
|
||||
|
||||
$reactions['received'][] = array( 'count' => $reaction['count'], 'reaction' => $object );
|
||||
}
|
||||
catch( \UnderflowException $e ){}
|
||||
@@ -738,21 +736,7 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
$this->member->members_bitoptions['pp_setting_count_visitors'] = TRUE;
|
||||
|
||||
/* Get visitor data */
|
||||
$visitors = array();
|
||||
$visitorInfo = json_decode( $this->member->pp_last_visitors, TRUE );
|
||||
if ( is_array( $visitorInfo ) )
|
||||
{
|
||||
foreach( $visitorInfo as $id => $time )
|
||||
{
|
||||
$visitor = \IPS\Member::load( $id );
|
||||
if ( $visitor->member_id )
|
||||
{
|
||||
$visitors[$id]['member'] = $visitor;
|
||||
$visitors[$id]['visit_time'] = $time;
|
||||
}
|
||||
}
|
||||
}
|
||||
$visitors = $this->member->profileVisitors;
|
||||
}
|
||||
|
||||
$this->member->save();
|
||||
@@ -1218,7 +1202,15 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$form->add( new \IPS\Helpers\Form\Url( 'member_photo_url', NULL, FALSE, array( 'file' => 'core_Profile', 'image' => TRUE, 'maxFileSize' => $photoVars[0] ? $photoVars[0] / 1024 : NULL, 'maxDimensions' => array( 'width' => $photoVars[1], 'height' => $photoVars[2] ) ), function( $val ) {
|
||||
if ( $val instanceof \IPS\Http\Url )
|
||||
{
|
||||
$image = \IPS\Image::create( (string) $val->request()->get() );
|
||||
try
|
||||
{
|
||||
$image = \IPS\Image::create( (string) $val->request()->get() );
|
||||
}
|
||||
catch ( \InvalidArgumentException $e )
|
||||
{
|
||||
throw new \DomainException('member_photo_bad_url');
|
||||
}
|
||||
|
||||
if( $image->isAnimatedGif and !$this->member->group['g_upload_animated_photos'] )
|
||||
{
|
||||
throw new \DomainException('member_photo_upload_no_animated');
|
||||
|
||||
Reference in new issue
Block a user