Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

+111
View File
@@ -0,0 +1,111 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_pages",
{
"name": "page_views",
"type": "INT",
"length": null,
"decimals": null,
"values": null,
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"auto_increment": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"cms_database_categories",
{
"name": "category_club_id",
"type": "BIGINT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"auto_increment": false
}
]
},
"3": {
"method": "addColumn",
"params": [
"cms_database_categories",
{
"name": "category_club_view_permission",
"type": "VARCHAR",
"length": 500,
"decimals": null,
"values": null,
"allow_null": false,
"default": "*",
"comment": "",
"unsigned": false,
"auto_increment": false
}
]
},
"4": {
"method": "addColumn",
"params": [
"cms_database_categories",
{
"name": "category_club_category_meta_index",
"type": "TINYINT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": "1",
"comment": "",
"unsigned": true,
"auto_increment": false
}
]
},
"5": {
"method": "addColumn",
"params": [
"cms_databases",
{
"name": "database_allow_club_categories",
"type": "TINYINT",
"length": null,
"decimals": null,
"values": null,
"allow_null": false,
"default": 0,
"comment": "Whether this database will allow club categories",
"unsigned": true,
"auto_increment": false
}
]
},
"6": {
"method": "changeIndex",
"params": [
"cms_database_categories",
"category_database_id",
{
"type": "key",
"name": "category_database_id",
"columns": [
"category_database_id",
"category_club_id"
],
"length": [
null,
null
]
}
]
}
}
Whitespace-only changes.
@@ -1,111 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_database_fields",
{
"name": "field_display_json",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "JSON array of custom display HTML",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"cms_database_comments",
{
"name": "comment_edit_reason",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "addColumn",
"params": [
"cms_database_comments",
{
"name": "comment_edit_member_name",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"4": {
"method": "addColumn",
"params": [
"cms_database_comments",
{
"name": "comment_edit_member_id",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"5": {
"method": "addColumn",
"params": [
"cms_database_comments",
{
"name": "comment_edit_show",
"type": "SMALLINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"6": {
"method": "update",
"params": [
"cms_database_fields",
{
"field_display_json": "{\"display\":{\"method\":\"none\",\"html\":\"\"},\"listing\":{\"method\":\"1\",\"html\":\"\",\"right\":false}}"
}
]
}
}
@@ -1,63 +0,0 @@
<?php
/**
* @brief 4.0.0 Beta 3 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 24 Nov 2014
*/
namespace IPS\cms\setup\upg_100003;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Beta 3 Upgrade Code
*
*/
class _Upgrade
{
/**
* Step 1
* Remove any fulltext indices
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( 'database_id, database_database', 'cms_databases' ) as $database )
{
if( \IPS\Db::i()->checkForTable( 'cms_custom_database_' . $database['database_id'] ) )
{
$tableDefinition = \IPS\Db::i()->getTableDefinition( 'cms_custom_database_' . $database['database_id'] );
foreach( $tableDefinition['indexes'] as $name => $indexDefinition )
{
if( $indexDefinition['type'] == 'fulltext' )
{
\IPS\Db::i()->dropIndex( 'cms_custom_database_' . $database['database_id'], $indexDefinition['name'] );
}
}
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Removing unused fulltext indices";
}
}
Whitespace-only changes.
@@ -1,42 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_database_categories",
{
"name": "category_template_listing",
"type": "VARCHAR",
"length": 250,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"cms_database_categories",
{
"name": "category_template_display",
"type": "VARCHAR",
"length": 250,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
Whitespace-only changes.
@@ -1,22 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_databases",
{
"name": "database_fixed_field_settings",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
Whitespace-only changes.
@@ -1,52 +0,0 @@
<?php
/**
* @brief 4.0.0 Beta 5 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
*/
namespace IPS\cms\setup\upg_100008;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Beta 5 Upgrade Code
*
*/
class _Upgrade
{
/**
* Step 1
* Convert menu titles to translatable lang strings
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach ( \IPS\Db::i()->select( '*', 'cms_page_menu' ) as $menu )
{
\IPS\Lang::saveCustom( 'cms', "cms_menu_title_" . $menu['menu_id'], $menu['menu_title'] );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Converting menu titles to translatable fields";
}
}
Whitespace-only changes.
@@ -1,167 +0,0 @@
<?php
/**
* @brief 4.0.0 Beta 6 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
*/
namespace IPS\cms\setup\upg_100010;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Beta 5 Upgrade Code
*
*/
class _Upgrade
{
/**
* Step 1
* Convert menu titles to translatable lang strings
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$menu = array();
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $db )
{
foreach( \IPS\Lang::languages() as $id => $lang )
{
try
{
$base = $lang->get('cms_create_menu_records_x');
}
catch ( \UnderflowException $e )
{
$base = "%s in %s"; // If upgrading from 3.x it won't exist yet
}
$menu[ $lang->_id ] = \sprintf( $base, $lang->get("content_db_lang_su_" . $db['database_id'] ), $lang->get('content_db_' . $db['database_id'] ) );
}
\IPS\Lang::saveCustom( 'cms', "cms_create_menu_records_" . $db['database_id'], $menu );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Storing create menu translations";
}
/**
* Step 2
* When upgrading from 3.x a database may be configured so that primary_id_field (or similar) is the content or title field..
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $db )
{
$updates = array();
if( !\is_numeric( $db['database_field_title'] ) or !\is_numeric( $db['database_field_content'] ) )
{
$definition = \IPS\Db::i()->getTableDefinition( 'cms_custom_database_' . $db['database_id'] );
$fields = array();
/* Figure out which field_xx columns are available */
foreach( $definition['columns'] as $k => $v )
{
if( mb_strpos( $v['name'], 'field_' ) === 0 )
{
$fields[] = str_replace( 'field_', '', $v['name'] );
}
}
/* Do we need to reset the title field, i.e. if it was mapped to primary_id_field? */
if( !\is_numeric( $db['database_field_title'] ) AND \count( $fields ) )
{
$updates['database_field_title'] = $fields[0];
/* If there are other fields to use, remove this one from the array */
if( \count( $fields ) > 1 )
{
unset( $fields[0] );
}
}
/* Otherwise we need to remove the title field from the fields array */
else
{
if( $titleField = array_search( $db['database_field_title'], $fields ) )
{
unset( $fields[ $titleField ] );
}
}
/* Do we need to reset the content field, i.e. if it was mapped to primary_id_field? */
if( !\is_numeric( $db['database_field_content'] ) AND \count( $fields ) )
{
$updates['database_field_content'] = array_shift( $fields );
}
}
/* If we have any changes, store them */
if( \count( $updates ) )
{
\IPS\Db::i()->update( 'cms_databases', $updates, array( 'database_id=?', $db['database_id'] ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Fixing misconfigured databases";
}
/**
* Step 3
* Convert page titles to translatable lang strings
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
foreach ( \IPS\Db::i()->select( '*', 'cms_pages' ) as $page )
{
\IPS\Lang::saveCustom( 'cms', "cms_page_" . $page['page_id'], $page['page_name'] );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Converting page titles to translatable fields";
}
}
Whitespace-only changes.
@@ -1,22 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_url_store",
{
"name": "store_path",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Path part of the URL",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -1,362 +0,0 @@
<?php
/**
* @brief 4.0.0 Beta 7 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 Jan 2015
*/
namespace IPS\cms\setup\upg_100011;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Beta 7 Upgrade Code
*
*/
class _Upgrade
{
/**
* Step 1
* Convert menu titles to translatable lang strings
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->update( 'cms_templates', "template_content=REPLACE(template_content, '{image=', '{resource=' )" );
\IPS\Data\Cache::i()->clearAll();
\IPS\Data\Store::i()->clearAll();
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Converting image plugin to resource plugin in database templates";
}
/**
* Step 2
* Remove old database tables if they exist
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
if( \IPS\Db::i()->checkForTable('ccs_attachments_map') )
{
\IPS\Db::i()->dropTable( 'ccs_attachments_map' );
}
if( \IPS\Db::i()->checkForTable('ccs_block_wizard') )
{
\IPS\Db::i()->dropTable( 'ccs_block_wizard' );
}
if( \IPS\Db::i()->checkForTable('ccs_database_moderators') )
{
\IPS\Db::i()->dropTable( 'ccs_database_moderators' );
}
if( \IPS\Db::i()->checkForTable('ccs_database_modqueue') )
{
\IPS\Db::i()->dropTable( 'ccs_database_modqueue' );
}
if( \IPS\Db::i()->checkForTable('ccs_database_ratings') )
{
\IPS\Db::i()->dropTable( 'ccs_database_ratings' );
}
if( \IPS\Db::i()->checkForTable('ccs_menus') )
{
\IPS\Db::i()->dropTable( 'ccs_menus' );
}
if( \IPS\Db::i()->checkForTable('ccs_page_templates') )
{
\IPS\Db::i()->dropTable( 'ccs_page_templates' );
}
if( \IPS\Db::i()->checkForTable('ccs_page_wizard') )
{
\IPS\Db::i()->dropTable( 'ccs_page_wizard' );
}
if( \IPS\Db::i()->checkForTable('ccs_revisions') )
{
\IPS\Db::i()->dropTable( 'ccs_revisions' );
}
if( \IPS\Db::i()->checkForTable('ccs_slug_memory') )
{
\IPS\Db::i()->dropTable( 'ccs_slug_memory' );
}
if( \IPS\Db::i()->checkForTable('ccs_template_blocks') )
{
\IPS\Db::i()->dropTable( 'ccs_template_blocks' );
}
if( \IPS\Db::i()->checkForTable('ccs_template_cache') )
{
\IPS\Db::i()->dropTable( 'ccs_template_cache' );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Removing old database tables";
}
/**
* Step 3
* Remove old stuff from tables we retained
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
/* A previous upgrader bug may have prevented this column from being added - #2296 */
if( !\IPS\Db::i()->checkForColumn( 'cms_databases', 'database_fixed_field_settings' ) )
{
\IPS\Db::i()->addColumn( 'cms_databases', array( 'name' => 'database_fixed_field_settings', 'type' => 'MEDIUMTEXT', 'allow_null' => true, 'default' => null ) );
}
\IPS\Db::i()->update( 'cms_databases', array( 'database_fixed_field_settings' => '{"record_image":{"image_dims":[0,0],"thumb_dims":["200","200"]}}' ), array( 'database_fixed_field_settings IS NULL OR database_fixed_field_settings=?', '' ) );
\IPS\Db::i()->update( 'cms_databases', array( 'database_featured_settings' => '{"featured":false,"perpage":10,"pagination":false,"sort":"record_publish_date","direction":"desc","categories":0}' ), array( 'database_featured_settings IS NULL OR database_featured_settings=?', '' ) );
/* Database categories */
$columns = array();
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_description' ) )
{
$columns[] = "category_description";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_rss' ) )
{
$columns[] = "category_rss";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_rss_cache' ) )
{
$columns[] = "category_rss_cache";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_rss_cached' ) )
{
$columns[] = 'category_rss_cached';
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_rss_exclude' ) )
{
$columns[] = "category_rss_exclude";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_template' ) )
{
$columns[] = "category_template";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_tags_override' ) )
{
$columns[] = "category_tags_override";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_tags_enabled' ) )
{
$columns[] = "category_tags_enabled";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_tags_noprefixes' ) )
{
$columns[] = "category_tags_noprefixes";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_categories', 'category_tags_predefined' ) )
{
$columns[] = "category_tags_predefined";
}
if( \count( $columns ) )
{
\IPS\Db::i()->dropColumn( 'cms_database_categories', $columns );
}
/* Fields */
$columns = array();
if( \IPS\Db::i()->checkForColumn( 'cms_database_fields', 'field_name' ) )
{
$columns[] = "field_name";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_fields', 'field_description' ) )
{
$columns[] = "field_description";
}
if( \IPS\Db::i()->checkForColumn( 'cms_database_fields', 'field_is_numeric' ) )
{
$columns[] = "field_is_numeric";
}
if( \count( $columns ) )
{
\IPS\Db::i()->dropColumn( 'cms_database_fields', $columns );
}
/* Pages */
$columns = array();
if( \IPS\Db::i()->checkForColumn( 'cms_pages', 'page_template_used' ) )
{
$columns[] = "page_template_used";
}
if( \IPS\Db::i()->checkForColumn( 'cms_pages', 'page_last_edited' ) )
{
$columns[] = "page_last_edited";
}
if( \IPS\Db::i()->checkForColumn( 'cms_pages', 'page_content_only' ) )
{
$columns[] = "page_content_only";
}
if( \IPS\Db::i()->checkForColumn( 'cms_pages', 'page_content_type' ) )
{
$columns[] = "page_content_type";
}
if( \IPS\Db::i()->checkForColumn( 'cms_pages', 'page_omit_filename' ) )
{
$columns[] = "page_omit_filename";
}
if( \count( $columns ) )
{
\IPS\Db::i()->dropColumn( 'cms_pages', $columns );
}
/* Blocks */
$columns = array();
if( \IPS\Db::i()->checkForColumn( 'cms_blocks', 'block_name' ) )
{
$columns[] = "block_name";
}
if( \IPS\Db::i()->checkForColumn( 'cms_blocks', 'block_description' ) )
{
$columns[] = "block_description";
}
if( \count( $columns ) )
{
\IPS\Db::i()->dropColumn( 'cms_blocks', $columns );
}
/* Databases */
$columns = array();
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_name' ) )
{
$columns[] = "database_name";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_database' ) )
{
$columns[] = "database_database";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_description' ) )
{
$columns[] = "database_description";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_field_count' ) )
{
$columns[] = "database_field_count";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_rss_cache' ) )
{
$columns[] = "database_rss_cache";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_rss_cached' ) )
{
$columns[] = "database_rss_cached";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_lang_sl' ) )
{
$columns[] = "database_lang_sl";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_lang_pl' ) )
{
$columns[] = "database_lang_pl";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_lang_su' ) )
{
$columns[] = "database_lang_su";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_lang_pu' ) )
{
$columns[] = "database_lang_pu";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_featured_article' ) )
{
$columns[] = "database_featured_article";
}
if( \IPS\Db::i()->checkForColumn( 'cms_databases', 'database_is_articles' ) )
{
$columns[] = "database_is_articles";
}
if( \count( $columns ) )
{
\IPS\Db::i()->dropColumn( 'cms_databases', $columns );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Cleaning up database tables";
}
}
Whitespace-only changes.
@@ -1,23 +0,0 @@
{
"1": {
"method": "changeColumn",
"params": [
"cms_templates",
"template_params",
{
"name": "template_params",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
Whitespace-only changes.
@@ -1,45 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_page_widget_areas",
{
"name": "area_orientation",
"type": "ENUM",
"length": 100,
"decimals": null,
"values": [
"horizontal",
"vertical"
],
"allow_null": false,
"default": "horizontal",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"cms_blocks",
{
"name": "block_cache",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
Whitespace-only changes.
@@ -1,41 +0,0 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 15 Jan 2015
*/
namespace IPS\cms\setup\upg_100015;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC 2 Upgrade Code
*/
class _Upgrade
{
/**
* Finish - This is run after all apps have been upgraded
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
*/
public function finish()
{
foreach ( \IPS\Db::i()->select( 'database_id', 'cms_databases', 'database_page_id>0' ) as $id )
{
\IPS\Task::queue( 'core', 'RebuildItems', array( 'class' => 'IPS\cms\Records' . $id ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\cms\Records' . $id, 'count' => 0 ), 4, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\cms\Categories' . $id, 'count' => 0 ), 5, array( 'class' ) );
}
}
}
Whitespace-only changes.
@@ -1,137 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_blocks",
{
"name": "block_plugin_plugin",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "update",
"params": [
"core_reputation_index",
{
"app": "cms"
},
[
"app = ?",
"ccs"
]
]
},
"3": {
"method": "addIndex",
"params": [
"cms_pages",
{
"type": "key",
"name": "page_default",
"columns": [
"page_default",
"page_folder_id"
],
"length": [
null,
null
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"cms_pages",
{
"type": "key",
"name": "page_full_path",
"columns": [
"page_full_path"
],
"length": [
250
]
}
]
},
"5": {
"method": "addIndex",
"params": [
"cms_folders",
{
"type": "key",
"name": "folder_path",
"columns": [
"folder_path"
],
"length": [
250
]
}
]
},
"6": {
"method": "addIndex",
"params": [
"cms_folders",
{
"type": "key",
"name": "folder_parent_id",
"columns": [
"folder_parent_id"
],
"length": [
null
]
}
]
},
"7": {
"method": "addIndex",
"params": [
"cms_databases",
{
"type": "key",
"name": "forum_lookup",
"columns": [
"database_forum_record",
"database_forum_forum",
"database_forum_comments"
],
"length": [
null,
null,
null
]
}
]
},
"8": {
"method": "addIndex",
"params": [
"cms_containers",
{
"type": "key",
"name": "container_parent_id",
"columns": [
"container_parent_id"
],
"length": [
null
]
}
]
}
}
@@ -1,131 +0,0 @@
<?php
/**
* @brief 4.0.0 Beta 6 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
*/
namespace IPS\cms\setup\upg_100018;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC5 Upgrade Code
*
*/
class _Upgrade
{
/**
* Step 1
* Convert menu titles to translatable lang strings
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $db )
{
$save = array();
foreach( \IPS\Lang::languages() as $id => $lang )
{
try
{
$base = $lang->get('__indefart_content_db_lang_sl');
}
catch ( \UnderflowException $e )
{
$base = "a %s"; // If upgrading from 3.x it won't exist yet
}
try
{
$string = $lang->get("content_db_lang_sl_" . $db['database_id']);
}
catch ( \UnderflowException $e )
{
$string = "record"; // If upgrading from 3.x it won't exist yet
}
$save[ $lang->_id ] = \sprintf( $base, $string );
}
\IPS\Lang::saveCustom( 'cms', "content_db_lang_ia_" . $db['database_id'], $save );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Storing indefinite article translations";
}
/**
* Step 2
* Move any orphaned blocks to a new category
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
if( !\IPS\Db::i()->select( 'COUNT(*)', 'cms_blocks', array( 'block_category=?', 0 ) ) )
{
/* If there aren't any, don't create a new block category */
return TRUE;
}
$container = new \IPS\cms\Blocks\Container;
$container->name = 'Uncategorized Blocks';
$container->type = 'block';
$container->order = 0;
$container->parent_id = 0;
$container->key = md5( mt_rand() );
$container->save();
\IPS\Db::i()->update( 'cms_blocks', array( 'block_category' => $container->_id ), array( 'block_category=?', 0 ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Restoring orphaned Pages blocks";
}
/**
* Make sure all theme settings are applied to every theme.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
foreach ( \IPS\Db::i()->select( 'database_id', 'cms_databases', 'database_page_id>0' ) as $id )
{
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\cms\Records' . $id ), 4 );
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\cms\Records\Comment' . $id ), 4 );
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\cms\Records\Review' . $id ), 4 );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\cms\Categories' . $id, 'count' => 0 ), 5, array( 'class' ) );
}
return TRUE;
}
}
Whitespace-only changes.
@@ -1,28 +0,0 @@
{
"1": {
"method": "addQuery",
"params": [
"ccs_block_wizard",
{
"name": "wizard_started",
"type": "VARCHAR",
"length": 13,
"allow_null": false,
"default": 0
}
]
},
"2": {
"method": "addQuery",
"params": [
"ccs_page_wizard",
{
"name": "wizard_started",
"type": "VARCHAR",
"length": 13,
"allow_null": false,
"default": 0
}
]
}
}
Whitespace-only changes.
@@ -1,118 +0,0 @@
{
"1": {
"method": "addIndex",
"params": [
"cms_templates",
{
"type": "key",
"name": "template_location",
"columns": [
"template_location",
"template_user_edited"
],
"length": [
250,
null
]
}
]
},
"2": {
"method": "addIndex",
"params": [
"cms_templates",
{
"type": "key",
"name": "template_key",
"columns": [
"template_key"
],
"length": [
250
]
}
]
},
"3": {
"method": "addIndex",
"params": [
"cms_templates",
{
"type": "key",
"name": "template_type",
"columns": [
"template_type",
"template_user_edited"
],
"length": [
null,
null
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"cms_database_comments",
{
"type": "key",
"name": "comment_approved",
"columns": [
"comment_approved"
],
"length": [
null
]
}
]
},
"5": {
"method": "addIndex",
"params": [
"cms_database_reviews",
{
"type": "key",
"name": "review_approved",
"columns": [
"review_approved"
],
"length": [
null
]
}
]
},
"6": {
"method": "addIndex",
"params": [
"cms_database_reviews",
{
"type": "key",
"name": "review_ip",
"columns": [
"review_ip_address"
],
"length": [
null
]
}
]
},
"7": {
"method": "addIndex",
"params": [
"cms_database_reviews",
{
"type": "key",
"name": "review_author",
"columns": [
"review_author"
],
"length": [
null
]
}
]
}
}
Whitespace-only changes.
@@ -1,58 +0,0 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
*/
namespace IPS\cms\setup\upg_100023;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Upgrade Code
*
*/
class _Upgrade
{
/**
* Step 1
* Create background tasks to rebuild editor fields
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( '*', 'cms_databases') as $database )
{
foreach( \IPS\Db::i()->select( '*', 'cms_database_fields', array( 'field_database_id=? AND field_type=?', $database['database_id'], 'Editor' ) ) as $field )
{
if ( $field['field_id'] != $database['database_field_content'] )
{
\IPS\Task::queue( 'cms', 'RebuildEditorFields', array( 'class' => 'IPS\cms\Records' . $database['database_id'], 'fieldId' => $field['field_id'] ), 5, array( 'class', 'fieldId' ) );
}
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Creating tasks to rebuild editor fields";
}
}
Whitespace-only changes.
@@ -1,68 +0,0 @@
<?php
/**
* @brief 4.0.2 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 15 Apr 2015
*/
namespace IPS\cms\setup\upg_100025;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.2 Upgrade Code
*
*/
class _Upgrade
{
/**
* Step 1
* Create language strings
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$strings = array();
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $db )
{
foreach( \IPS\Lang::languages() as $id => $lang )
{
try
{
$base = $lang->get('digest_area_records' . $db['database_id'] );
}
catch ( \UnderflowException $e )
{
$base = "";
}
$strings[ $lang->_id ] = $base;
}
\IPS\Lang::saveCustom( 'cms', "digest_area_categories" . $db['database_id'], $strings );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Creating missing language strings";
}
}
Whitespace-only changes.
@@ -1,61 +0,0 @@
<?php
/**
* @brief 4.0.3 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Apr 2015
*/
namespace IPS\cms\setup\upg_100026;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.3 Upgrade Code
*/
class _Upgrade
{
/**
* Add record_comments_hidden field
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $database )
{
if ( ! \IPS\Db::i()->checkForColumn( 'cms_custom_database_' . $database['database_id'], 'record_comments_hidden' ) )
{
\IPS\Db::i()->addColumn( 'cms_custom_database_' . $database['database_id'], array(
"name" => "record_comments_hidden",
"type" => "INT",
"length" => 10,
"null" => true,
"default" => null,
"comment" => "",
"unsigned" => true
) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Correcting custom database definitions";
}
}
Whitespace-only changes.
@@ -1,46 +0,0 @@
<?php
/**
* @brief 4.0.5 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 5 May 2015
*/
namespace IPS\cms\setup\upg_100028;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.5 Upgrade Code
*/
class _Upgrade
{
/**
* Make sure all theme settings are applied to every theme.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
\IPS\core\Setup\Upgrade::repairFileUrls('cms');
foreach ( \IPS\Db::i()->select( 'database_id', 'cms_databases', 'database_page_id>0' ) as $id )
{
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\cms\Records' . $id ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\cms\Records\Comment' . $id ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\cms\Records\Review' . $id ), 3, array( 'class' ) );
}
return TRUE;
}
}
Whitespace-only changes.
@@ -1,37 +0,0 @@
<?php
/**
* @brief 4.0.5 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Apr 2015
*/
namespace IPS\cms\setup\upg_100030;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.5 Upgrade Code
*/
class _Upgrade
{
/**
* Fixes BBCode type pages
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
\IPS\Task::queue( 'cms', 'ConvertPages', array(), 1 );
return TRUE;
}
}
Whitespace-only changes.
@@ -1,9 +0,0 @@
{
"1": {
"method": "dropTable",
"params": [
"cms_page_database_map",
true
]
}
}
Whitespace-only changes.
@@ -1,68 +0,0 @@
<?php
/**
* @brief 4.0.9 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 19 Jun 2015
*/
namespace IPS\cms\setup\upg_100035;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.9 Upgrade Code
*/
class _Upgrade
{
/**
* Update widgets
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
$areas = array( 'core_widget_areas', 'cms_page_widget_areas' );
foreach ( $areas as $table )
{
foreach ( \IPS\Db::i()->select( '*', $table ) as $area )
{
$widgetsColumn = $table == 'core_widget_areas' ? 'widgets' : 'area_widgets';
$whereClause = $table == 'core_widget_areas' ? array( 'id=? AND area=?', $area['id'], $area['area'] ) : array( 'area_page_id=? AND area_area=?', $area['area_page_id'], $area['area_area'] );
$widgets = json_decode( $area[ $widgetsColumn ], TRUE );
$update = FALSE;
foreach ( $widgets as $k => $widget )
{
if ( $widget['key'] == 'LatestArticles' )
{
$widgets[ $k ]['key'] = 'RecordFeed';
if ( isset( $widgets[ $k ]['configuration']['database'] ) )
{
$widgets[ $k ]['configuration']['cms_rf_database'] = $widgets[ $k ]['configuration']['database'];
unset( $widgets[ $k ]['configuration']['database'] );
}
$update = TRUE;
}
if ( $update )
{
\IPS\Db::i()->update( $table, array( $widgetsColumn => json_encode( $widgets ) ), $whereClause );
}
}
}
}
return TRUE;
}
}
Whitespace-only changes.
@@ -1,13 +0,0 @@
{
"1": {
"method": "delete",
"params": [
"core_widgets",
[
"app=? AND `key`=?",
"cms",
"LatestArticles"
]
]
}
}
Whitespace-only changes.
@@ -1,240 +0,0 @@
{
"1": {
"method": "createTable",
"params": [
{
"name": "cms_media",
"columns": {
"media_id": {
"allow_null": false,
"auto_increment": true,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 10,
"name": "media_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_parent": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "media_parent",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_filename": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "media_filename",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_data": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "media_data",
"type": "MEDIUMBLOB",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_added": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "media_added",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_full_path": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "media_full_path",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_file_object": {
"name": "media_file_object",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"media_filename_stored": {
"name": "media_filename_stored",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"media_is_image": {
"name": "media_is_image",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"media_id"
]
}
},
"collation": "utf8mb4_unicode_ci"
}
]
},
"2": {
"method": "createTable",
"params": [
{
"name": "cms_media_folders",
"columns": {
"media_folder_id": {
"allow_null": false,
"auto_increment": true,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 10,
"name": "media_folder_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_folder_parent": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "media_folder_parent",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_folder_name": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "media_folder_name",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"media_folder_path": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "media_folder_path",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"media_folder_id"
]
},
"media_folder_parent": {
"type": "key",
"name": "media_folder_parent",
"length": [
null
],
"columns": [
"media_folder_parent"
]
}
},
"collation": "utf8mb4_unicode_ci"
}
]
}
}
Whitespace-only changes.
@@ -1,142 +0,0 @@
<?php
/**
* @brief 4.0.11 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 14 Jul 2015
*/
namespace IPS\cms\setup\upg_100041;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.11 Upgrade Code
*/
class _Upgrade
{
/**
* Fix Pages blocks that use topicFeed block
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach ( \IPS\Db::i()->select( '*', 'cms_blocks', array( 'block_type=?', 'plugin' ) ) as $block )
{
$config = json_decode( $block['block_plugin_config'], TRUE );
/* Some badly stored blocks may have corrupt config...we'll just switch to an array to prevent errors in the upgrade */
if( !\is_array( $config ) )
{
$config = array();
}
$update = FALSE;
if ( $block['block_plugin'] == 'latestTopics' )
{
$block['block_plugin'] = 'topicFeed';
$update = TRUE;
}
if ( $block['block_plugin'] == 'featuredTopics' )
{
$block['block_plugin'] = 'topicFeed';
$config['tfb_topic_status'] = array( 'open', 'closed', 'pinned', 'notpinned', 'featured' );
$update = TRUE;
}
if ( $block['block_plugin'] == 'recentImages' )
{
$block['block_plugin'] = 'imageFeed';
if ( isset( $config['number_to_show'] ) )
{
$config['widget_feed_show'] = $config['number_to_show'];
unset($config['number_to_show'] );
}
$update = TRUE;
}
if ( $block['block_plugin'] == 'topImages' )
{
$block['block_plugin'] = 'imageFeed';
$config['widget_feed_min_rating'] = 1;
$config['widget_feed_sort_on'] = 'rating';
$config['widget_feed_sort_dir'] = 'desc';
if ( isset( $config['number_to_show'] ) )
{
$config['widget_feed_show'] = $config['number_to_show'];
unset( $config['number_to_show'] );
}
$update = TRUE;
}
if ( $block['block_plugin'] == 'recentFiles' )
{
$block['block_plugin'] = 'fileFeed';
if ( isset( $config['number_to_show'] ) )
{
$config['widget_feed_show'] = $config['number_to_show'];
unset( $config['number_to_show'] );
}
$update = TRUE;
}
if ( $block['block_plugin'] == 'LatestArticles' )
{
$block['block_plugin'] = 'RecordFeed';
if ( isset( $config['database'] ) )
{
$config['cms_rf_database'] = $config['database'];
unset( $config['database'] );
}
$update = TRUE;
}
if ( $block['block_plugin'] == 'topicFeed' )
{
$update = TRUE;
foreach ( $config as $_k => $_v )
{
$_k = str_replace( 'tfb_', 'widget_feed', $_k );
if ( $_k == 'widget_feed_topic_status' )
{
$_k = 'widget_feed_status';
}
$config[ $_k ] = $_v;
}
}
if ( $update )
{
\IPS\Db::i()->update( 'cms_blocks', array( 'block_plugin' => $block['block_plugin'], 'block_plugin_config' => json_encode( $config ) ), array( 'block_id=?', $block['block_id'] ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Updating custom feed blocks";
}
}
Whitespace-only changes.
@@ -1,12 +0,0 @@
{
"1": {
"method": "delete",
"params": [
"core_widget_areas",
[
"app=?",
"cms"
]
]
}
}
@@ -1,80 +0,0 @@
<?php
/**
* @brief 4.0.13 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 Jul 2015
*/
namespace IPS\cms\setup\upg_100044;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.13 Upgrade Code
*/
class _Upgrade
{
/**
* Attachments field may have 0 mapped instead of null or empty string
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( '*', 'cms_database_fields', array( 'field_type=?', 'Upload' ) ) as $field )
{
\IPS\Db::i()->update( 'cms_custom_database_' . $field['field_database_id'], array( 'field_' . $field['field_id'] => NULL ), array( 'field_' . $field['field_id'] . '=?', '0' ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Adjusting empty attachment fields";
}
/**
* Databases did not previously remove follows
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
$areas = array();
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $db )
{
$areas[] = "records" . $db['database_id'];
$areas[] = "categories" . $db['database_id'];
}
\IPS\Db::i()->delete( 'core_follow', array( "follow_app=? AND follow_area NOT IN('" . implode( "','", $areas ) . "')", 'cms' ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Removing invalid follow notifications";
}
}
Whitespace-only changes.
@@ -1,41 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"ccs_page_wizard",
{
"name": "wizard_previous_type",
"type": "VARCHAR",
"length": 32,
"allow_null": true,
"default": null
}
]
},
"2": {
"method": "addColumn",
"params": [
"ccs_page_wizard",
{
"name": "wizard_ipb_wrapper",
"type": "TINYINT",
"length": 1,
"allow_null": false,
"default": 0
}
]
},
"3": {
"method": "addColumn",
"params": [
"ccs_pages",
{
"name": "page_ipb_wrapper",
"type": "TINYINT",
"length": 1,
"allow_null": false,
"default": 0
}
]
}
}
Whitespace-only changes.
@@ -1,16 +0,0 @@
{
"1": {
"method": "changeColumn",
"params": [
"ccs_block_wizard",
"wizard_name",
{
"name": "wizard_name",
"type": "VARCHAR",
"length": 255,
"allow_null": true,
"default": null
}
]
}
}
Whitespace-only changes.
@@ -1,236 +0,0 @@
<?php
/**
* @brief 4.0.13 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 Jul 2015
*/
namespace IPS\cms\setup\upg_101000;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.0 Upgrade Code
*/
class _Upgrade
{
/**
* Fix cms_blocks
*
* @return void
*/
public function finish()
{
foreach ( \IPS\Db::i()->select( '*', 'cms_blocks', array( 'block_type=?', 'plugin' ) ) as $block )
{
$config = json_decode( $block['block_plugin_config'], TRUE );
$config = ( \is_array( $config ) ) ? $config : array();
$update = FALSE;
if ( $block['block_plugin'] == 'topicFeed' )
{
$update = TRUE;
$newConfig = array();
foreach ( $config as $_k => $_v )
{
if ( $_k === 'widget_feed_status' )
{
if ( \in_array( 'open', $_v ) and \in_array( 'closed', $_v ) )
{
$newConfig['widget_feed_status_locked'] = 'any';
}
else if ( \in_array( 'open', $_v ) )
{
$newConfig['widget_feed_status_locked'] = 'open';
}
else if ( \in_array( 'closed', $_v ) )
{
$newConfig['widget_feed_status_locked'] = 'closed';
}
if ( \in_array( 'pinned', $_v ) and \in_array( 'notpinned', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'any';
}
else if ( \in_array( 'pinned', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'open';
}
else if ( \in_array( 'notpinned', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'closed';
}
if ( \in_array( 'featured', $_v ) and \in_array( 'notfeatured', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'any';
}
else if ( \in_array( 'featured', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'featured';
}
else if ( \in_array( 'notfeatured', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'notfeatured';
}
}
else
{
$newConfig[ $_k ] = $_v;
}
}
}
if ( $block['block_plugin'] == 'postFeed' )
{
$update = TRUE;
$newConfig = array();
foreach ( $config as $_k => $_v )
{
if ( \in_array( $_k, array( 'tfb_show', 'tfb_sort_dir', 'tfb_use_perms', 'tfb_topic_status' ) ) )
{
$_k = str_replace( 'tfb_', 'widget_feed', $_k );
}
else
{
$_k = str_replace( 'tfb_', 'widget_feed_item', $_k );
}
if ( $_k == 'widget_feed_topic_status' )
{
if ( \in_array( 'open', $_v ) and \in_array( 'closed', $_v ) )
{
$newConfig['widget_feed_item_status_locked'] = 'any';
}
else if ( \in_array( 'open', $_v ) )
{
$newConfig['widget_feed_item_status_locked'] = 'open';
}
else if ( \in_array( 'closed', $_v ) )
{
$newConfig['widget_feed_item_status_locked'] = 'closed';
}
if ( \in_array( 'pinned', $_v ) and \in_array( 'notpinned', $_v ) )
{
$newConfig['widget_feed_item_status_pinned'] = 'any';
}
else if ( \in_array( 'pinned', $_v ) )
{
$newConfig['widget_feed_item_status_pinned'] = 'open';
}
else if ( \in_array( 'notpinned', $_v ) )
{
$newConfig['widget_feed_item_status_pinned'] = 'closed';
}
if ( \in_array( 'featured', $_v ) and \in_array( 'notfeatured', $_v ) )
{
$newConfig['widget_feed_item_status_pinned'] = 'any';
}
else if ( \in_array( 'featured', $_v ) )
{
$newConfig['widget_feed_item_status_pinned'] = 'featured';
}
else if ( \in_array( 'notfeatured', $_v ) )
{
$newConfig['widget_feed_item_status_pinned'] = 'notfeatured';
}
}
else
{
$newConfig[ $_k ] = $_v;
}
}
}
if ( $block['block_plugin'] == 'RecordFeed' )
{
$update = TRUE;
$newConfig = array();
foreach ( $config as $_k => $_v )
{
if ( $_k !== 'cms_rf_database' )
{
$_k = str_replace( 'cms_rf', 'widget_feed', $_k );
}
if ( $_k == 'widget_feed_record_status' )
{
$_k = 'widget_feed_status';
}
if ( $_k == 'cms_rf_category' )
{
$_k = 'widget_feed_container';
}
if ( $_k === 'widget_feed_status' AND $_v !== NULL )
{
if ( \in_array( 'open', $_v ) and \in_array( 'closed', $_v ) )
{
$newConfig['widget_feed_status_locked'] = 'any';
}
else if ( \in_array( 'open', $_v ) )
{
$newConfig['widget_feed_status_locked'] = 'open';
}
else if ( \in_array( 'closed', $_v ) )
{
$newConfig['widget_feed_status_locked'] = 'closed';
}
if ( \in_array( 'pinned', $_v ) and \in_array( 'notpinned', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'any';
}
else if ( \in_array( 'pinned', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'open';
}
else if ( \in_array( 'notpinned', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'closed';
}
if ( \in_array( 'featured', $_v ) and \in_array( 'notfeatured', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'any';
}
else if ( \in_array( 'featured', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'featured';
}
else if ( \in_array( 'notfeatured', $_v ) )
{
$newConfig['widget_feed_status_pinned'] = 'notfeatured';
}
}
else
{
$newConfig[ $_k ] = $_v;
}
}
}
if ( $update )
{
\IPS\Db::i()->update( 'cms_blocks', array( 'block_plugin_config' => json_encode( $newConfig ) ), array( 'block_id=?', $block['block_id'] ) );
}
}
/* Update template params */
\IPS\Db::i()->update( 'cms_blocks', array( 'block_template_params' => '$records, $title, $orientation=\'vertical\'' ), array( 'block_plugin=?', 'RecordFeed' ) );
return TRUE;
}
}
Whitespace-only changes.
@@ -1,48 +0,0 @@
<?php
/**
* @brief 4.1.6 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 11 Dec 2015
*/
namespace IPS\cms\setup\upg_101021;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.6 Upgrade Code
*/
class _Upgrade
{
/**
* remove cms widgets from core widget table
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->delete( 'core_widget_areas', array( "app=?", 'cms' ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Removing invalid widgets";
}
}
Whitespace-only changes.
@@ -1,140 +0,0 @@
<?php
/**
* @brief 4.1.9 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 28 Jan 2016
*/
namespace IPS\cms\setup\upg_101026;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.9 Upgrade Code
*/
class _Upgrade
{
/**
* ...
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$categories = iterator_to_array( \IPS\Db::i()->select( 'category_id', 'cms_database_categories' ) );
\IPS\Db::i()->delete( 'core_follow', array( "follow_app=? AND follow_area LIKE 'categories%' AND " . \IPS\Db::i()->in( 'follow_rel_id', $categories, TRUE ), 'cms' ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Removing invalid follows";
}
/**
* Fix recordFeed sidebar visibility for ONCE AND FOR ALL*
*
*
* * until next time.
*
* @return string
*/
public function step2()
{
\IPS\Db::i()->update( 'core_widgets', array( 'restrict' => '["cms"]' ), array( 'app=? and `key`=?', 'cms', 'recordFeed' ) );
return TRUE;
}
/**
* Trigger background task
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
\IPS\Task::queue( 'cms', 'RebuildCommentLikes', array(), 4 );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Updating database comment likes";
}
/**
* Fix Number Custom Fields
*/
public function step4()
{
$toRunQueries = array();
foreach ( \IPS\Db::i()->select( '*', 'cms_database_fields', array( 'field_type=?', 'Number' ) ) AS $field )
{
if ( \IPS\Db::i()->checkForTable( 'cms_custom_database_' . $field['field_database_id'] ) )
{
try
{
$toRunQueries[] = array(
'table' => 'cms_custom_database_' . $field['field_database_id'],
'query' => "ALTER TABLE `" . \IPS\Db::i()->prefix . 'cms_custom_database_' . $field['field_database_id'] . "` DROP INDEX `field_" . $field['field_id'] . "`"
);
$toRunQueries[] = array(
'table' => 'cms_custom_database_' . $field['field_database_id'],
'query' => "ALTER TABLE `" . \IPS\Db::i()->prefix . 'cms_custom_database_' . $field['field_database_id'] . "` CHANGE COLUMN `field_" . $field['field_id'] . "` field_" . $field['field_id'] . " VARCHAR(255) DEFAULT NULL"
);
$toRunQueries[] = array(
'table' => 'cms_custom_database_' . $field['field_database_id'],
'query' => "ALTER TABLE `" . \IPS\Db::i()->prefix . 'cms_custom_database_' . $field['field_database_id'] . "` ADD INDEX `field_" . $field['field_id'] . "`(`field_" . $field['field_id'] . "`(191))"
);
}
catch( \Exception $e ) { }
}
}
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
if ( \count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'cms', 'extra' => array( '_upgradeStep' => 5 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step4CustomTitle()
{
return "Changing custom fields database structure";
}
}
Whitespace-only changes.
@@ -1,150 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_databases",
{
"name": "database_use_as_page_title",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "1",
"comment": "Use database name as page title, or retain page title",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"cms_database_fields",
{
"name": "field_unique",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "createTable",
"params": [
{
"name": "cms_database_fields_reciprocal_map",
"columns": {
"map_origin_database_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "map_origin_database_id",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"map_foreign_database_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "map_foreign_database_id",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"map_origin_item_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "map_origin_item_id",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"map_foreign_item_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "map_foreign_item_id",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"map_field_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "map_field_id",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
}
},
"indexes": {
"map_origin": {
"type": "key",
"name": "map_origin",
"length": [
null,
null
],
"columns": [
"map_origin_database_id",
"map_origin_item_id"
]
},
"map_foreign": {
"type": "key",
"name": "map_foreign",
"length": [
null,
null
],
"columns": [
"map_foreign_database_id",
"map_foreign_item_id"
]
}
},
"collation": "utf8mb4_unicode_ci",
"engine": "InnoDB"
}
]
}
}
@@ -1,37 +0,0 @@
<?php
/**
* @brief 4.1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 08 Apr 2016
*/
namespace IPS\cms\setup\upg_101034;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1 Upgrade Code
*/
class _Upgrade
{
/**
* Finish - This is run after all apps have been upgraded
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
*/
public function finish()
{
\IPS\cms\Databases::rebuildReciprocalLinkMaps();
}
}
Whitespace-only changes.
@@ -1,12 +0,0 @@
{
"1": {
"method": "update",
"params": [
"cms_database_fields",
{
"field_filter": 0
},
"field_type NOT IN('CheckboxSet','Radio','Select')"
]
}
}
@@ -1,46 +0,0 @@
<?php
/**
* @brief 4.1.15 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 25 Aug 2016
*/
namespace IPS\cms\setup\upg_101056;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.15 Upgrade Code
*/
class _Upgrade
{
/**
* Fix star ratings which haven't been averaged correctly.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
\IPS\Db::i()->update( 'cms_databases', array( 'database_field_sort' => 'record_rating' ), array( 'database_field_sort=?', 'rating_real' ) );
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $database )
{
try
{
\IPS\Task::queue( 'core', 'RecountStarRatings', array( 'class' => 'IPS\cms\Records' . $database['database_id'] ), 3 );
}
catch ( \OutOfRangeException $ex ) { }
}
return TRUE;
}
}
Whitespace-only changes.
@@ -1,9 +0,0 @@
{
"1": {
"method": "update",
"params": [
"cms_templates",
"template_group=REPLACE(template_group,'.','_')"
]
}
}
@@ -1,43 +0,0 @@
<?php
/**
* @brief 4.1.16 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
{subpackage}
* @since 28 Sep 2016
*/
namespace IPS\cms\setup\upg_101064;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.16 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Rebuild the Reviews count
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach ( \IPS\Db::i()->select( '*', 'cms_databases') as $db )
{
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\cms\Records' . $db['database_id'], 'count' => 0 ), 4, array( 'class' ) );
}
return TRUE;
}
// You can create as many additional methods (step2, step3, etc.) as is necessary.
// Each step will be executed in a new HTTP request
}
Whitespace-only changes.
@@ -1,9 +0,0 @@
{
"1": {
"method": "delete",
"params": [
"core_sys_lang_words",
"word_app='cms' AND word_key='save_and_reload'"
]
}
}
@@ -1,116 +0,0 @@
<?php
/**
* @brief 4.1.17 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 26 Oct 2016
*/
namespace IPS\cms\setup\upg_101071;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.17 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Fix any future dates that are set incorrectly
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$queries = array();
foreach( \IPS\cms\Databases::databases() as $database )
{
if ( \IPS\Db::i()->checkForTable( 'cms_custom_database_' . $database->id ) )
{
$queries[] = array(
'table' => 'cms_custom_database_' . $database->id,
'query' => "UPDATE " . \IPS\Db::i()->prefix . "cms_custom_database_" . $database->id . " SET record_last_comment=record_publish_date WHERE record_last_comment > UNIX_TIMESTAMP() AND record_publish_date < UNIX_TIMESTAMP()"
);
$queries[] = array(
'table' => 'cms_custom_database_' . $database->id,
'query' => "UPDATE " . \IPS\Db::i()->prefix . "cms_custom_database_" . $database->id . " SET record_last_review=record_publish_date WHERE record_last_review > UNIX_TIMESTAMP() AND record_publish_date < UNIX_TIMESTAMP()"
);
}
}
if( \count( $queries ) )
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
if ( \count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'cms', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Resetting last comment/review times in custom Pages databases";
}
/**
* Removing widgets from uninstalled applications - Uninstalled applications may have left behind entries in this table.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
$applications = array_keys( \IPS\Application::applications() );
foreach( \IPS\Db::i()->select( '*', 'cms_page_widget_areas' ) as $area )
{
$update = FALSE;
$widgets = json_decode( $area['area_widgets'], TRUE );
foreach ( $widgets as $widgetKey => $widget )
{
if( isset( $widget['app'] ) AND !\in_array( $widget['app'], $applications ) )
{
unset( $widgets[ $widgetKey ] );
$update = TRUE;
}
}
if( $update )
{
\IPS\Db::i()->update( 'cms_page_widget_areas', array( 'area_widgets' => json_encode( array_values( $widgets ) ) ), array( 'area_page_id=? AND area_area=?', $area['area_page_id'], $area['area_area'] ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Removing widgets from uninstalled applications";
}
}
Whitespace-only changes.
@@ -1,61 +0,0 @@
<?php
/**
* @brief 4.1.18 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 03 Jan 2017
*/
namespace IPS\cms\setup\upg_101079;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.18 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Reset category FURL paths
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
/* Make sure our Application.php has been loaded, as it handles the special dynamic CMS database classes */
\IPS\Application::load( 'cms' );
/* Loop over each database */
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $database )
{
$categoryClass = '\IPS\cms\Categories' . $database['database_id'];
/* Loop over root/parent categories in the database */
foreach( $categoryClass::roots( NULL ) as $node )
{
/* Resetting the full path on the parent category automatically updates all children categories too */
$node->setFullPath();
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Resetting Pages database category friendly URLs";
}
}
Whitespace-only changes.
@@ -1,66 +0,0 @@
<?php
/**
* @brief 4.1.18.1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 20 Jan 2017
*/
namespace IPS\cms\setup\upg_101088;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.18.1 Upgrade Code
*/
class _Upgrade
{
/**
* Removing widgets from uninstalled plugins - Uninstalled plugins may have left behind entries in this table.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$plugins = array_keys( \IPS\Plugin::plugins() );
foreach( \IPS\Db::i()->select( '*', 'cms_page_widget_areas' ) as $area )
{
$update = FALSE;
$widgets = json_decode( $area['area_widgets'], TRUE );
foreach ( $widgets as $widgetKey => $widget )
{
if( isset( $widget['plugin'] ) AND !\in_array( $widget['plugin'], $plugins ) )
{
unset( $widgets[ $widgetKey ] );
$update = TRUE;
}
}
if( $update )
{
\IPS\Db::i()->update( 'cms_page_widget_areas', array( 'area_widgets' => json_encode( array_values( $widgets ) ) ), array( 'area_page_id=? AND area_area=?', $area['area_page_id'], $area['area_area'] ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Removing widgets from uninstalled plugins";
}
}
Whitespace-only changes.
@@ -1,50 +0,0 @@
<?php
/**
* @brief 4.1.19 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 15 Feb 2017
*/
namespace IPS\cms\setup\upg_101090;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.19 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Adjust record edit time
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) as $db )
{
\IPS\Db::i()->update( 'cms_custom_database_' . $db['database_id'], array( 'record_edit_time' => 0 ), array( 'record_edit_time=record_saved AND record_edit_member_id=?', 0 ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing record last edit time for databases";
}
}
Whitespace-only changes.
@@ -1,22 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_database_fields",
{
"name": "field_allow_attachments",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "1",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -1,52 +0,0 @@
<?php
/**
* @brief 4.2.0 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 12 Apr 2017
*/
namespace IPS\cms\setup\upg_101100;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.2.0 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Fix multiple member fields
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
/* Loop over any Member fields that allow multiple users */
foreach( \IPS\Db::i()->select( '*', 'cms_database_fields', array( 'field_type=? AND field_is_multiple=?', 'Member', 1 ) ) as $field )
{
/* Then run an update query using REPLACE() on the Pages database to fix the field */
\IPS\Db::i()->update( 'cms_custom_database_' . $field['field_database_id'], "field_{$field['field_id']}=REPLACE(field_{$field['field_id']},',','\\n')" );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing multiple member fields in Pages databases";
}
}
Whitespace-only changes.
@@ -1,46 +0,0 @@
<?php
/**
* @brief 4.2.0 Beta 3 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 18 May 2017
*/
namespace IPS\cms\setup\upg_101105;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.2.0 Beta 3 Upgrade Code
*/
class _Upgrade
{
/**
* Fix customized templates to ensure reactions show
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
/* Update records templates */
foreach( \IPS\Db::i()->select( '*', 'cms_templates', array( "template_content LIKE '%settings.reputation_enabled%'" ) ) as $row )
{
if ( preg_match( '#\$record\s+?instanceof\s+?\\\IPS\\\Content\\\Reputation#i', $row['template_content'] ) )
{
$row['template_content'] = preg_replace( '#\$record\s+?instanceof\s+?\\\IPS\\\Content\\\Reputation#i', '\IPS\IPS::classUsesTrait( $record, \'IPS\Content\Reactable\' )', $row['template_content'] );
\IPS\Db::i()->update( 'cms_templates', array( 'template_content' => $row['template_content'] ), array( 'template_id=?', $row['template_id'] ) );
}
}
return TRUE;
}
}
Whitespace-only changes.
@@ -1,82 +0,0 @@
{
"1": {
"method": "createTable",
"params": [
{
"name": "cms_database_fields_thumbnails",
"columns": {
"thumb_original_location": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "thumb_original_location",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_location": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "thumb_location",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_field_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "thumb_field_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_database_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "thumb_database_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"thumb_original_location"
]
}
},
"collation": "utf8_general_ci",
"engine": "InnoDB"
}
]
}
}
Whitespace-only changes.
@@ -1,105 +0,0 @@
<?php
/**
* @brief 4.2.6 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 25 Oct 2017
*/
namespace IPS\cms\setup\upg_102030;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.2.6 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Remove orphaned promotions
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$classes = array();
/* Get all existing Content Classes */
foreach( \IPS\Application::allExtensions( 'core', 'ContentRouter', FALSE ) AS $contentRouter )
{
foreach ( $contentRouter->classes as $class )
{
$classes[] = $class;
if ( isset( $class::$commentClass ) )
{
$classes[] = $class::$commentClass;
}
if ( isset( $class::$reviewClass ) )
{
$classes[] = $class::$reviewClass;
}
}
if( isset( $contentRouter->ownedNodes ) )
{
foreach( $contentRouter->ownedNodes as $class )
{
$classes[] = $class;
}
}
}
if( \count( $classes ) )
{
/* Delete Promoted Content from all not existing content classes */
\IPS\Db::i()->delete( 'core_social_promote', \IPS\Db::i()->in( 'promote_class', $classes, TRUE ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Cleaning up orphaned promotions";
}
/**
* Cleanup Database Record Slugs
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
foreach( \IPS\Db::i()->select( '*', 'cms_databases' ) AS $db )
{
\IPS\Db::i()->update( "cms_custom_database_{$db['database_id']}", array( 'record_static_furl' => NULL ), array( "record_static_furl=?", '' ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Cleaning up database records";
}
}
Whitespace-only changes.
@@ -1,22 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_database_fields_thumbnails",
{
"name": "thumb_record_id",
"type": "INT",
"length": 0,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
Whitespace-only changes.
@@ -1,93 +0,0 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_database_reviews",
{
"name": "review_author_response",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeIndex",
"params": [
"cms_database_reviews",
"review_author",
{
"type": "key",
"name": "review_author",
"columns": [
"review_author",
"review_date"
],
"length": [
null,
null
]
}
]
},
"3": {
"method": "addIndex",
"params": [
"cms_database_reviews",
{
"type": "key",
"name": "review_item",
"columns": [
"review_item",
"review_author"
],
"length": [
null,
null
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"cms_database_categories",
{
"type": "key",
"name": "category_select",
"columns": [
"category_parent_id",
"category_position"
],
"length": [
null,
null
]
}
]
},
"5": {
"method": "addIndex",
"params": [
"cms_database_comments",
{
"type": "key",
"name": "comment_ip_address",
"columns": [
"comment_ip_address"
],
"length": [
null
]
}
]
}
}
@@ -1,160 +0,0 @@
<?php
/**
* @brief 4.3.0 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 06 Dec 2017
*/
namespace IPS\cms\setup\upg_103000;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.3.0 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Fix any custom database tables that may be missing record_meta_data
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$queries = array();
foreach( \IPS\cms\Databases::databases() as $database )
{
if ( \IPS\Db::i()->checkForTable( 'cms_custom_database_' . $database->id ) AND !\IPS\Db::i()->checkForColumn( 'cms_custom_database_' . $database->id, 'record_meta_data' ) )
{
$column = \IPS\Db::i()->compileColumnDefinition( array(
'name' => 'record_meta_data',
'type' => 'BIT',
'length' => 1,
'allow_null' => FALSE,
'default' => 'b\'0\'',
) );
$queries[] = array(
'table' => 'cms_custom_database_' . $database->id,
'query' => "ALTER TABLE `" . \IPS\Db::i()->prefix . "cms_custom_database_" . $database->id . "` ADD COLUMN " . $column
);
}
}
if( \count( $queries ) )
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
if ( \count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'cms', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing custom database table definitions";
}
/**
* Step 1
* Index pages
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
\IPS\Task::queue( 'core', 'RebuildSearchIndex', array( 'class' => 'IPS\cms\Pages\PageItem' ), 5 );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return 'Adding pages to search index';
}
/**
* Step 3
* Remove announcement widgets
*
* @return bool
*/
public function step3()
{
foreach( \IPS\Db::i()->select( '*', 'cms_page_widget_areas' ) as $area )
{
$update = FALSE;
$widgets = json_decode( $area['area_widgets'], TRUE );
foreach ( $widgets as $widgetKey => $widget )
{
if( isset( $widget['app'] ) AND $widget['app'] == 'core' AND $widget['key'] == 'announcements' )
{
unset( $widgets[ $widgetKey ] );
$update = TRUE;
}
}
if( $update )
{
\IPS\Db::i()->update( 'cms_page_widget_areas', array( 'area_widgets' => json_encode( array_values( $widgets ) ) ), array( 'area_page_id=? AND area_area=?', $area['area_page_id'], $area['area_area'] ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Removing announcement widgets";
}
/**
* Finish - This is run after all apps have been upgraded
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
*/
public function finish()
{
$ids = array();
foreach ( \IPS\Db::i()->select( 'database_id', 'cms_databases' ) as $id )
{
$ids[] = $id;
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\cms\Records' . $id, 'count' => 0 ), 4, array( 'class' ) );
}
}
}
Whitespace-only changes.
@@ -1,60 +0,0 @@
<?php
/**
* @brief 4.3.0 Beta 4 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 06 Apr 2018
*/
namespace IPS\cms\setup\upg_103004;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.3.0 Beta 4 Upgrade Code
*/
class _Upgrade
{
/**
* Fix Record Views Column Type
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\cms\Databases::databases() as $database )
{
\IPS\Db::i()->changeColumn( 'cms_custom_database_' . $database->id, 'record_views', array(
'name' => 'record_views',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => '0'
) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing custom database table definitions";
}
// You can create as many additional methods (step2, step3, etc.) as is necessary.
// Each step will be executed in a new HTTP request
}
@@ -1,16 +0,0 @@
{
"1": {
"method": "update",
"params": [
"cms_templates",
"template_content=REPLACE(template_content, '\\\\IPS\\\\HTMLENTITIES', 'ENT_DISALLOWED' )"
]
},
"2": {
"method": "update",
"params": [
"cms_templates",
"template_content=REPLACE( template_content, '$record->followers()->count( TRUE )', '$record->followersCount()' )"
]
}
}
@@ -1,55 +0,0 @@
<?php
/**
* @brief 4.4.0 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 25 Jun 2018
*/
namespace IPS\cms\setup\upg_104000;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.4.0 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Fix Category Permissions
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
/* @note We wouldn't normally use an upgrade.php for an update query, however this query is semi-complex due to the sub-select, so it confuses the dev center. */
\IPS\Db::i()->delete( 'core_permission_index', array( 'app=? AND perm_type=? AND '. \IPS\Db::i()->in( 'perm_type_id', array_values( iterator_to_array( \IPS\Db::i()->select( 'category_id', 'cms_database_categories' ) ) ), TRUE ), 'cms', 'categories' ) ); # Fix orphans
\IPS\Db::i()->update( 'core_permission_index', 'perm_type=CONCAT( perm_type, \'_\', (' . (string) \IPS\Db::i()->select( 'category_database_id', 'cms_database_categories', array( "category_id=perm_type_id" ) ) . ') )', array( "app=? AND perm_type=?", 'cms', 'categories' ) );
foreach( \IPS\Db::i()->select( '*', 'cms_database_categories' ) AS $cat )
{
\IPS\Db::i()->update( 'core_tags', array( 'tag_aap_lookup' => md5( "cms;categories_{$cat['category_database_id']};{$cat['category_id']}" ) ), array( "tag_aap_lookup=?", md5( "cms;categories;{$cat['category_id']}" ) ) );
\IPS\Db::i()->update( 'core_tags_perms', array( 'tag_perm_aap_lookup' => md5( "cms;categories_{$cat['category_database_id']};{$cat['category_id']}" ) ), array( "tag_perm_aap_lookup=?", md5( "cms;categories;{$cat['category_id']}" ) ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing database permissions";
}
}
@@ -1,41 +0,0 @@
<?php
/**
* @brief 4.4.1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 15 Feb 2019
*/
namespace IPS\cms\setup\upg_104009;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.4.1 Upgrade Code
*/
class _Upgrade
{
/**
* Rebuild reciprocal links
*
* @return void
*/
public function finish()
{
\IPS\cms\Databases::rebuildReciprocalLinkMaps();
return TRUE;
}
// You can create as many additional methods (step2, step3, etc.) as is necessary.
// Each step will be executed in a new HTTP request
}
@@ -1,40 +0,0 @@
[
{
"method": "delete",
"params": [
"core_sys_lang_words",
[
"word_app='cms' AND word_key IN('cms_use_different_gateway','cms_use_different_gateway_desc','cms_root_page_url','pages_gateway_url_not_exist','cms_pages_different_gateway_impossible','pages_different_gateway_load_error','pages_different_gateway_load_error_rewrite','cms_root_page_url_rewrite_desc', 'cms_error_page', 'cms_error_page_desc', 'cms_error_page_none', 'cms_pages_settings' )"
]
]
},
{
"method": "delete",
"params": [
"core_sys_conf_settings",
[
"conf_key='cms_use_different_gateway'"
]
]
},
{
"method": "addColumn",
"params": [
"cms_databases",
{
"name": "database_canonical_flag",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": true,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
]
@@ -1,194 +0,0 @@
<?php
/**
* @brief {version_human} Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 24 Jun 2019
*/
namespace IPS\cms\setup\upg_104030;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* {version_human} Upgrade Code
*/
class _Upgrade
{
/**
* Fix Record and Comment Hide Reasons
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
/* Init */
$perCycle = 250;
$did = 0;
$lastId = \IPS\Request::i()->extra ? \intval( \IPS\Request::i()->extra ) : 0;
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
foreach( \IPS\Db::i()->select( 'sdl_id, sdl_obj_id', 'core_soft_delete_log', array( 'sdl_obj_key=? AND sdl_id > ?', 'ccs-records', $lastId ) ) as $hide )
{
/* Timeout? */
if( $cutOff !== null AND time() >= $cutOff )
{
return $lastId;
}
/* Step up */
$did++;
$lastId = $hide['sdl_id'];
$hidekey = NULL;
$items = 0;
foreach( \IPS\cms\Databases::databases() as $key => $db )
{
/* Try to fetch the record */
$item = 'IPS\cms\Records' . $key;
try
{
$record = $item::load( $hide['sdl_obj_id'] );
if ( $record->hidden() )
{
$hidekey = 'css-records' . $key;
$items++;
}
}
catch ( \OutOfRangeException $e ) { }
/* Try to fetch the comment */
try
{
$commentClass = 'IPS\cms\Records\Comment' . $key;
$comment = $commentClass::load( $hide['sdl_obj_id'] );
if ( $comment->hidden() )
{
$hidekey = 'ccs-records' . $key . '-comments';
$items++;
}
}
catch ( \OutOfRangeException $e ) { }
}
/* If we have only one item, we can update the row */
if ( $items == 1 )
{
\IPS\Db::i()->update( 'core_soft_delete_log', array( 'sdl_obj_key' => $hidekey ), array( 'sdl_id=?', $hide['sdl_id'] ) );
}
/* Else just delete the row */
else
{
\IPS\Db::i()->delete( 'core_soft_delete_log', array( 'sdl_id=?', $hide['sdl_id'] ) );
}
}
/* Did we do anything? */
if( $did )
{
return $lastId;
}
else
{
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing database hide reasons";
}
/**
* Fix Record Review Hide Reasons
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
/* Init */
$perCycle = 250;
$did = 0;
$lastId = \IPS\Request::i()->extra ? \intval( \IPS\Request::i()->extra ) : 0;
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
foreach( \IPS\Db::i()->select( 'sdl_id, sdl_obj_id', 'core_soft_delete_log', array( 'sdl_obj_key=? AND sdl_id > ?', 'ccs-records-review', $lastId ) ) as $hide )
{
/* Timeout? */
if( $cutOff !== null AND time() >= $cutOff )
{
return $lastId;
}
/* Step up */
$did++;
$lastId = $hide['sdl_id'];
$hidekey = NULL;
$items = 0;
foreach ( \IPS\cms\Databases::databases() as $key => $db )
{
/* Try to fetch the review */
try
{
$reviewClass = 'IPS\cms\Records\Review' . $key;
$review = $reviewClass::load( $hide['sdl_obj_id'] );
if ( $review->hidden() )
{
$hidekey = 'ccs-records' . $key . '-reviews';
$items++;
}
}
catch ( \OutOfRangeException $e )
{
}
}
/* If we have only one item, we can update the row */
if ( $items == 1 )
{
\IPS\Db::i()->update( 'core_soft_delete_log', array( 'sdl_obj_key' => $hidekey ), array( 'sdl_id=?', $hide['sdl_id'] ) );
}
/* Else just delete the row */
else
{
\IPS\Db::i()->delete( 'core_soft_delete_log', array( 'sdl_id=?', $hide['sdl_id'] ) );
}
}
/* Did we do anything? */
if( $did )
{
return $lastId;
}
else
{
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Fixing database review hide reasons";
}
}
Loaded 100 of 6736 files, more files were not shown because too many files have changed in this diff. Show more