Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+43 -9
View File
@@ -2,10 +2,10 @@
/**
* @brief blogs Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage blog
* @package IPS Community Suite
* @subpackage Blog
* @since 13 Jul 2015
* @version SVN_VERSION_NUMBER
*/
@@ -39,6 +39,18 @@ class _blogs extends \IPS\Widget\PermissionCache
*/
public $plugin = '';
/**
* Initialize this widget
*
* @return void
*/
public function init()
{
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'blog.css', 'blog' ) );
parent::init();
}
/**
* Specify widget configuration
*
@@ -68,7 +80,7 @@ class _blogs extends \IPS\Widget\PermissionCache
}
}
catch( \OutOfRangeException $ex ) { }
$form->add( new \IPS\Helpers\Form\Member( 'widget_feed_author', $author, FALSE, array( 'multiple' => true ) ) );
$form->add( new \IPS\Helpers\Form\Member( 'widget_feed_author', $author, FALSE, array( 'multiple' => null ) ) );
@@ -92,10 +104,10 @@ class _blogs extends \IPS\Widget\PermissionCache
/* Number to show */
$form->add( new \IPS\Helpers\Form\Number( 'widget_feed_show', isset( $this->configuration['widget_feed_show'] ) ? $this->configuration['widget_feed_show'] : 5, TRUE ) );
$form->add( new \IPS\Helpers\Form\Select( 'widget_feed_sort_on', isset( $this->configuration['widget_feed_sort_on'] ) ? $this->configuration['widget_feed_sort_on'] : 'blog_edate', FALSE, array( 'options' => array(
'blog_edate' => 'widget__blog_edate',
'blog_entries' => 'widget__blog_count_entries',
'blog_comments' => 'widget__blog_count_comments'
$form->add( new \IPS\Helpers\Form\Select( 'widget_feed_sort_on', isset( $this->configuration['widget_feed_sort_on'] ) ? $this->configuration['widget_feed_sort_on'] : 'blog_last_edate', FALSE, array( 'options' => array(
'blog_last_edate' => 'widget__blog_edate',
'blog_count_entries' => 'widget__blog_count_entries',
'blog_count_comments' => 'widget__blog_count_comments'
) ) ), NULL, NULL, NULL, 'widget_feed_sort_on' );
$form->add( new \IPS\Helpers\Form\Select( 'widget_feed_sort_dir', isset( $this->configuration['widget_feed_sort_dir'] ) ? $this->configuration['widget_feed_sort_dir'] : 'desc', FALSE, array(
@@ -104,7 +116,29 @@ class _blogs extends \IPS\Widget\PermissionCache
'asc' => 'ascending'
)
) ) );
return $form;
}
/**
* Ran before saving widget configuration
*
* @param array $values Values from form
* @return array
*/
public function preConfig( $values )
{
if ( is_array( $values['widget_feed_author'] ) )
{
$members = array();
foreach( $values['widget_feed_author'] as $member )
{
$members[] = $member->member_id;
}
$values['widget_feed_author'] = $members;
}
return $values;
}
/**
@@ -118,7 +152,7 @@ class _blogs extends \IPS\Widget\PermissionCache
$sortBy = ( isset( $this->configuration['widget_feed_sort_on'] ) and isset( $this->configuration['widget_feed_sort_dir'] ) ) ? ( $this->configuration['widget_feed_sort_on'] . ' ' . $this->configuration['widget_feed_sort_dir'] ) : NULL;
$limit = isset( $this->configuration['widget_feed_show'] ) ? $this->configuration['widget_feed_show'] : 5;
if ( isset( $this->configuration['widget_feed_author'] ) and is_array( $this->configuration['widget_feed_author'] ) )
if ( isset( $this->configuration['widget_feed_author'] ) and is_array( $this->configuration['widget_feed_author'] ) and count( $this->configuration['widget_feed_author'] ) )
{
$where[] = array( \IPS\Db::i()->in( 'blog_member_id', $this->configuration['widget_feed_author'] ) );
}