Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+29 -8
View File
@@ -162,7 +162,27 @@ abstract class _Widget extends \IPS\Widget\PermissionCache
)
) ) );
return $form;
/* Tags */
if( \IPS\Settings::i()->tags_enabled )
{
if ( \IPS\Settings::i()->tags_force_lower )
{
$options['autocomplete']['forceLower'] = TRUE;
}
if ( \IPS\Settings::i()->tags_clean )
{
$options['autocomplete']['filterProfanity'] = TRUE;
}
$options['autocomplete']['prefix'] = FALSE;
$options['autocomplete']['minimized'] = FALSE;
$form->add( new \IPS\Helpers\Form\Text( 'widget_feed_tags', ( isset( $this->configuration['widget_feed_tags'] ) ? $this->configuration['widget_feed_tags'] : array( 'tags' => NULL ) ), FALSE, $options ) );
}
return $form;
}
/**
@@ -194,7 +214,7 @@ abstract class _Widget extends \IPS\Widget\PermissionCache
if ( !isset( $this->configuration['language_key'] ) )
{
$this->configuration['language_key'] = 'widget_title_' . md5( uniqid() );
$this->configuration['language_key'] = 'widget_title_' . md5( mt_rand() );
}
$values['language_key'] = $this->configuration['language_key'];
@@ -301,8 +321,8 @@ abstract class _Widget extends \IPS\Widget\PermissionCache
{
$class = static::$class;
$where = $this->buildWhere();
if ( isset( $this->configuration['widget_feed_tags'] ) and is_array( $this->configuration['widget_feed_tags'] ) and count( $this->configuration['widget_feed_tags'] ) )
if ( \IPS\Settings::i()->tags_enabled and isset( $this->configuration['widget_feed_tags'] ) and is_array( $this->configuration['widget_feed_tags'] ) and count( $this->configuration['widget_feed_tags'] ) )
{
$tagWhere = array();
$binds = array( $class::$application, $class::$module );
@@ -312,7 +332,7 @@ abstract class _Widget extends \IPS\Widget\PermissionCache
$binds[] = $tag;
}
$where[] = array( $class::$databaseColumnId . ' IN (?)', \IPS\Db::i()->select( 'tag_meta_id', 'core_tags', array( array_merge( array( 'tag_meta_app=? AND tag_meta_area=? AND (' . implode( ' OR ', $tagWhere ) . ')' ), $binds ) ) ) );
$where[] = array( $class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnId . ' IN (?)', \IPS\Db::i()->select( 'tag_meta_id', 'core_tags', array( array_merge( array( 'tag_meta_app=? AND tag_meta_area=? AND (' . implode( ' OR ', $tagWhere ) . ')' ), $binds ) ) ) );
}
/* What visible status are we checking? */
@@ -331,15 +351,16 @@ abstract class _Widget extends \IPS\Widget\PermissionCache
break;
}
}
/* As the block config can try and search all rows in topics/records, etc, we can end up with a tmp table and block nested buffer on members table, so we just query members after separately */
$skipPerms = ( !isset( $this->configuration['widget_feed_use_perms'] ) or $this->configuration['widget_feed_use_perms'] ) ? FALSE : TRUE;
$items = iterator_to_array( $class::getItemsWithPermission(
$where, /* Where clause */
( isset( $this->configuration['widget_feed_sort_on'] ) and isset( $this->configuration['widget_feed_sort_dir'] ) ) ? ( ( $this->configuration['widget_feed_sort_on'] == '_rand' ) ? $this->configuration['widget_feed_sort_on'] : ( $class::$databasePrefix . $this->configuration['widget_feed_sort_on'] . ' ' . $this->configuration['widget_feed_sort_dir'] ) ) : ( $class::$databasePrefix . $class::$databaseColumnMap['updated'] . ' DESC' ), /* Order */
isset( $this->configuration['widget_feed_show'] ) ? $this->configuration['widget_feed_show'] : 5, /* Limit */
( !isset( $this->configuration['widget_feed_use_perms'] ) or $this->configuration['widget_feed_use_perms'] ) ? 'read' : NULL, /* Permission key to check against */
$skipPerms ? NULL : 'read', /* Permission key to check against */
$hidden, /* Whether or not to include hidden items */
0, NULL, FALSE, FALSE, FALSE, FALSE, NULL, FALSE, TRUE, FALSE, FALSE
0, NULL, FALSE, FALSE, FALSE, FALSE, NULL, $skipPerms, TRUE, FALSE, FALSE
) );
if ( count( $items ) )