Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

@@ -215,11 +215,13 @@ class profile extends Controller
/* Work out the main content to display */
/* What tabs are available? */
$tabs = array( 'activity' => 'users_activity_feed' );
$tabs = array( 'activity' => [ 'url' => Url::internal( "app=core&module=members&controller=profile&id=" . $this->member->member_id . "&tab=activity", "front",
"profile_tab", $this->member->members_seo_name ), 'title' => 'users_activity_feed' ] );
if ( Member::loggedIn()->canAccessModule( Module::get( 'core', 'clubs', 'front' ) ) and Settings::i()->clubs and Club::clubs( Member::loggedIn(), NULL, 'created', $this->member, array(), NULL, TRUE ) )
{
$tabs['clubs'] = 'users_clubs';
$tabs['clubs'] = [ 'url' => Url::internal( "app=core&module=members&controller=profile&id=" . $this->member->member_id . "&tab=clubs", "front",
"profile_tab", $this->member->members_seo_name ), 'title' => 'users_clubs' ];
}
foreach( $mainFields as $group => $fields )
@@ -228,7 +230,8 @@ class profile extends Controller
{
if ( $value )
{
$tabs["field_{$field}"] = $field;
$tabs[ "field_{$field}" ] = [ 'url' => Url::internal( "app=core&module=members&controller=profile&id=" . $this->member->member_id . "&tab=field_" . $field, "front",
"profile_tab", $this->member->members_seo_name ), 'title' => $field ];
}
}
}
@@ -240,18 +243,29 @@ class profile extends Controller
{
preg_match( '/^IPS\\\(.+?)\\\extensions\\\core\\\Profile\\\(.+?)$/', $extension, $matches );
$nodes[ "{$matches[1]}_{$matches[2]}" ] = $profileExtension;
$tabs[ "node_{$matches[1]}_{$matches[2]}" ] = "profile_{$matches[1]}_{$matches[2]}";
$tabs[ "node_{$matches[1]}_{$matches[2]}" ] = [ 'url' => $profileExtension->url(), 'title' => "profile_{$matches[1]}_{$matches[2]}" ];
}
}
/* What tab are we on? */
if ( !isset( Request::i()->tab ) or !array_key_exists( Request::i()->tab, $tabs ) )
$tab = 'activity';
if ( isset( Request::i()->tab ) )
{
$tab = 'activity';
}
else
{
$tab = Request::i()->tab;
$currentUrl = (string) Request::i()->url()->stripQueryString();
foreach( $tabs as $k => $v )
{
if( $k == Request::i()->tab )
{
$tab = $k;
break;
}
if( $currentUrl === (string) $v['url'] )
{
$tab = $k;
break;
}
}
}
/* Work out the content */
@@ -1448,9 +1462,9 @@ class profile extends Controller
}
$limit = array( ( $page - 1 ) * 50, 50 );
$followers = $this->member->followers( ( Member::loggedIn()->isAdmin() OR Member::loggedIn()->member_id === $this->member->member_id ) ? \IPS\Content::FOLLOW_PUBLIC + \IPS\Content::FOLLOW_ANONYMOUS : \IPS\Content::FOLLOW_PUBLIC, array( 'immediate', 'daily', 'weekly', 'none' ), NULL, $limit, 'name' );
$followers = iterator_to_array( $this->member->followers( ( Member::loggedIn()->isAdmin() OR Member::loggedIn()->member_id === $this->member->member_id ) ? \IPS\Content::FOLLOW_PUBLIC + \IPS\Content::FOLLOW_ANONYMOUS : \IPS\Content::FOLLOW_PUBLIC, array( 'immediate', 'daily', 'weekly', 'none' ), NULL, $limit, 'name' ) );
$followersCount = $this->member->followersCount( ( Member::loggedIn()->isAdmin() OR Member::loggedIn()->member_id === $this->member->member_id ) ? \IPS\Content::FOLLOW_PUBLIC + \IPS\Content::FOLLOW_ANONYMOUS : \IPS\Content::FOLLOW_PUBLIC, array( 'immediate', 'daily', 'weekly', 'none' ) );
if ( Request::i()->isAjax() )
{
Output::i()->sendOutput( Theme::i()->getTemplate( 'profile' )->followers( $this->member, $followers ) );