Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 30 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -148,8 +148,6 @@ class _Upgrade
|
||||
|
||||
unset( $poll['poll_id'] );
|
||||
$poll['choices'] = $result;
|
||||
$poll['tid'] = 0;
|
||||
$poll['forum_id'] = 0;
|
||||
$poll['poll_only'] = 0;
|
||||
$poll['poll_view_voters'] = 0;
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 15 Jan 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 24 Feb 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 RC 5 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 15 Mar 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.4 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -24,63 +24,17 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
|
||||
/**
|
||||
* Convert entry images
|
||||
* Finish - This is run after all apps have been upgraded
|
||||
*
|
||||
* @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)
|
||||
* @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 step1()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? intval( \IPS\Request::i()->extra ) : 0;
|
||||
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_entries', "entry_image<>''", 'entry_id ASC', array( $limit, 1000 ) );
|
||||
|
||||
if ( !$select->count() )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
foreach ( $select as $entry )
|
||||
{
|
||||
try
|
||||
{
|
||||
$filePath = \IPS\ROOT_PATH . '/uploads/' . $entry['entry_image'];
|
||||
|
||||
$file = \IPS\File::create( 'core_Attachment', $entry['entry_image'], NULL, NULL, FALSE, $filePath );
|
||||
$attachment = $file->makeAttachment('');
|
||||
$fileName = htmlspecialchars( $attachment['attach_file'], \IPS\HTMLENTITIES, 'UTF-8', TRUE );
|
||||
|
||||
$image = <<<IMAGE
|
||||
<a href="<fileStore.core_Attachment>/{$file}" class="ipsAttachLink ipsAttachLink_image" style="float:left;"><img data-fileid="{$attachment['attach_id']}" src="<fileStore.core_Attachment>/{$file}" class="ipsImage ipsImage_thumbnailed" style="margin:10px;" alt="{$fileName}"></a>
|
||||
IMAGE;
|
||||
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_content' => $image . $entry['entry_content'] ), array( 'entry_id=?', $entry['entry_id'] ) );
|
||||
public function finish()
|
||||
{
|
||||
/* Rebuild old blog entry images as attachments */
|
||||
\IPS\Task::queue( 'blog', 'RebuildEntryImages', NULL, 2 );
|
||||
|
||||
$map = array(
|
||||
'attachment_id' => $attachment['attach_id'],
|
||||
'location_key' => 'blog_Entries',
|
||||
'id1' => $entry['entry_id'],
|
||||
'id2' => NULL,
|
||||
'id3' => NULL,
|
||||
'temp' => NULL,
|
||||
);
|
||||
|
||||
\IPS\Db::i()->replace( 'core_attachments_map', $map );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
|
||||
return $limit + 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Converting entry images";
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.5 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.9 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 19 Jun 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.10 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blogs
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 07 Jul 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* Update future entry flag
|
||||
*
|
||||
* @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)
|
||||
*/
|
||||
@@ -49,6 +49,13 @@ class _Upgrade
|
||||
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
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Updating blog future entry flag";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
{
|
||||
"name": "blog_name",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
{
|
||||
"name": "blog_desc",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_groupblog"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"auth_user"
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_authorized_users"
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_owner_only"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.4 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 05 Nov 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_101016;
|
||||
|
||||
/* 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.4 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Convert user blog name/desc to database
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Some init */
|
||||
$did = 0;
|
||||
$limit = 0;
|
||||
|
||||
if( isset( \IPS\Request::i()->extra ) )
|
||||
{
|
||||
$limit = \IPS\Request::i()->extra;
|
||||
}
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
/* Get owned blogs - group blogs are still translatable */
|
||||
foreach( \IPS\Db::i()->select( '*', 'blog_blogs', "blog_member_id > 0", 'blog_id ASC', array( $limit, 500 ) ) as $blog )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
$blog = \IPS\blog\Blog::constructFromData( $blog );
|
||||
|
||||
try
|
||||
{
|
||||
$language = \IPS\Lang::load( \IPS\Member::load( $blog->member_id )->language ?: \IPS\Lang::defaultLanguage() );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$language = \IPS\Lang::load( \IPS\Lang::defaultLanguage() );
|
||||
}
|
||||
|
||||
/* We will now store the name and desc in the blog_blogs table */
|
||||
$blog->name = $language->get( 'blogs_blog_' . $blog->_id );
|
||||
$blog->desc = $language->get( 'blogs_blog_' . $blog->_id . '_desc' );
|
||||
|
||||
$blog->save();
|
||||
|
||||
/* Remove the translatable language strings */
|
||||
\IPS\Lang::deleteCustom( 'blog', 'blogs_blog_' . $blog->_id );
|
||||
\IPS\Lang::deleteCustom( 'blog', 'blogs_blog_' . $blog->_id . '_desc' );
|
||||
}
|
||||
|
||||
if( $did )
|
||||
{
|
||||
return $limit + $did;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $_SESSION['_step1Count'] );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step1Count'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', "blog_member_id > 0" )->first();
|
||||
}
|
||||
|
||||
return "Converting blog names (Updated so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_content",
|
||||
{
|
||||
"name": "entry_content",
|
||||
"type": "MEDIUMTEXT",
|
||||
"length": 0,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.6 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 14 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\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
|
||||
{
|
||||
/**
|
||||
* Fix Blog RSS Feed Imports
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$perCycle = 1000;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'blog_rss_import', array( "rss_member=?", 0 ), 'rss_id ASC', array( $limit, $perCycle ) ) as $rss )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
try
|
||||
{
|
||||
$blog = \IPS\blog\Blog::load( $rss['rss_blog_id'] );
|
||||
|
||||
\IPS\Db::i()->update( 'blog_rss_import', array( 'rss_member' => $blog->member_id ), array( "rss_id=?", $rss['rss_id'] ) );
|
||||
}
|
||||
catch( \Exception $e ){}
|
||||
}
|
||||
|
||||
if ( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $_SESSION['_step1Count'] );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step1Count'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'blog_rss_import', array( "rss_member=?", 0 ) )->first();
|
||||
}
|
||||
|
||||
return "Fixing Blog RSS Imports (Upgraded so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_rating_average",
|
||||
{
|
||||
"name": "blog_rating_average",
|
||||
"type": "DECIMAL",
|
||||
"length": 11,
|
||||
"decimals": 1,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_lang_words",
|
||||
"word_app='blog' AND word_key='immediately'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key IN('blog_use_friendlyurls', 'blog_friendly_url', 'blog_friendlyurl_path', 'blog_boardindex_path')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN('blog_use_friendlyurls', 'blog_friendly_url', 'blog_friendlyurl_path', 'blog_boardindex_path');";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_22000;
|
||||
|
||||
/* 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
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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\core\Setup\Upgrade::runLegacySql( 'blog', 22000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_lastinfo",
|
||||
"blog_tag_cloud",
|
||||
{
|
||||
"name": "blog_tag_cloud",
|
||||
"type": "MEDIUMTEXT",
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_lastinfo",
|
||||
{
|
||||
"blog_tag_cloud": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_lastinfo CHANGE blog_tag_cloud blog_tag_cloud MEDIUMTEXT;";
|
||||
$SQL[] = "UPDATE blog_lastinfo SET blog_tag_cloud='';";
|
||||
|
||||
if( ! \IPS\Db::i()->checkForColumn( 'blog_themes', 'theme_css_overwrite' ) )
|
||||
{
|
||||
$SQL[] = "ALTER TABLE blog_themes ADD theme_css_overwrite TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -31,7 +31,10 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 22002 );
|
||||
if( ! \IPS\Db::i()->checkForColumn( 'blog_themes', 'theme_css_overwrite' ) )
|
||||
{
|
||||
\IPS\Db::i()->addColumn( 'blog_themes', array( 'name' => 'theme_css_overwrite', 'type' => 'tinyint', 'length' => 1, 'allow_null' => false, 'default' => 0 ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"name": "comment_approved",
|
||||
"type": "int",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"comment_approved": 1
|
||||
},
|
||||
[
|
||||
"comment_queued=?",
|
||||
"0"
|
||||
]
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"comment_approved": 0
|
||||
},
|
||||
[
|
||||
"comment_queued=?",
|
||||
"1"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Add comment_approved for new comments functionality:
|
||||
$SQL[] = "ALTER TABLE blog_comments ADD comment_approved INT(1) DEFAULT '0'";
|
||||
$SQL[] = "UPDATE blog_comments SET comment_approved = 1 WHERE comment_queued = 0";
|
||||
$SQL[] = "UPDATE blog_comments SET comment_approved = 0 WHERE comment_queued = 1";
|
||||
|
||||
// Get DB prefix:
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
|
||||
// Convert tracker to like:
|
||||
if ( \IPS\Db::i()->checkForTable('blog_tracker') )
|
||||
{
|
||||
if( \IPS\Db::i()->checkForTable('core_like') )
|
||||
{
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), MD5(CONCAT('blog;blog;', blog_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`";
|
||||
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), MD5(CONCAT('blog;entries;', entry_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL";
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`";
|
||||
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL";
|
||||
}
|
||||
|
||||
$SQL[] = "DROP TABLE blog_tracker";
|
||||
$SQL[] = "DROP TABLE blog_tracker_queue";
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -31,7 +31,42 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 23000 );
|
||||
$queries = array();
|
||||
|
||||
if ( \IPS\Db::i()->checkForTable('blog_tracker') )
|
||||
{
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
|
||||
if( \IPS\Db::i()->checkForTable('core_like') )
|
||||
{
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), MD5(CONCAT('blog;blog;', blog_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`" );
|
||||
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), MD5(CONCAT('blog;entries;', entry_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`" );
|
||||
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL" );
|
||||
}
|
||||
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "DROP TABLE {$PRE}blog_tracker" );
|
||||
|
||||
if( \IPS\Db::i()->checkForTable( 'blog_tracker_queue' ) )
|
||||
{
|
||||
\IPS\Db::i()->dropTable( 'blog_tracker_queue' );
|
||||
}
|
||||
}
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'blog', '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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"blog_views",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "blog_id",
|
||||
"columns": [
|
||||
"blog_id"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key='blog_exturl_newwindow'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Add indexs on blog_views
|
||||
$SQL[] = "ALTER TABLE blog_views ADD INDEX ( blog_id );";
|
||||
|
||||
// Remove unused settings
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key='blog_exturl_newwindow';";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_23002;
|
||||
|
||||
/* 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
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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\core\Setup\Upgrade::runLegacySql( 'blog', 23002 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"comment_queued"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_trackback",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_trackback_spamlogs",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_voters",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_akismet_logs",
|
||||
"log_date",
|
||||
{
|
||||
"name": "log_date",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
[
|
||||
"comment_use_sig",
|
||||
"comment_use_emo",
|
||||
"comment_html_state",
|
||||
"comment_append_edit",
|
||||
"comment_edit_name"
|
||||
]
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"comment_entry_id"
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "entry_id",
|
||||
"columns": [
|
||||
"entry_id",
|
||||
"comment_approved"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_status",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "entry_status",
|
||||
"columns": [
|
||||
"entry_status",
|
||||
"entry_last_update"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"11": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
{
|
||||
"blog_skin_id": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
/* Get DB functions/prefix */
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
$DB = \IPS\Db::i();
|
||||
|
||||
// Remove unused column - sometimes we don't have it thought...
|
||||
if ( $DB->checkForColumn( 'blog_comments', 'comment_queued' ) )
|
||||
{
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP comment_queued;";
|
||||
}
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_comments CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_trackback CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_trackback_spamlogs CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_voters CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_akismet_logs CHANGE log_date log_date INT( 10 ) NOT NULL DEFAULT '0';";
|
||||
|
||||
/* Drop unused fields */
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP comment_use_sig, DROP comment_use_emo, DROP comment_html_state, DROP comment_append_edit,
|
||||
DROP comment_edit_name, DROP INDEX comment_entry_id, ADD INDEX ( entry_id, comment_approved );";
|
||||
|
||||
/* Mess up indexes */
|
||||
$SQL[] = "ALTER TABLE blog_entries DROP INDEX entry_status, ADD INDEX entry_status ( entry_status, entry_last_update );";
|
||||
|
||||
|
||||
/* Remove custom skin choice */
|
||||
$SQL[] = "UPDATE blog_blogs SET blog_skin_id=0;";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_24000;
|
||||
|
||||
/* 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
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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\core\Setup\Upgrade::runLegacySql( 'blog', 24000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_header_id"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_headers"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key IN ('blog_enable_dheader','blog_cache_dheader','blog_headers')"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"name": "entry_image",
|
||||
"type": "varchar",
|
||||
"length": 255,
|
||||
"allow_null": false,
|
||||
"default": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"name": "entry_views",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_views",
|
||||
{
|
||||
"name": "entry_id",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_blogs DROP COLUMN blog_header_id;";
|
||||
$SQL[] = "DROP TABLE blog_headers;";
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN ('blog_enable_dheader','blog_cache_dheader','blog_headers');";
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_entries ADD COLUMN entry_image VARCHAR(255) NOT NULL DEFAULT '', ADD COLUMN entry_views INT(10) NOT NULL DEFAULT 0;";
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_views ADD COLUMN entry_id INT(10) NOT NULL DEFAULT 0;";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_25000;
|
||||
|
||||
/* 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
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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\core\Setup\Upgrade::runLegacySql( 'blog', 25000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key='blog_masks'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Some installs may still have this old (hidden) settings group installed
|
||||
$SQL[] = "DELETE FROM core_sys_settings_titles WHERE conf_title_keyword='blog_masks';";
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_25004;
|
||||
|
||||
/* 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
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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\core\Setup\Upgrade::runLegacySql( 'blog', 25004 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"entry_short": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"comment_member_id",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "comment_member_id",
|
||||
"columns": [
|
||||
"member_id",
|
||||
"comment_date"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"blog_category_mapping",
|
||||
"map_entry_id",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "map_blog_id",
|
||||
"columns": [
|
||||
"map_blog_id",
|
||||
"map_entry_id"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Reset short entries (#35240)
|
||||
$SQL[] = "UPDATE blog_entries SET entry_short='';";
|
||||
|
||||
|
||||
# New indexes, to avoid filesorts & full table scans
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP INDEX comment_member_id, ADD INDEX comment_member_id ( member_id, comment_date );";
|
||||
$SQL[] = "ALTER TABLE blog_category_mapping DROP INDEX map_entry_id, ADD INDEX map_blog_id ( map_blog_id, map_entry_id );";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_25005;
|
||||
|
||||
/* 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
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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\core\Setup\Upgrade::runLegacySql( 'blog', 25005 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -129,8 +129,8 @@ class _Upgrade
|
||||
*/
|
||||
public function step2()
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_ratings',
|
||||
\IPS\Db::i()->select( "NULL, 'IPS\\blog\\Entry', entry_id, member_id, rating, ''", 'blog_ratings', NULL, NULL, NULL, array( 'entry_id', 'member_id' ) )
|
||||
\IPS\Db::i()->replace( 'core_ratings',
|
||||
\IPS\Db::i()->select( "NULL, 'IPS\\blog\\Entry', entry_id, member_id, rating, ''", 'blog_ratings' )
|
||||
);
|
||||
|
||||
return TRUE;
|
||||
|
||||
Reference in new issue
Block a user