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

@@ -2,10 +2,10 @@
/**
* @brief forums
* @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 Board
* @package IPS Community Suite
* @subpackage Forums
* @since 07 Jan 2014
* @version SVN_VERSION_NUMBER
*/
@@ -2,10 +2,10 @@
/**
* @brief Feeds
* @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 Board
* @package IPS Community Suite
* @subpackage Forums
* @since 04 Feb 2014
* @version SVN_VERSION_NUMBER
*/
@@ -70,7 +70,7 @@ class _rss extends \IPS\Node\Controller
\IPS\Output::i()->output = new \IPS\Helpers\Wizard( array(
'rss_import_url' => function( $data )
{
$form = new \IPS\Helpers\Form;
$form = new \IPS\Helpers\Form( 'form', 'continue' );
$form->add( new \IPS\Helpers\Form\Url( 'rss_import_url', NULL, TRUE ) );
$form->add( new \IPS\Helpers\Form\Text( 'rss_import_auth_user' ) );
$form->add( new \IPS\Helpers\Form\Password( 'rss_import_auth_pass' ) );
@@ -142,7 +142,32 @@ class _rss extends \IPS\Node\Controller
{
return $forum->sub_can_post and !$forum->redirect_url;
} ) ) );
$form->add( new \IPS\Helpers\Form\Member( 'rss_import_mid', \IPS\Member::loggedIn(), TRUE ) );
$form->add( new \IPS\Helpers\Form\Member( 'rss_import_mid', \IPS\Member::loggedIn(), TRUE, array(), function( $val ){
if( !is_array( $val ) )
{
$val = array( $val );
}
foreach( $val as $member )
{
if( $member instanceof \IPS\Member )
{
if( !$member->member_id )
{
throw new \InvalidArgumentException( 'form_member_bad' );
}
}
else
{
$testMember = \IPS\Member::load( $member );
if( !$testMember->member_id )
{
throw new \InvalidArgumentException( 'form_member_bad' );
}
}
}
} ) );
$form->add( new \IPS\Helpers\Form\Text( 'rss_import_showlink', \IPS\Member::loggedIn()->language()->addToStack('rss_import_showlink_default') ) );
$form->add( new \IPS\Helpers\Form\Radio( 'rss_import_topic_open', NULL, FALSE, array( 'options' => array( 1 => 'unlocked', 0 => 'locked' ) ) ) );
$form->add( new \IPS\Helpers\Form\Radio( 'rss_import_topic_hide', NULL, FALSE, array( 'options' => array( 0 => 'unhidden', 1 => 'hidden' ) ) ) );
@@ -2,10 +2,10 @@
/**
* @brief savedActions
* @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 Board
* @package IPS Community Suite
* @subpackage Forums
* @since 30 Jan 2014
* @version SVN_VERSION_NUMBER
*/
@@ -2,10 +2,10 @@
/**
* @brief Settings
* @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 Board
* @package IPS Community Suite
* @subpackage Forums
* @since 20 Jan 2014
* @version SVN_VERSION_NUMBER
*/
@@ -34,11 +34,11 @@ class _settings extends \IPS\Dispatcher\Controller
\IPS\Dispatcher::i()->checkAcpPermission( 'settings_access' );
$tabs = array();
if ( \IPS\Member::loggedIn()->hasAcpRestriction('forum_settings') )
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'forums', 'forums', 'forum_settings' ) )
{
$tabs['settings'] = 'forum_settings';
}
if ( \IPS\Member::loggedIn()->hasAcpRestriction('archive_manage') )
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'forums', 'forums', 'archive_manage' ) )
{
$tabs['archiving'] = 'archiving';
}
@@ -128,20 +128,20 @@ class _settings extends \IPS\Dispatcher\Controller
$members = array();
foreach( explode( ',', $rule['archive_text'] ) AS $v )
{
$members[] = \IPS\Member::load( $v )->name;
$members[] = \IPS\Member::load( $v );
}
$existingValues['archive_topic_starter'] = implode( ',', $members );
$existingValues['archive_topic_starter'] = $members;
}
else
{
$members = array();
foreach( explode( ',', $rule['archive_text'] ) AS $v )
{
$members[] = \IPS\Member::load( $v )->name;
$members[] = \IPS\Member::load( $v );
}
$existingValues['archive_topic_starter_not'] = implode( ',', $members );
$existingValues['archive_topic_starter_not'] = $members;
}
break;
}
@@ -224,7 +224,7 @@ class _settings extends \IPS\Dispatcher\Controller
{
if ( in_array( $k, array( 'archive_last_post' ) ) )
{
if ( !isset( $v[3] ) or !$v[3] )
if ( ( !isset( $v[3] ) or !$v[3] ) and $v[1] )
{
$rules[] = array(
'archive_key' => md5( "forums_{$k}" ),
@@ -239,7 +239,7 @@ class _settings extends \IPS\Dispatcher\Controller
}
elseif ( in_array( $k, array( 'archive_not_last_post' ) ) )
{
if ( !isset( $v[3] ) or !$v[3] )
if ( ( !isset( $v[3] ) or !$v[3] ) and $v[1] )
{
$rules[] = array(
'archive_key' => md5( "forums_{$k}" ),
@@ -299,7 +299,7 @@ class _settings extends \IPS\Dispatcher\Controller
}
elseif( in_array( $k, array( 'archive_topic_post', 'archive_topic_view', 'archive_topic_rating' ) ) )
{
if ( !isset( $v[2] ) )
if ( !isset( $v[2] ) and $v[1] )
{
$rules[] = array(
'archive_key' => md5( "forums_{$k}" ),
@@ -314,7 +314,7 @@ class _settings extends \IPS\Dispatcher\Controller
}
elseif( in_array( $k, array( 'archive_not_topic_post', 'archive_not_topic_view', 'archive_not_topic_rating' ) ) )
{
if ( !isset( $v[2] ) )
if ( !isset( $v[2] ) and $v[1] )
{
$rules[] = array(
'archive_key' => md5( "forums_{$k}" ),
@@ -329,7 +329,7 @@ class _settings extends \IPS\Dispatcher\Controller
}
elseif( in_array( $k, array( 'archive_topic_starter' ) ) )
{
if ( is_array( $v ) )
if ( is_array( $v ) and count( $v ) )
{
$ids = array();
foreach( $v AS $member )
@@ -350,7 +350,7 @@ class _settings extends \IPS\Dispatcher\Controller
}
elseif( in_array( $k, array( 'archive_topic_starter_not' ) ) )
{
if ( is_array( $v ) )
if ( is_array( $v ) AND count( $v ) )
{
$ids = array();
foreach( $v AS $member )
@@ -446,10 +446,19 @@ class _settings extends \IPS\Dispatcher\Controller
$_whereClause[] = $bind;
}
if( $values['archive_on'] )
{
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => (int)$values['archive_on'] ), array( '`key`=?', 'archive' ) );
}
/* Make sure the unarchive task is enabled - it will disable itself if there is no work to do */
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'unarchive' ) );
/* And disable the archive task if archiving is disabled */
if( !$values['archive_on'] )
{
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 'archive' ) );
}
/* Or enable it if archiving is enabled */
else
{
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'archive' ) );
}
/* Log and redirect */
\IPS\Session::i()->log( 'acplogs__archive_settings' );
@@ -563,6 +572,7 @@ class _settings extends \IPS\Dispatcher\Controller
}
) ) );
$form->add( new \IPS\Helpers\Form\Number( 'forums_posts_per_page', \IPS\Settings::i()->forums_posts_per_page , TRUE, array( 'min' => 2, 'max' => 250 ) ) );
$form->add( new \IPS\Helpers\Form\Number( 'forums_topics_per_page', \IPS\Settings::i()->forums_topics_per_page , TRUE, array( 'min' => 5, 'max' => 100 ) ) );
$form->addHeader('question_settings');
$form->add( new \IPS\Helpers\Form\YesNo( 'forums_questions_downvote', \IPS\Settings::i()->forums_questions_downvote ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'forums_answers_downvote', \IPS\Settings::i()->forums_answers_downvote ) );
@@ -2,10 +2,10 @@
/**
* @brief posts
* @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
* @package IPS Community Suite
* @subpackage Forums
* @since 18 Aug 2014
* @version SVN_VERSION_NUMBER
*/
@@ -2,10 +2,10 @@
/**
* @brief topics
* @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
* @package IPS Community Suite
* @subpackage Forums
* @since 18 Aug 2014
* @version SVN_VERSION_NUMBER
*/