Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

@@ -1536,6 +1536,7 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
$this->last_record_name = '';
$this->last_title = NULL;
$this->last_record_id = 0;
$this->last_poster_anon = 0;
return;
}
}
@@ -1549,6 +1550,7 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
$this->last_title = mb_substr( $comment->item()->mapped('title'), 0, 255 );
$this->last_seo_title = \IPS\Http\Url\Friendly::seoTitle( $this->last_title );
$this->last_record_id = $comment->item()->_id;
$this->last_poster_anon = $comment->isAnonymous();
}
else if ( static::$latestRecordAdded !== NULL )
{
@@ -1558,6 +1560,7 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
$this->last_title = mb_substr( static::$latestRecordAdded->_title, 0, 255 );
$this->last_seo_title = \IPS\Http\Url\Friendly::seoTitle( mb_substr( static::$latestRecordAdded->_title, 0, 255 ) );
$this->last_record_id = static::$latestRecordAdded->_id;
$this->last_poster_anon = static::$latestRecordAdded->isAnonymous();
}
$this->records = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $this->database_id, array( 'record_approved=1 AND record_future_date=0 AND category_id=?', $this->id ), NULL, NULL, NULL, NULL, \IPS\Db::SELECT_FROM_WRITE_SERVER )->first();
@@ -355,7 +355,7 @@ class _Databases extends \IPS\Node\Model implements \IPS\Node\Permissions
$schema = \IPS\Db::i()->getTableDefinition( $tableName );
$changes = array();
/* Colums */
/* Columns */
foreach( $table['columns'] as $key => $data )
{
if ( ! isset( $schema['columns'][ $key ] ) )
+6 -2
View File
@@ -2120,7 +2120,9 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
if ( ! $isTitleOrContent )
{
$form->add( new \IPS\Helpers\Form\YesNo( 'field_display_listing', $this->id ? $this->display_listing : 1, FALSE, array( 'togglesOn' => array('field_truncate', 'field_display_listing_json_badge') ), NULL, NULL, NULL, 'field_display_listing' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'field_display_listing', $this->id ? $this->display_listing : 1, FALSE, array(
'togglesOn' => array('field_truncate', 'field_display_listing_json_badge', 'field_show_map_listing', 'field_show_map_listing_dims' )
), NULL, NULL, NULL, 'field_display_listing' ) );
}
$form->add( new \IPS\Helpers\Form\Radio( 'field_display_listing_json_badge', $listingDefault, FALSE, array( 'options' => $listingOptions, 'toggles' => $listingToggles, 'parse' => 'raw' ), NULL, NULL, NULL, 'field_display_listing_json_badge' ) );
@@ -2160,7 +2162,9 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
if ( ! $isTitleOrContent )
{
$form->add( new \IPS\Helpers\Form\YesNo( 'field_display_display', $this->id ? $this->display_display : 1, FALSE, array( 'togglesOn' => array( 'field_display_display_json_badge' ) ), NULL, NULL, NULL, 'field_display_display' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'field_display_display', $this->id ? $this->display_display : 1, FALSE, array(
'togglesOn' => array( 'field_display_display_json_badge', 'field_show_map_display', 'field_show_map_display_dims', 'field_display_display_json_where' )
), NULL, NULL, NULL, 'field_display_display' ) );
}
$form->add( new \IPS\Helpers\Form\Radio( 'field_display_display_json_badge', $displayDefault, FALSE, array( 'options' => $displayOptions, 'toggles' => $displayToggles, 'parse' => 'raw' ), NULL, NULL, NULL, 'field_display_display_json_badge' ) );
+15
View File
@@ -172,6 +172,7 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
$this->template = '';
$this->full_path = '';
$this->js_css_objects = '';
$this->meta_index = TRUE;
}
/**
@@ -787,6 +788,15 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
$return['page_meta_keywords'] = new \IPS\Helpers\Form\TextArea( 'page_meta_keywords', $item ? $item->meta_keywords : '', FALSE, array(), NULL, NULL, NULL, 'page_meta_keywords' );
$return['page_meta_description'] = new \IPS\Helpers\Form\TextArea( 'page_meta_description', $item ? $item->meta_description : '', FALSE, array(), NULL, NULL, NULL, 'page_meta_description' );
$disabledIndex = ( $item AND $item->id AND !$item->canView(new \IPS\Member()));
$return['page_meta_index'] = new \IPS\Helpers\Form\YesNo('page_meta_index', !$disabledIndex ? ( $item ? $item->meta_index : TRUE ) : FALSE , FALSE, array( 'disabled' => $disabledIndex), NULL, NULL, NULL, 'page_meta_index' );
if( $disabledIndex )
{
\IPS\Member::loggedIn()->language()->words['page_meta_index_desc'] = \IPS\Member::loggedIn()->language()->addToStack('page_meta_index_desc_disabled');
}
\IPS\Output::i()->globalControllers[] = 'cms.admin.pages.form';
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_pages.js', 'cms' ) );
@@ -2311,6 +2321,11 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
\IPS\Output::i()->metaTags['og:type'] = 'website';
}
if( !$this->meta_index )
{
\IPS\Output::i()->metaTags['robots'] = 'noindex';
}
/* Can only disable sidebar if HTML page */
if ( ! $this->show_sidebar and $this->type === 'html' )
{
@@ -100,11 +100,6 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory,
*/
protected static $searchIndexTitles = array();
/**
* @brief Whether to track the sentiment scores in cloud_sentiment_scores for this content
*/
public $trackSentimentScore = true;
/**
* Load Record
*
+38 -6
View File
@@ -126,7 +126,7 @@ class _Records extends \IPS\Content\Item implements
public static $databaseColumnMap = array(
'author' => 'member_id',
'container' => 'category_id',
'date' => 'record_publish_date',
'date' => 'record_saved',
'is_future_entry' => 'record_future_date',
'future_date' => 'record_publish_date',
'num_comments' => 'record_comments',
@@ -152,6 +152,7 @@ class _Records extends \IPS\Content\Item implements
'meta_data' => 'record_meta_data',
'author_name' => 'record_author_name',
'is_anon' => 'record_is_anon',
'last_comment_anon' => 'record_last_comment_anon'
);
@@ -635,7 +636,7 @@ class _Records extends \IPS\Content\Item implements
}
}
if ( $fieldsClass::fixedFieldFormShow( 'record_publish_date' ) AND ( \IPS\Member::loggedIn()->modPermission( "can_future_publish_content" ) or \IPS\Member::loggedIn()->modPermission( "can_future_publish_" . static::$title ) ) )
if ( isset( $elements['date'] ) AND $fieldsClass::fixedFieldFormShow( 'record_publish_date' ) AND ( \IPS\Member::loggedIn()->modPermission( "can_future_publish_content" ) or \IPS\Member::loggedIn()->modPermission( "can_future_publish_" . static::$title ) ) )
{
$formElements['record_publish_date'] = $elements['date'];
}
@@ -1107,7 +1108,6 @@ class _Records extends \IPS\Content\Item implements
/* Other data */
if ( $isNew OR $database->_comment_bump & \IPS\cms\Databases::BUMP_ON_EDIT )
{
$this->record_saved = time();
$this->record_updated = time();
}
@@ -1657,7 +1657,7 @@ class _Records extends \IPS\Content\Item implements
*/
public function get__publishDate()
{
return $this->record_publish_date ? $this->record_publish_date : $this->record_saved;
return $this->record_publish_date ? $this->record_publish_date : $this->record_saved;
}
/**
@@ -1948,6 +1948,10 @@ class _Records extends \IPS\Content\Item implements
{
return $this->_content;
}
else if( $key === 'date')
{
return $this->_publishDate;
}
if ( isset( static::$databaseColumnMap[ $key ] ) )
{
@@ -2047,6 +2051,7 @@ class _Records extends \IPS\Content\Item implements
$this->record_last_comment = $comment->mapped('date');
$this->record_last_comment_by = $comment->author()->member_id;
$this->record_last_comment_name = $comment->author()->name;
$this->record_last_comment_anon = $comment->isAnonymous();
$this->save();
if ( $setCategory and $this->category_id )
@@ -2959,8 +2964,8 @@ class _Records extends \IPS\Content\Item implements
if( $this->isAnonymous() )
{
$topic->setAnonymous( TRUE, $this->author );
$post->setAnonymous( TRUE, $this->author );
$topic->setAnonymous( TRUE, $this->author() );
$post->setAnonymous( TRUE, $this->author() );
}
$topic->markRead();
@@ -4045,4 +4050,31 @@ class _Records extends \IPS\Content\Item implements
return $lastMod;
}
/**
* Returns the earliest publish date for the new content item, we can have past items for records.
*
* @return \IPS\DateTime|null
*/
protected static function getMinimumPublishDate(): ?\IPS\DateTime
{
return NULL;
}
/**
* Can the publish date be changed while editing the item?
*
* @var bool
*/
public static bool $allowPublishDateWhileEditing = TRUE;
/**
* Allow editing of the publish date from existing records
*
* @return bool
*/
protected static function supportsPublishDate( ?\IPS\Content\Item $item ): bool
{
return !static::database()->forum_record AND parent::supportsPublishDate($item);
}
}
@@ -96,11 +96,6 @@ class _Review extends \IPS\Content\Review implements \IPS\Content\EditHistory, \
*/
public static $customDatabaseId = NULL;
/**
* @brief Whether to track the sentiment scores in cloud_sentiment_scores for this content
*/
public $trackSentimentScore = true;
/**
* Load Record
*