Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Profile
|
||||
* @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 19 Jul 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\front\members;
|
||||
@@ -171,6 +170,12 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
/* What tabs are available? */
|
||||
$tabs = array( 'activity' => 'users_activity_feed' );
|
||||
|
||||
if ( \IPS\Settings::i()->clubs )
|
||||
{
|
||||
$tabs['clubs'] = 'users_clubs';
|
||||
}
|
||||
|
||||
foreach( $mainFields as $group => $fields )
|
||||
{
|
||||
foreach( $fields as $field => $value )
|
||||
@@ -262,6 +267,27 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
$tabContents = \IPS\Theme::i()->getTemplate( 'profile' )->profileActivity( $this->member, $latestActivity, $statusForm );
|
||||
}
|
||||
elseif ( $tab == 'clubs' )
|
||||
{
|
||||
if ( !\IPS\Settings::i()->clubs )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2C138/J', 403, '' );
|
||||
}
|
||||
|
||||
/* Get All User Clubs */
|
||||
$baseUrl = \IPS\Request::i()->url()->setQueryString('tab', 'clubs');
|
||||
$perPage = 24;
|
||||
$page = isset( \IPS\Request::i()->page ) ? intval( \IPS\Request::i()->page ) : 1;
|
||||
$allClubs = \IPS\Member\Club::clubs( \IPS\Member::loggedIn(), array( ( $page - 1 ) * $perPage, $perPage ), 'last_activity', $this->member );
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $baseUrl, ceil( $allClubs->count( TRUE ) / $perPage ), $page, $perPage );
|
||||
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'styles/clubs.css', 'core', 'front' ) );
|
||||
if ( \IPS\Theme::i()->settings['responsive'] )
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'styles/clubs_responsive.css', 'core', 'front' ) );
|
||||
}
|
||||
$tabContents = \IPS\Theme::i()->getTemplate( 'profile' )->profileClubs( $this->member, $allClubs, $pagination );
|
||||
}
|
||||
elseif ( mb_substr( $tab, 0, 6 ) == 'field_' )
|
||||
{
|
||||
$fieldId = mb_substr( $tab, 6 );
|
||||
@@ -344,6 +370,39 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
$addWarningUrl = $addWarningUrl->setQueryString( 'ref', \IPS\Request::i()->wr );
|
||||
}
|
||||
|
||||
/* Set JSON-LD output */
|
||||
\IPS\Output::i()->jsonLd['profile'] = array(
|
||||
'@context' => "http://schema.org",
|
||||
'@type' => "ProfilePage",
|
||||
'url' => (string) $this->member->url(),
|
||||
'name' => htmlspecialchars( $this->member->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'primaryImageOfPage' => array(
|
||||
'@type' => "ImageObject",
|
||||
'contentUrl' => (string) $this->member->get_photo(),
|
||||
'representativeOfPage' => true,
|
||||
'thumbnail' => array(
|
||||
'@type' => "ImageObject",
|
||||
'contentUrl' => (string) $this->member->get_photo( TRUE ),
|
||||
)
|
||||
),
|
||||
'thumbnailUrl' => (string) $this->member->get_photo( TRUE ),
|
||||
'image' => (string) $this->member->get_photo(),
|
||||
'relatedLink' => (string) \IPS\Http\Url::internal( "app=core&module=members&controller=profile&do=content&id={$this->member->member_id}", "front", "profile_content", array( $this->member->members_seo_name ) ),
|
||||
'dateCreated' => $this->member->joined->format( \IPS\DateTime::ISO8601 ),
|
||||
'interactionStatistic' => array(
|
||||
array(
|
||||
"@type" => "InteractionCounter",
|
||||
"interactionType" => "http://schema.org/CommentAction",
|
||||
'userInteractionCount' => $this->member->member_posts
|
||||
),
|
||||
array(
|
||||
"@type" => "InteractionCounter",
|
||||
"interactionType" => "http://schema.org/ViewAction",
|
||||
'userInteractionCount' => $this->member->members_profile_views
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/* Output */
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_profile.js', 'core' ) );
|
||||
@@ -507,7 +566,8 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
else
|
||||
{
|
||||
/* Display */
|
||||
$title = ( isset( \IPS\Request::i()->page ) and \IPS\Request::i()->page > 1 ) ? \IPS\Member::loggedIn()->language()->addToStack( 'title_with_page_number', FALSE, array( 'sprintf' => array( $this->member->name, \IPS\Request::i()->page ) ) ) : $this->member->name;
|
||||
$profileTitle = \IPS\Member::loggedIn()->language()->addToStack( 'members_content', FALSE, array( 'sprintf' => array( $this->member->name ) ) );
|
||||
$title = ( isset( \IPS\Request::i()->page ) and \IPS\Request::i()->page > 1 ) ? \IPS\Member::loggedIn()->language()->addToStack( 'title_with_page_number', FALSE, array( 'sprintf' => array( $profileTitle, \IPS\Request::i()->page ) ) ) : $profileTitle;
|
||||
\IPS\Output::i()->title = $title;
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'styles/statuses.css' ) );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'profile' )->userContent( $this->member, $types, $currentAppModule, $currentType, (string) $output );
|
||||
@@ -533,22 +593,22 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'profile.css', $class::$application ) );
|
||||
|
||||
if ( in_array( 'IPS\Content\Reputation', class_implements( $class ) ) )
|
||||
if ( \IPS\IPS::classUsesTrait( $class, 'IPS\Content\Reactable' ) )
|
||||
{
|
||||
$types[ $class::$application . '_' . $class::$module ][ mb_strtolower( str_replace( '\\', '_', mb_substr( $class, 4 ) ) ) ] = $class;
|
||||
}
|
||||
|
||||
if ( isset( $class::$commentClass ) and in_array( 'IPS\Content\Reputation', class_implements( $class::$commentClass ) ) )
|
||||
if ( isset( $class::$commentClass ) and \IPS\IPS::classUsesTrait( $class::$commentClass, 'IPS\Content\Reactable' ) )
|
||||
{
|
||||
$types[ $class::$application . '_' . $class::$module ][ mb_strtolower( str_replace( '\\', '_', mb_substr( $class::$commentClass, 4 ) ) ) ] = $class::$commentClass;
|
||||
}
|
||||
|
||||
if ( isset( $class::$reviewClass ) and in_array( 'IPS\Content\Reputation', class_implements( $class::$reviewClass ) ) )
|
||||
if ( isset( $class::$reviewClass ) and \IPS\IPS::classUsesTrait( $class::$reviewClass, 'IPS\Content\Reactable' ) )
|
||||
{
|
||||
$types[ $class::$application . '_' . $class::$module ][ mb_strtolower( str_replace( '\\', '_', mb_substr( $class::$reviewClass, 4 ) ) ) ] = $class::$reviewClass;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* What type are we looking at? */
|
||||
$currentAppModule = NULL;
|
||||
$currentType = NULL;
|
||||
@@ -589,9 +649,9 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$table->sortBy = 'rep_date';
|
||||
$table->joins = array(
|
||||
array(
|
||||
'select' => "core_reputation_index.id AS rep_id, core_reputation_index.rep_date, core_reputation_index.rep_rating, core_reputation_index.member_received as rep_member_received, core_reputation_index.member_id as rep_member",
|
||||
'select' => "core_reputation_index.id AS rep_id, core_reputation_index.rep_date, core_reputation_index.rep_rating, core_reputation_index.member_received as rep_member_received, core_reputation_index.member_id as rep_member, core_reputation_index.reaction as rep_reaction",
|
||||
'from' => 'core_reputation_index',
|
||||
'where' => array( "core_reputation_index.type_id=" . $currentClass::$databaseTable . "." . $currentClass::$databasePrefix . $currentClass::$databaseColumnId . " AND ( core_reputation_index.member_id=? OR core_reputation_index.member_received=? ) AND core_reputation_index.app=? AND core_reputation_index.type=?", $this->member->member_id, $this->member->member_id, $currentClass::$application, $currentClass::$reputationType ),
|
||||
'where' => array( "core_reputation_index.type_id=" . $currentClass::$databaseTable . "." . $currentClass::$databasePrefix . $currentClass::$databaseColumnId . " AND ( core_reputation_index.member_id=? OR core_reputation_index.member_received=? ) AND core_reputation_index.app=? AND core_reputation_index.type=?", $this->member->member_id, $this->member->member_id, $currentClass::$application, $currentClass::reactionType() ),
|
||||
'type' => 'INNER'
|
||||
)
|
||||
);
|
||||
@@ -728,8 +788,12 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
/* Set Session Location */
|
||||
\IPS\Session::i()->setLocation( $this->member->url(), array(), 'loc_editing_profile', array( $this->member->name => FALSE ) );
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
|
||||
if( !count( $form->elements ) )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->genericBlock( \IPS\Member::loggedIn()->language()->addToStack( 'profile_nothing_to_edit' ), NULL, 'ipsPad' );
|
||||
}
|
||||
else if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
|
||||
}
|
||||
@@ -754,7 +818,16 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
/* The basics */
|
||||
$form->addTab( 'profile_edit_basic_tab', 'user');
|
||||
$form->addHeader( 'profile_edit_basic_header' );
|
||||
|
||||
$canChangeTitle = ( \IPS\Settings::i()->post_titlechange != -1 and ( isset( \IPS\Settings::i()->post_titlechange ) and $this->member->member_posts >= \IPS\Settings::i()->post_titlechange ) );
|
||||
$canChangeBirthday = ( \IPS\Settings::i()->profile_birthday_type !== 'none' );
|
||||
$canEnableDisableStatuses = ( \IPS\Settings::i()->profile_comments and $this->member->canAccessModule( \IPS\Application\Module::get( 'core', 'status' ) ) AND !$this->member->members_bitoptions['bw_no_status_update'] );
|
||||
|
||||
if( $canChangeTitle or $canChangeBirthday or $canEnableDisableStatuses )
|
||||
{
|
||||
$form->addHeader( 'profile_edit_basic_header' );
|
||||
}
|
||||
|
||||
if( \IPS\Settings::i()->post_titlechange != -1 and ( isset( \IPS\Settings::i()->post_titlechange ) and $this->member->member_posts >= \IPS\Settings::i()->post_titlechange ) )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'member_title', $this->member->member_title, FALSE, array( 'maxLength' => 64 ) ) );
|
||||
@@ -770,7 +843,22 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
'YY' => \IPS\Theme::i()->getTemplate( 'members', 'core', 'global' )->bdayForm_year( $element->name, $element->value, $element->error ),
|
||||
'YYYY' => \IPS\Theme::i()->getTemplate( 'members', 'core', 'global' )->bdayForm_year( $element->name, $element->value, $element->error ),
|
||||
) );
|
||||
} ) ) );
|
||||
} ), function( $val )
|
||||
{
|
||||
$date = $val['day'];
|
||||
$month = $val['month'];
|
||||
$year = $val['year'];
|
||||
|
||||
try
|
||||
{
|
||||
new \IPS\DateTime( $year."-".$month."-" . $date );
|
||||
}
|
||||
catch ( \Exception $e)
|
||||
{
|
||||
throw new \InvalidArgumentException( 'invalid_bdate') ;
|
||||
}
|
||||
}
|
||||
) );
|
||||
if ( \IPS\Settings::i()->profile_birthday_type == 'private' )
|
||||
{
|
||||
$form->addMessage( 'profile_birthday_display_private', 'ipsMessage ipsMessage_info' );
|
||||
@@ -933,6 +1021,9 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$this->member->signature = $values['signature'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset Profile Complete flag in case this was an optional step */
|
||||
$this->member->members_bitoptions['profile_completed'] = FALSE;
|
||||
|
||||
/* Save */
|
||||
\IPS\Db::i()->replace( 'core_pfields_content', $profileFields );
|
||||
@@ -959,7 +1050,7 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$toggles = array( 'custom' => array( 'member_photo_upload' ), 'url' => array( 'member_photo_url' ) );
|
||||
$extra = array();
|
||||
$options = array();
|
||||
$defaultType = $this->member->pp_photo_type;
|
||||
$defaultType = ( $this->member->pp_photo_type == 'letter' ) ? 'none' : $this->member->pp_photo_type;
|
||||
|
||||
/* Can we upload? */
|
||||
if ( $photoVars[0] )
|
||||
@@ -996,8 +1087,21 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
}
|
||||
|
||||
/* And of course we can always not have a photo */
|
||||
$options['none'] = 'member_photo_none';
|
||||
/* And of course we can always not have a photo... except when we can't */
|
||||
$photoRequired = FALSE;
|
||||
foreach( \IPS\Member\ProfileStep::loadAll() AS $step )
|
||||
{
|
||||
if ( $step->completion_act === 'photo' AND $step->required )
|
||||
{
|
||||
$photoRequired = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $photoRequired === FALSE )
|
||||
{
|
||||
$options['none'] = 'member_photo_none';
|
||||
}
|
||||
|
||||
/* iOS doesn't like upload forms being hidden by a toggle; and it makes sense if we do not have a profile photo to show the upload as the selected option */
|
||||
if ( $defaultType == 'none' and $photoVars[0] )
|
||||
@@ -1084,6 +1188,7 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
break;
|
||||
|
||||
case 'none':
|
||||
$this->member->pp_photo_type = NULL;
|
||||
$this->member->pp_main_photo = NULL;
|
||||
$this->member->members_bitoptions['bw_disable_gravatar'] = 1;
|
||||
$this->member->photo_last_update = NULL;
|
||||
@@ -1101,6 +1206,9 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$obj->save( array( 'profilesync_photo' => TRUE ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset Profile Complete flag in case this was an optional step */
|
||||
$this->member->members_bitoptions['profile_completed'] = FALSE;
|
||||
|
||||
$this->member->save();
|
||||
|
||||
@@ -1273,31 +1381,42 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Rep Status/Comment
|
||||
* React to a status / comment
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function rep()
|
||||
{
|
||||
protected function react()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
try
|
||||
{
|
||||
$item = ( \IPS\Request::i()->type == 'status' ) ? \IPS\core\Statuses\Status::load( \IPS\Request::i()->status ) : \IPS\core\Statuses\Reply::load( \IPS\Request::i()->reply );
|
||||
|
||||
$type = intval( \IPS\Request::i()->rep ) === 1 ? 1 : -1;
|
||||
$item->giveReputation( $type );
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
|
||||
if ( !isset( \IPS\Request::i()->reaction ) )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->reputationMini( $item->reputation(), $item->canGiveReputation( 1 ), $item->canGiveReputation( -1 ), $item->url('showRep'), $item->url('rep') ) );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->reputationMini( $item );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( $item->url() );
|
||||
$item->react( \IPS\Content\Reaction::load( \IPS\Request::i()->reaction ) );
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( array(
|
||||
'status' => 'ok',
|
||||
'count' => count( $item->reactions() ),
|
||||
'score' => $item->reactionCount(),
|
||||
'blurb' => ( \IPS\Settings::i()->reaction_count_display == 'count' ) ? '' : \IPS\Theme::i()->getTemplate( 'global', 'core' )->reactionBlurb( $item )
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( $item->url() );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( \DomainException $e )
|
||||
catch( \DomainException $e )
|
||||
{
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
@@ -1305,27 +1424,100 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->error( $e->getMessage(), '1C138/2', 403, '' );
|
||||
\IPS\Output::i()->error( $e->getMessage(), '1C138/H', 403, '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Comment/Review Rep
|
||||
* Unreact to a status / comment
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function showRep()
|
||||
protected function unreact()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
try
|
||||
{
|
||||
$item = ( \IPS\Request::i()->type == 'status' ) ? \IPS\core\Statuses\Status::load( \IPS\Request::i()->status ) : \IPS\core\Statuses\Reply::load( \IPS\Request::i()->reply );
|
||||
$item->removeReaction();
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( array(
|
||||
'status' => 'ok',
|
||||
'count' => count( $item->reactions() ),
|
||||
'score' => $item->reactionCount(),
|
||||
'blurb' => ( \IPS\Settings::i()->reaction_count_display == 'count' ) ? '' : \IPS\Theme::i()->getTemplate( 'global', 'core' )->reactionBlurb( $item )
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( $item->url() );
|
||||
}
|
||||
}
|
||||
catch( \DomainException $e )
|
||||
{
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( array( 'error' => \IPS\Member::loggedIn()->language()->addToStack( $e->getMessage() ) ), 403 );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->error( $e->getMessage(), '1C138/I', 403, '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Reactions
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function showReactions()
|
||||
{
|
||||
try
|
||||
{
|
||||
$item = ( \IPS\Request::i()->type == 'status' ) ? \IPS\core\Statuses\Status::load( \IPS\Request::i()->status ) : \IPS\core\Statuses\Reply::load( \IPS\Request::i()->reply );
|
||||
|
||||
\IPS\Output::i()->output = $item->reputationTable();
|
||||
|
||||
$tabs = array();
|
||||
$tabs['all'] = \IPS\Member::loggedIn()->language()->addToStack('all');
|
||||
foreach( \IPS\Content\Reaction::roots() AS $reaction )
|
||||
{
|
||||
$tabs[ $reaction->id ] = $reaction->_title;
|
||||
}
|
||||
|
||||
$activeTab = 'all';
|
||||
if ( isset( \IPS\Request::i()->reaction ) )
|
||||
{
|
||||
$activeTab = \IPS\Request::i()->reaction;
|
||||
}
|
||||
|
||||
$url = $item->url('showReactions');
|
||||
$url = $url->setQueryString( 'changed', 1 );
|
||||
|
||||
if ( $activeTab !== 'all' )
|
||||
{
|
||||
$url = $url->setQueryString( 'reaction', $activeTab );
|
||||
}
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() AND isset( \IPS\Request::i()->changed ) )
|
||||
{
|
||||
\IPS\Output::i()->output = $item->reactionTable( $activeTab !== 'all' ? $activeTab : NULL, $url, 'reaction', FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $activeTab, $item->reactionTable( $activeTab !== 'all' ? $activeTab : NULL ), $url, 'reaction', FALSE );
|
||||
}
|
||||
}
|
||||
catch ( \LogicException $e )
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'cannot_view_reputation', '2C138/8', 403, '' );
|
||||
\IPS\Output::i()->error( 'node_error', '2S136/18', 404, '' );
|
||||
}
|
||||
catch( \DomainException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2S136/19', 403, '' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1442,6 +1634,10 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
$this->member->pp_cover_photo = (string) $photo->file;
|
||||
$this->member->pp_cover_offset = (int) $photo->offset;
|
||||
|
||||
/* Reset Profile Complete flag in case this was an optional step */
|
||||
$this->member->members_bitoptions['profile_completed'] = FALSE;
|
||||
|
||||
$this->member->save();
|
||||
}
|
||||
|
||||
@@ -1454,12 +1650,20 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '1C138/G', 403, '' );
|
||||
}
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_dnames_change', $this->member->url()->setQueryString( 'do', 'namehistory' ), array( 'dname_member_id=?', $this->member->member_id ) );
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'profile' ), 'nameHistoryTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'profile' ), 'nameHistoryRows' );
|
||||
$table->sortBy = 'dname_date';
|
||||
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_member_history', $this->member->url()->setQueryString( 'do', 'namehistory' ), array( 'log_member=? AND log_app=? AND log_type=?', $this->member->member_id, 'core', 'display_name' ) );
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'members', 'core', 'global' ), 'nameHistoryTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'members', 'core', 'global' ), 'nameHistoryRows' );
|
||||
$table->sortBy = 'log_date';
|
||||
$table->sortDirection = 'desc';
|
||||
|
||||
$table->parsers = array(
|
||||
'log_data' => function( $val )
|
||||
{
|
||||
return json_decode( $val, TRUE );
|
||||
}
|
||||
);
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addtoStack( 'members_dname_history', FALSE, array( 'sprintf' => ( $this->member->name ) ) );
|
||||
\IPS\Output::i()->output = $table;
|
||||
|
||||
@@ -1474,4 +1678,26 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
return $this->member->coverPhoto();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide a status reply or status update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function hide()
|
||||
{
|
||||
\IPS\Request::i()->action = 'hide';
|
||||
return $this->moderate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply or status update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function delete()
|
||||
{
|
||||
\IPS\Request::i()->action = 'delete';
|
||||
return $this->moderate();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user