Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -11,6 +11,9 @@
|
||||
namespace IPS\core\modules\front\members;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use IPS\Member;
|
||||
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
@@ -57,12 +60,12 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
if( !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
/* Don't index new empty profiles */
|
||||
if( ! $this->member->member_posts )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex, follow';
|
||||
}
|
||||
|
||||
\IPS\Output::i()->linkTags['canonical'] = (string) $this->member->url();
|
||||
if( ! $this->shouldBeIndexed() )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex, follow';
|
||||
}
|
||||
|
||||
\IPS\Output::i()->linkTags['canonical'] = (string) $this->member->url();
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_statuses.js', 'core' ) );
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'global_core.js', 'core', 'global' ) );
|
||||
@@ -322,8 +325,11 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$clubsCount = \IPS\Member\Club::clubs( \IPS\Member::loggedIn(), array( ( $page - 1 ) * $perPage, $perPage ), 'last_activity', $this->member, array(), \IPS\Member::loggedIn()->modPermission( 'can_access_all_clubs' ) ? NULL : "( show_membertab = 'nonmember' OR show_membertab IS NULL )", TRUE );
|
||||
$allClubs = \IPS\Member\Club::clubs( \IPS\Member::loggedIn(), array( ( $page - 1 ) * $perPage, $perPage ), 'last_activity', $this->member, array(), \IPS\Member::loggedIn()->modPermission( 'can_access_all_clubs' ) ? NULL : "( show_membertab = 'nonmember' OR show_membertab IS NULL )" );
|
||||
/* Show all clubs this member belongs to if the viewer is a moderator with permissions to access all clubs or if the viewer is on his own profile */
|
||||
$extraWhere = ( Member::loggedIn()->member_id === $this->member->member_id OR \IPS\Member::loggedIn()->modPermission( 'can_access_all_clubs' ) ) ? NULL : "( show_membertab = 'nonmember' OR show_membertab IS NULL )";
|
||||
|
||||
$clubsCount = \IPS\Member\Club::clubs( \IPS\Member::loggedIn(), array( ( $page - 1 ) * $perPage, $perPage ), 'last_activity', $this->member, array(), $extraWhere, TRUE );
|
||||
$allClubs = \IPS\Member\Club::clubs( \IPS\Member::loggedIn(), array( ( $page - 1 ) * $perPage, $perPage ), 'last_activity', $this->member, array(), $extraWhere );
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $baseUrl, ( ceil( $clubsCount / $perPage ) ), $page, $perPage );
|
||||
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'styles/clubs.css', 'core', 'front' ) );
|
||||
@@ -354,7 +360,7 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
|
||||
/* If this is AJAX request to change the tab, just display that */
|
||||
if ( \IPS\Request::i()->isAjax() and isset( \IPS\Request::i()->tab ) )
|
||||
if ( \IPS\Request::i()->isAjax() and isset( \IPS\Request::i()->tab ) and !isset( \IPS\Request::i()->entireSection ) )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( $tabContents ) );
|
||||
}
|
||||
@@ -428,6 +434,11 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
'@type' => "ProfilePage",
|
||||
'url' => (string) $this->member->url(),
|
||||
'name' => $this->member->name,
|
||||
'mainEntity'=> [
|
||||
'@type' => 'Person',
|
||||
'name' => $this->member->name,
|
||||
'identifier' => $this->member->member_id,
|
||||
],
|
||||
'primaryImageOfPage' => array(
|
||||
'@type' => "ImageObject",
|
||||
'contentUrl' => (string) $this->member->get_photo( TRUE, TRUE ),
|
||||
@@ -1988,7 +1999,6 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
/* Get the different types */
|
||||
$types = array();
|
||||
$hasCallback = array();
|
||||
foreach ( \IPS\Content::routedClasses( TRUE, FALSE, TRUE ) as $class )
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'profile.css', $class::$application ) );
|
||||
@@ -1999,6 +2009,11 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if( !count( $types ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2C138/T', 403, '' );
|
||||
}
|
||||
|
||||
/* What type are we looking at? */
|
||||
$currentType = NULL;
|
||||
if ( isset( \IPS\Request::i()->type ) AND array_key_exists( \IPS\Request::i()->type, $types ) )
|
||||
@@ -2236,4 +2251,19 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
|
||||
\IPS\Output::i()->redirect( $content->url(), 'recognize_removed_success' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Should the member profile be indexed?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function shouldBeIndexed(): bool
|
||||
{
|
||||
/* Don't index new empty profiles */
|
||||
if( ! $this->member->member_posts )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user