Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+27 -3
View File
@@ -48,7 +48,7 @@ class _achievements extends \IPS\Widget\StaticCache
$form = parent::configuration( $form );
$form->add( new \IPS\Helpers\Form\Translatable( 'widget_feed_title', isset( $this->configuration['language_key'] ) ? NULL : \IPS\Member::loggedIn()->language()->addToStack( 'achievements_widget_title' ), FALSE, array( 'app' => 'core', 'key' => ( isset( $this->configuration['language_key'] ) ? $this->configuration['language_key'] : NULL ) ) ) );
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'achievements_to_show', isset( $this->configuration['achivements_to_show'] ) ? explode( ',', $this->configuration['achivements_to_show'] ) : [ 'badges', 'ranks' ], TRUE, [ 'options' => [
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'achievements_to_show', isset( $this->configuration['achievements_to_show'] ) ? explode( ',', $this->configuration['achievements_to_show'] ) : [ 'badges', 'ranks' ], TRUE, [ 'options' => [
'badges' => 'block_achievements_badges',
'ranks' => 'block_achievements_rank',
] ] ) );
@@ -86,10 +86,27 @@ class _achievements extends \IPS\Widget\StaticCache
$result = [];
$toShow = explode( ',', ( $this->configuration['achievements_to_show'] ?? 'badges,ranks' ) );
$countToShow = $this->configuration['number_to_show'] ?? 5;
$exclude = json_decode( \IPS\Settings::i()->rules_exclude_groups, TRUE );
foreach( \IPS\Member\Group::groups() as $group )
{
if( ! $group->g_view_board )
{
$exclude[] = $group->g_id;
}
}
if ( \is_array( $exclude ) and \count( $exclude ) )
{
$subWhere[] = [ \IPS\Db::i()->in( 'member_group_id', $exclude ) . ' OR ' . \IPS\Db::i()->findInSet( 'mgroup_others', $exclude ) ];
}
$subWhere[] = [ 'temp_ban != 0 OR ' . \IPS\Db::i()->bitwiseWhere( \IPS\Member::$bitOptions['members_bitoptions'], 'bw_is_spammer' ) ];
$subQuery = \IPS\Db::i()->select( 'member_id', 'core_members', $subWhere );
if ( \IPS\core\Achievements\Badge::show() and \in_array( 'badges', $toShow ) )
{
foreach ( \IPS\Db::i()->select( '*', 'core_member_badges', NULL, 'datetime DESC', $countToShow )->join( 'core_badges', 'core_member_badges.badge=core_badges.id' ) as $earnedBadge )
foreach ( \IPS\Db::i()->select( '*', 'core_member_badges', ( $subQuery ? [ \IPS\Db::i()->in( 'core_member_badges.member', $subQuery, TRUE ) ] : NULL ), 'datetime DESC', $countToShow )->join( 'core_badges', 'core_member_badges.badge=core_badges.id' ) as $earnedBadge )
{
try
{
@@ -112,7 +129,14 @@ class _achievements extends \IPS\Widget\StaticCache
if ( \IPS\core\Achievements\Rank::show() and \in_array( 'ranks', $toShow ) )
{
foreach ( \IPS\Db::i()->select( '*', 'core_points_log', 'new_rank IS NOT NULL', 'datetime DESC', $countToShow ) as $earnedRank )
$query = [ [ 'new_rank IS NOT NULL' ] ];
if ( $subQuery )
{
$query[] = [ \IPS\Db::i()->in( 'core_points_log.member', $subQuery, TRUE ) ];
}
foreach ( \IPS\Db::i()->select( '*', 'core_points_log', $query, 'datetime DESC', $countToShow ) as $earnedRank )
{
try
{