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

+23 -9
View File
@@ -2,10 +2,10 @@
/**
* @brief Feed Import Node
* @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 4 Fed 2014
* @version SVN_VERSION_NUMBER
*/
@@ -107,7 +107,7 @@ class _Feed extends \IPS\Node\Model
{
if ( $enabled )
{
\IPS\DB::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'rssimport' ) );
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'rssimport' ) );
}
$this->enabled = $enabled;
}
@@ -254,6 +254,12 @@ class _Feed extends \IPS\Node\Model
*/
public function run()
{
/* Skip this if the member is restricted from posting */
if( \IPS\Member::load( $this->mid )->restrict_post or \IPS\Member::load( $this->mid )->members_bitoptions['unacknowledged_warnings'] )
{
return;
}
$previouslyImportedGuids = iterator_to_array( \IPS\Db::i()->select( 'rss_imported_guid', 'forums_rss_imported', array( 'rss_imported_impid=?', $this->id ) ) );
$request = \IPS\Http\Url::external( $this->url )->request();
@@ -269,11 +275,11 @@ class _Feed extends \IPS\Node\Model
$inserts = array();
$request = $request->decodeXml();
if( !in_array( $request->getname(), array( 'feed', 'rss' ) ) )
if( !( $request instanceof \IPS\Xml\RssOne ) AND !( $request instanceof \IPS\Xml\Rss ) AND !( $request instanceof \IPS\Xml\Atom ) )
{
throw new \RuntimeException( 'rss_import_invalid' );
}
foreach ( $request->articles( $this->id ) as $guid => $article )
{
if ( !in_array( $guid, $previouslyImportedGuids ) )
@@ -293,8 +299,16 @@ class _Feed extends \IPS\Node\Model
if ( $article['link'] and $this->showlink )
{
$rel = array();
$rel['nofollow'] = \IPS\Settings::i()->posts_add_nofollow ? "nofollow" : FALSE;
$rel['external'] = \IPS\Settings::i()->links_external ? "external" : FALSE;
if( \IPS\Settings::i()->posts_add_nofollow )
{
$rel['nofollow'] = 'nofollow';
}
if( \IPS\Settings::i()->links_external )
{
$rel['external'] = 'external';
}
$linkRelPart = '';
if ( count ( $rel ) )
@@ -306,7 +320,7 @@ class _Feed extends \IPS\Node\Model
}
$member = \IPS\Member::load( $this->mid );
$content = \IPS\Text\Parser::parseStatic( $article['content'] . $readMoreLink, FALSE, NULL, $member, 'forums_Forums', TRUE, !(bool) $member->group['g_dohtml'] );
$content = \IPS\Text\Parser::parseStatic( $article['content'] . $readMoreLink, TRUE, NULL, $member, 'forums_Forums', TRUE, !(bool) $member->group['g_dohtml'] );
$post = \IPS\forums\Topic\Post::create( $topic, $content, TRUE, NULL, \IPS\forums\Topic\Post::incrementPostCount( $container ), $member, $article['date'] );
$topic->topic_firstpost = $post->pid;