Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
Whitespace-only changes.
@@ -1,48 +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 Forums
|
||||
* @since 30 Oct 2014
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_100002;
|
||||
|
||||
/* 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
|
||||
{
|
||||
/**
|
||||
* Fix SEO titles
|
||||
*
|
||||
* @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( 'forums_forums', array( 'name_seo' => null, 'seo_last_title' => '', 'seo_last_name' => '' ) );
|
||||
\IPS\Db::i()->update( 'forums_topics', array( 'title_seo' => '' ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Resetting forums friendly URL titles";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,61 +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 Forums
|
||||
* @since 12 Dec 2014
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Fix index
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
if( !\IPS\Db::i()->checkForIndex( 'forums_topics', 'popular_topics' ) )
|
||||
{
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
|
||||
'table' => 'forums_topics',
|
||||
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "forums_topics ADD INDEX popular_topics (popular_time, approved, forum_id, start_date)"
|
||||
) ) );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'forums', '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 "Optimizing topics";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"name": "last_poster_anon",
|
||||
"type": "TINYINT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"auto_increment": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 RC 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 Forums
|
||||
* @since 3 Feb 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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 RC 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Step 1
|
||||
* Rebuild last poster data and queued counts
|
||||
*
|
||||
* @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 = 50;
|
||||
$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( '*', 'forums_forums', NULL, 'id ASC', array( $limit, $perCycle ) ) as $forum )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
$forum = \IPS\forums\Forum::constructFromData( $forum );
|
||||
|
||||
try
|
||||
{
|
||||
$forum->setLastComment();
|
||||
}
|
||||
catch( \Throwable )
|
||||
{
|
||||
/* This may error if columns are not present, so if it doesn't work, skip it. Later steps take care of it anyway. */
|
||||
}
|
||||
|
||||
$forum->queued_topics = \IPS\Db::i()->select( 'COUNT(*)', 'forums_topics', array( 'forum_id=? AND approved=0', $forum->id ) )->first();
|
||||
$forum->queued_posts = \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts', array( 'forums_topics.forum_id=? AND forums_posts.queued=1', $forum->id ) )->join( 'forums_topics', 'forums_topics.tid=forums_posts.topic_id' )->first();
|
||||
$forum->save();
|
||||
}
|
||||
|
||||
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(*)', 'forums_forums' )->first();
|
||||
}
|
||||
|
||||
return "Rebuilding last poster data for forums (Upgraded so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,38 +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 Forums
|
||||
* @since 15 Jan 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildItems', array( 'class' => 'IPS\forums\Topic' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\forums\Topic', 'count' => 0 ), 4, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "most_recent_post",
|
||||
"columns": [
|
||||
"forum_id",
|
||||
"approved",
|
||||
"last_post"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 RC 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 Forums
|
||||
* @since 5 May 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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 RC 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\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\forums\Topic' ), 4 );
|
||||
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\forums\Topic\Post' ), 4 );
|
||||
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\forums\Topic\ArchivedPost' ), 4 );
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 RC6 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 Forums
|
||||
* @since 18 Mar 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_100020;
|
||||
|
||||
/* 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 RC6 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Initiate queue task to remove old "deleted" topics/posts from 3.x
|
||||
*
|
||||
* @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\Task::queue( 'forums', 'DeleteLegacyTopics', array(), 1 );
|
||||
\IPS\Task::queue( 'forums', 'DeleteLegacyPosts', array(), 1 );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
{
|
||||
"name": "topic_hiddenposts",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,43 +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 Forums
|
||||
* @since 5 May 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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('forums');
|
||||
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\forums\Topic' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\forums\Topic\Post' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\forums\Topic\ArchivedPost' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildNonContentImages', array( 'extension' => 'forums_Forums' ), 3, array( 'extension' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.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 Forums
|
||||
* @since 27 May 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_100032;
|
||||
|
||||
/* 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.7 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()
|
||||
{
|
||||
/** fix broken forum announcements */
|
||||
\IPS\Db::i()->update( 'core_announcements', array( 'announce_ids' => NULL ), array( 'announce_ids=0 and announce_app=?', 'forums') );
|
||||
|
||||
|
||||
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,37 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.8 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 Forums
|
||||
* @since 15 Jan 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_100033;
|
||||
|
||||
/* 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.8 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()
|
||||
{
|
||||
/* Rebuild content to update counts for topics - this was broken for archived posts in older versions so adding here to fix them for this upgrade */
|
||||
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\forums\Topic', 'count' => 0 ), 4, array( 'class' ) );
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,186 +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 Forums
|
||||
* @since 19 Jun 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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
|
||||
{
|
||||
/**
|
||||
* In older versions, a forum may have been set as its own parent
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Do we have any forums that have parent_id = id? */
|
||||
if( \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums', "parent_id=id" )->first() )
|
||||
{
|
||||
$forum = new \IPS\forums\Forum;
|
||||
|
||||
$values = array(
|
||||
'forum_parent_id' => 0,
|
||||
'name' => 'Orphaned Forums',
|
||||
);
|
||||
|
||||
$forum->saveForm( $forum->formatFormValues( $values ) );
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'forums_forums', "parent_id=id" ) as $childForum )
|
||||
{
|
||||
$childForum = \IPS\forums\Forum::constructFromData( $childForum );
|
||||
$childForum->parent_id = $forum->_id;
|
||||
$childForum->save();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$forum->setLastComment();
|
||||
}
|
||||
catch( \Throwable )
|
||||
{
|
||||
/* This may error if columns are not present, so if it doesn't work, skip it. Later steps take care of it anyway. */
|
||||
}
|
||||
|
||||
$forum->setLastReview();
|
||||
$forum->save();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix archive table prefix issue
|
||||
*
|
||||
* @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\Settings::i()->archive_remote_sql_host )
|
||||
{
|
||||
$db = \IPS\Db::i( 'archive', array(
|
||||
'sql_host' => \IPS\Settings::i()->archive_remote_sql_host,
|
||||
'sql_user' => \IPS\Settings::i()->archive_remote_sql_user,
|
||||
'sql_pass' => \IPS\Settings::i()->archive_remote_sql_pass,
|
||||
'sql_database' => \IPS\Settings::i()->archive_remote_sql_database,
|
||||
'sql_port' => \IPS\Settings::i()->archive_sql_port,
|
||||
'sql_utf8mb4' => isset( \IPS\Settings::i()->sql_utf8mb4 ) ? \IPS\Settings::i()->sql_utf8mb4 : FALSE
|
||||
) );
|
||||
|
||||
foreach( $db->forceQuery( "SHOW TABLES LIKE '%". $db->escape_string( "forums_archive_posts" ) . "'" ) as $row )
|
||||
{
|
||||
if ( $value = current( $row ) )
|
||||
{
|
||||
$prefix = str_replace( 'forums_archive_posts', '', $value );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $prefix )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Db::i()->select( 'conf_value', 'core_sys_conf_settings', array( 'conf_key=?', 'archive_sql_tbl_prefix' ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $ex )
|
||||
{
|
||||
$insert = array(
|
||||
'conf_key' => 'archive_sql_tbl_prefix',
|
||||
'conf_value' => '',
|
||||
'conf_default' => '',
|
||||
'conf_keywords' => '',
|
||||
'conf_app' => 'forums'
|
||||
);
|
||||
|
||||
/* This key was added in 4.0.9 so it will not exist */
|
||||
\IPS\Db::i()->insert( 'core_sys_conf_settings', $insert );
|
||||
}
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'archive_sql_tbl_prefix' => $prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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' );
|
||||
if ( \IPS\Application::appIsEnabled('cms') )
|
||||
{
|
||||
$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'] == 'latestTopics' )
|
||||
{
|
||||
$widgets[ $k ]['key'] = 'topicFeed';
|
||||
$update = TRUE;
|
||||
}
|
||||
if ( $widget['key'] == 'featuredTopics' )
|
||||
{
|
||||
$widgets[ $k ]['key'] = 'topicFeed';
|
||||
$widgets[ $k ]['configuration']['tfb_topic_status'] = array( 'open', 'closed', 'pinned', 'notpinned', 'featured' );
|
||||
$update = TRUE;
|
||||
}
|
||||
|
||||
if ( $widget['key'] == 'topicFeed' )
|
||||
{
|
||||
if ( isset( $widgets[ $k ]['configuration'] ) )
|
||||
{
|
||||
$config = array();
|
||||
foreach ( $widgets[ $k ]['configuration'] as $_k => $_v )
|
||||
{
|
||||
$_k = str_replace( 'tfb_', 'widget_feed', $_k );
|
||||
if ( $_k == 'widget_feed_topic_status' )
|
||||
{
|
||||
$_k = 'widget_feed_status';
|
||||
}
|
||||
$widgets[ $k ]['configuration'][ $_k ] = $_v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $update )
|
||||
{
|
||||
\IPS\Db::i()->update( $table, array( $widgetsColumn => json_encode( $widgets ) ), $whereClause );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_widgets",
|
||||
[
|
||||
"app=? AND `key`=?",
|
||||
"forums",
|
||||
"latestTopics"
|
||||
]
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_widgets",
|
||||
[
|
||||
"app=? AND `key`=?",
|
||||
"forums",
|
||||
"featuredTopics"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_widgets",
|
||||
"`key` IN('featuredTopics','latestTopics')"
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"forums_posts",
|
||||
"queued",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "queued",
|
||||
"columns": [
|
||||
"queued",
|
||||
"post_date"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"forums_archive_posts",
|
||||
"archive_author_name",
|
||||
{
|
||||
"name": "archive_author_name",
|
||||
"type": "VARCHAR",
|
||||
"length": 255,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,37 +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 Forums
|
||||
* @since 15 Jan 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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 Beta 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\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\forums\Topic', 'count' => 0 ), 4, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"forums_archive_posts",
|
||||
[
|
||||
"archive_show_signature",
|
||||
"archive_show_emoticons"
|
||||
]
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"forums_posts",
|
||||
[
|
||||
"use_sig",
|
||||
"use_emo"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.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 Forums
|
||||
* @since 29 Oct 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_101012;
|
||||
|
||||
/* 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.2 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Fix container counts that may be off due to bug with adding in archived posts 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()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Rebuilding forum post counts";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"sub_can_post": 0
|
||||
},
|
||||
[
|
||||
"parent_id=?",
|
||||
-1
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"forums_posts",
|
||||
"topic_id",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "topic_id",
|
||||
"columns": [
|
||||
"topic_id",
|
||||
"queued",
|
||||
"post_date",
|
||||
"author_id"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.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 Forums
|
||||
* @since 06 Nov 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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
|
||||
{
|
||||
/**
|
||||
* Fixing incorrectly hidden posts
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$toRunQueries = array(
|
||||
array(
|
||||
'table' => 'forums_posts',
|
||||
'query' => "UPDATE " . \IPS\Db::i()->prefix . "forums_posts SET queued=0 WHERE (queued=2 AND topic_id IN( SELECT tid FROM " . \IPS\Db::i()->prefix . "forums_topics WHERE approved=1 ) )",
|
||||
)
|
||||
);
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( '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 incorrectly hidden posts";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,93 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.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 Forums
|
||||
* @since 23 Nov 2015
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_101018;
|
||||
|
||||
/* 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.5 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Find forums where the parent/child mapping creates an infinite loop
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$count = \IPS\Db::i()->select( 'COUNT(*)', array( 'forums_forums', 'f1' ), 'f1.parent_id=f2.id' )->join( array( 'forums_forums', 'f2' ), 'f1.id=f2.parent_id' )->first();
|
||||
|
||||
if( $count )
|
||||
{
|
||||
/* Create a new category */
|
||||
$category = new \IPS\forums\Forum;
|
||||
$category->parent_id = -1;
|
||||
$category->forum_parent_id = 0;
|
||||
$category->forum_min_posts_view = 0;
|
||||
$category->forum_can_view_others = 1;
|
||||
$category->forum_sort_key = 'last_post';
|
||||
$category->forum_permission_showtopic = 0;
|
||||
$category->save();
|
||||
|
||||
\IPS\Lang::saveCustom( 'forums', 'forums_forums_' . $category->id, "Temporary Category" );
|
||||
|
||||
foreach( \IPS\Db::i()->select( 'f1.*', array( 'forums_forums', 'f1' ), 'f1.parent_id=f2.id' )->join( array( 'forums_forums', 'f2' ), 'f1.id=f2.parent_id' ) as $forum )
|
||||
{
|
||||
\IPS\Db::i()->update( 'forums_forums', array( 'parent_id' => $category->id ), array( 'id=?', $forum['id'] ) );
|
||||
}
|
||||
|
||||
$category->setLastComment();
|
||||
$category->save();
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Fixing incorrectly mapped forums";
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix container counts that may be off due to bug with unapproved topics
|
||||
*
|
||||
* @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', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Rebuilding forum post counts";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.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 Forums
|
||||
* @since 04 Jan 2016
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_101023;
|
||||
|
||||
/* 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.7 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* 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 step1()
|
||||
{
|
||||
\IPS\Task::queue( 'forums', 'TopicStarterIds', array(), 4 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Updating topic starter IDs";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"ipseo_priority": "-1"
|
||||
},
|
||||
[
|
||||
"ipseo_priority=?",
|
||||
""
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.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 Forums
|
||||
* @since 04 Jan 2016
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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
|
||||
{
|
||||
/**
|
||||
* 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 step1()
|
||||
{
|
||||
\IPS\Task::queue( 'forums', 'HiddenFirstPost', array(), 4 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Updating incorrectly hidden topics";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.10 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 Forums
|
||||
* @since 12 Apr 2016
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_101027;
|
||||
|
||||
/* 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.10 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Rebuild container counts
|
||||
*
|
||||
* @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\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.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 Forums
|
||||
* @since 12 Apr 2016
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_101028;
|
||||
|
||||
/* 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.11 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()
|
||||
{
|
||||
\IPS\Task::queue( 'forums', 'RebuildNewTopicFlag', array(), 4 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Fixing first posts";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "last_true_post",
|
||||
"columns": [
|
||||
"forum_id",
|
||||
"pinned",
|
||||
"last_post"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.14 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 Forums
|
||||
* @since 07 Jul 2016
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_101042;
|
||||
|
||||
/* 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.14 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Recount categories in case pending topics/posts count is off
|
||||
*
|
||||
* @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( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_archive_posts",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "archive_forum_id",
|
||||
"columns": [
|
||||
"archive_forum_id"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
"last_post",
|
||||
{
|
||||
"name": "last_post",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"forums_archive_rules",
|
||||
[
|
||||
"archive_app=? AND archive_field=? AND archive_text=?",
|
||||
"forums",
|
||||
"member",
|
||||
""
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,81 +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 Forums
|
||||
* @since 27 Jan 2017
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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
|
||||
{
|
||||
/**
|
||||
* Add index to forums_archive_posts (taking into account it may be in a remote 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()
|
||||
{
|
||||
/* If we already have an index on the ip address AND the queued column, we can just move along. */
|
||||
if( \IPS\forums\Topic\ArchivedPost::db()->checkForIndex( 'forums_archive_posts', 'archive_ip_address' ) AND
|
||||
\IPS\forums\Topic\ArchivedPost::db()->checkForIndex( 'forums_archive_posts', 'archive_queued' ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Get the query that needs to be ran */
|
||||
$missingIndexes = array();
|
||||
|
||||
if( !\IPS\forums\Topic\ArchivedPost::db()->checkForIndex( 'forums_archive_posts', 'archive_ip_address' ) )
|
||||
{
|
||||
$missingIndexes[] = \IPS\forums\Topic\ArchivedPost::db()->buildIndex( 'forums_archive_posts', array( 'type' => 'key', 'name' => 'archive_ip_address', 'columns' => array( 'archive_ip_address' ) ) );
|
||||
}
|
||||
|
||||
if( !\IPS\forums\Topic\ArchivedPost::db()->checkForIndex( 'forums_archive_posts', 'archive_queued' ) )
|
||||
{
|
||||
$missingIndexes[] = \IPS\forums\Topic\ArchivedPost::db()->buildIndex( 'forums_archive_posts', array( 'type' => 'key', 'name' => 'archive_queued', 'columns' => array( 'archive_queued', 'archive_content_date' ) ) );
|
||||
}
|
||||
|
||||
$query = "ALTER TABLE `" . \IPS\forums\Topic\ArchivedPost::db()->prefix . \IPS\forums\Topic\ArchivedPost::db()->escape_string( 'forums_archive_posts' ) . "` " . implode( ', ', $missingIndexes );
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
|
||||
'table' => 'forums_archive_posts',
|
||||
'query' => $query,
|
||||
'db' => \IPS\forums\Topic\ArchivedPost::db()
|
||||
) ) );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'forums', 'extra' => array( '_upgradeStep' => 2, '_upgradeData' => 0 ) ) );
|
||||
|
||||
/* 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 "Optimizing archived posts";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,52 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "forums_view_method",
|
||||
"columns": {
|
||||
"member_id": {
|
||||
"name": "member_id",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": "",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"method": {
|
||||
"name": "method",
|
||||
"type": "VARCHAR",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": "table",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"PRIMARY": {
|
||||
"type": "primary",
|
||||
"name": "PRIMARY",
|
||||
"columns": [
|
||||
"member_id"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,109 +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 Forums
|
||||
* @since 12 Apr 2017
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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
|
||||
{
|
||||
/**
|
||||
* Adjust some columns - we do it here to combine queries
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array(
|
||||
array(
|
||||
'table' => 'forums_topics',
|
||||
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "forums_topics ADD COLUMN topic_meta_data bit(1) NOT NULL DEFAULT b'0',
|
||||
CHANGE title title VARCHAR(255) COLLATE " . \IPS\Db::i()->collation . " NOT NULL DEFAULT '',
|
||||
CHANGE title_seo title_seo VARCHAR(255) COLLATE " . \IPS\Db::i()->collation . " NOT NULL DEFAULT ''"
|
||||
),
|
||||
array(
|
||||
'table' => 'forums_forums',
|
||||
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "forums_forums ADD COLUMN club_id BIGINT(20) DEFAULT NULL COMMENT 'The club ID if this forum belongs to a club, or NULL',
|
||||
ADD COLUMN feature_color VARCHAR(15) COLLATE " . \IPS\Db::i()->collation . " DEFAULT NULL COMMENT 'Feature color',
|
||||
CHANGE last_title last_title VARCHAR(255) COLLATE " . \IPS\Db::i()->collation . " DEFAULT NULL"
|
||||
) ) );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'forums', 'extra' => array( '_upgradeStep' => 2, '_upgradeData' => 0 ) ) );
|
||||
|
||||
/* 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 "Adjusting topic and forum database tables";
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme settings clean up
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Remove forum_layout theme setting */
|
||||
$ids = iterator_to_array( \IPS\Db::i()->select( 'sc_id', 'core_theme_settings_fields', array( 'sc_key=? and sc_app=?', 'forum_layout', 'forums' ) ) );
|
||||
|
||||
if( \count( $ids ) )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_theme_settings_values', 'sv_id IN(' . implode( ',', $ids ) . ')' );
|
||||
\IPS\Db::i()->delete( 'core_theme_settings_fields', 'sc_id IN(' . implode( ',', $ids ) . ')' );
|
||||
}
|
||||
|
||||
/* Then remove it from each theme where it is cached */
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_themes' ) as $theme )
|
||||
{
|
||||
$settings = json_decode( $theme['set_template_settings'], true );
|
||||
|
||||
if( isset( $settings['forum_layout'] ) )
|
||||
{
|
||||
unset( $settings['forum_layout'] );
|
||||
|
||||
\IPS\Db::i()->update( 'core_themes', array( 'set_template_settings' => json_encode( $settings ) ), array( 'set_id=?', $theme['set_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Removing old theme settings";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_lang_words",
|
||||
[
|
||||
"word_app=? AND word_key=?",
|
||||
"forums",
|
||||
"today"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.2.2 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 Forums
|
||||
* @since 26 Jul 2017
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_102005;
|
||||
|
||||
/* 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.2 Beta 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Recount containers
|
||||
*
|
||||
* @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( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,47 +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 Forums
|
||||
* @since 06 Oct 2017
|
||||
*/
|
||||
|
||||
namespace IPS\forums\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
|
||||
{
|
||||
/**
|
||||
* Fix container counts that may be off due to bug with adding in archived posts 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()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Rebuilding forum post counts";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,138 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"posts": 0
|
||||
},
|
||||
[
|
||||
"posts < ?",
|
||||
0
|
||||
]
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
"posts",
|
||||
{
|
||||
"name": "posts",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"topics": 0
|
||||
},
|
||||
[
|
||||
"topics < ?",
|
||||
0
|
||||
]
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
"topics",
|
||||
{
|
||||
"name": "topics",
|
||||
"type": "INT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"queued_topics": 0
|
||||
},
|
||||
[
|
||||
"queued_topics < ?",
|
||||
0
|
||||
]
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
"queued_topics",
|
||||
{
|
||||
"name": "queued_topics",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"queued_posts": 0
|
||||
},
|
||||
[
|
||||
"queued_posts < ?",
|
||||
0
|
||||
]
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
"queued_posts",
|
||||
{
|
||||
"name": "queued_posts",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
{
|
||||
"moved_to": null
|
||||
},
|
||||
[
|
||||
"moved_to=?",
|
||||
"NULL"
|
||||
]
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "min_posts_view",
|
||||
"columns": [
|
||||
"min_posts_view"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"forums_rss_import",
|
||||
{
|
||||
"name": "rss_import_auto_follow",
|
||||
"type": "TINYINT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
"ipseo_priority=-1",
|
||||
"club_id is not null"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"forums_answer_ratings",
|
||||
"member_rating",
|
||||
{
|
||||
"type": "unique",
|
||||
"name": "member_rating",
|
||||
"columns": [
|
||||
"member",
|
||||
"post"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"forums_question_ratings",
|
||||
"member_rating",
|
||||
{
|
||||
"type": "unique",
|
||||
"name": "member_rating",
|
||||
"columns": [
|
||||
"member",
|
||||
"topic"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_question_ratings",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "topic",
|
||||
"columns": [
|
||||
"topic",
|
||||
"member"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_rss_import",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "member",
|
||||
"columns": [
|
||||
"rss_import_mid"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
"views",
|
||||
{
|
||||
"name": "views",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "can_view_others",
|
||||
"columns": [
|
||||
"can_view_others"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "forum_password",
|
||||
"columns": [
|
||||
"password"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "widget_performance",
|
||||
"columns": [
|
||||
"min_posts_view",
|
||||
"password",
|
||||
"password_override",
|
||||
"can_view_others"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null,
|
||||
250,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
{
|
||||
"topic_hiddenposts": 0,
|
||||
"topic_queuedposts": 0
|
||||
},
|
||||
[
|
||||
"state=?",
|
||||
"merged"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.4.7 Beta 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 Forums
|
||||
* @since 06 Sep 2019
|
||||
*/
|
||||
|
||||
namespace IPS\forums\setup\upg_104042;
|
||||
|
||||
/* 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.7 Beta 2 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Step 1
|
||||
* Rebuild last poster data and queued counts
|
||||
*
|
||||
* @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 = 50;
|
||||
$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( '*', 'forums_forums', NULL, 'id ASC', array( $limit, $perCycle ) ) as $forum )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
$forum = \IPS\forums\Forum::constructFromData( $forum );
|
||||
$forum->resetCommentCounts();
|
||||
$forum->save();
|
||||
}
|
||||
|
||||
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(*)', 'forums_forums' )->first();
|
||||
}
|
||||
|
||||
return "Rebuilding comment count data for forums (Upgraded so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"forums_topics",
|
||||
{
|
||||
"topic_queuedposts": 0
|
||||
},
|
||||
[
|
||||
"state=?",
|
||||
"link"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@
|
||||
"forum_can_view_others_club_desc",
|
||||
"forum_card_image",
|
||||
"forum_card_image_desc",
|
||||
"bw_enable_answers_moderator",
|
||||
"bw_enable_answers_moderator_desc",
|
||||
"bw_solved_set_by_moderator",
|
||||
"bw_solved_set_by_moderator_desc",
|
||||
"bw_enable_answers__member",
|
||||
"bw_enable_answers__member_desc",
|
||||
"topic_meta_unread",
|
||||
|
||||
@@ -12,16 +12,25 @@
|
||||
namespace IPS\forums\setup\upg_105013;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use Exception;
|
||||
use IPS\Db;
|
||||
use IPS\Settings;
|
||||
use IPS\Task;
|
||||
use UnderflowException;
|
||||
use function defined;
|
||||
use const IPS\CIC;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.5.0 Beta 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
class Upgrade
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
@@ -31,15 +40,15 @@ class _Upgrade
|
||||
public function step1()
|
||||
{
|
||||
/* Make sure we have the table first */
|
||||
if( !\IPS\Db::i()->checkForTable('forums_rss_import') )
|
||||
if( !Db::i()->checkForTable('forums_rss_import') )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Move over forums_rss_import to core_rss_import */
|
||||
foreach( \IPS\Db::i()->select( '*', 'forums_rss_import' ) as $rss )
|
||||
foreach( Db::i()->select( '*', 'forums_rss_import' ) as $rss )
|
||||
{
|
||||
$newImportId = \IPS\Db::i()->insert( 'core_rss_import', array(
|
||||
$newImportId = Db::i()->insert( 'core_rss_import', array(
|
||||
'rss_import_enabled' => $rss['rss_import_enabled'],
|
||||
'rss_import_title' => $rss['rss_import_title'],
|
||||
'rss_import_url' => $rss['rss_import_url'],
|
||||
@@ -62,13 +71,13 @@ class _Upgrade
|
||||
try
|
||||
{
|
||||
/* Prevent multiple runs from breaking */
|
||||
\IPS\Db::i()->delete( 'core_rss_imported', array( 'rss_imported_import_id=?', $newImportId ) );
|
||||
Db::i()->delete( 'core_rss_imported', array( 'rss_imported_import_id=?', $newImportId ) );
|
||||
|
||||
\IPS\Db::i()->query( "INSERT INTO " . \IPS\Db::i()->prefix . "core_rss_imported
|
||||
Db::i()->query( "INSERT INTO " . Db::i()->prefix . "core_rss_imported
|
||||
(rss_imported_guid, rss_imported_content_id, rss_imported_import_id )
|
||||
( SELECT a.rss_imported_guid, a.rss_imported_tid, {$newImportId} FROM " . \IPS\Db::i()->prefix . "forums_rss_imported a WHERE a.rss_imported_impid={$rss['rss_import_id']})" );
|
||||
( SELECT a.rss_imported_guid, a.rss_imported_tid, {$newImportId} FROM " . Db::i()->prefix . "forums_rss_imported a WHERE a.rss_imported_impid={$rss['rss_import_id']})" );
|
||||
}
|
||||
catch( \Exception $e ) { }
|
||||
catch( Exception $e ) { }
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -82,13 +91,13 @@ class _Upgrade
|
||||
public function finish()
|
||||
{
|
||||
/* Delete old tasks */
|
||||
\IPS\Db::i()->delete( 'core_tasks', array( 'app=? and `key`=?', 'forums', 'rssimport' ) );
|
||||
Db::i()->delete( 'core_tasks', array( 'app=? and `key`=?', 'forums', 'rssimport' ) );
|
||||
|
||||
/* Delete old template */
|
||||
\IPS\Db::i()->delete( 'core_theme_templates', array( 'template_app=? and template_name=?', 'forums', 'importPreview' ) );
|
||||
Db::i()->delete( 'core_theme_templates', array( 'template_app=? and template_name=?', 'forums', 'importPreview' ) );
|
||||
|
||||
/* Delete old language strings */
|
||||
\IPS\Db::i()->delete( 'core_sys_lang_words', array( 'word_app=? and ' . \IPS\Db::i()->in( 'word_key', array(
|
||||
Db::i()->delete( 'core_sys_lang_words', array( 'word_app=? and ' . Db::i()->in( 'word_key', array(
|
||||
'r__rss',
|
||||
'r__rss_manage',
|
||||
'r__rss_add',
|
||||
@@ -100,35 +109,35 @@ class _Upgrade
|
||||
) ), 'forums' ) );
|
||||
|
||||
/* Delete old RSS Table */
|
||||
if( \IPS\Db::i()->checkForTable('forums_rss_import') )
|
||||
if( Db::i()->checkForTable('forums_rss_import') )
|
||||
{
|
||||
\IPS\Db::i()->dropTable( array( 'forums_rss_import', 'forums_rss_imported' ) );
|
||||
Db::i()->dropTable( array( 'forums_rss_import', 'forums_rss_imported' ) );
|
||||
}
|
||||
|
||||
/* Kick off solve index build */
|
||||
\IPS\Task::queue( 'forums', 'RebuildSolvedIndex', array(), 4 );
|
||||
Task::queue( 'forums', 'RebuildSolvedIndex', array(), 4 );
|
||||
|
||||
/* Insert forums_Cards storage extension */
|
||||
$settings = json_decode( \IPS\Settings::i()->upload_settings, TRUE );
|
||||
$settings = json_decode( Settings::i()->upload_settings, TRUE );
|
||||
|
||||
try
|
||||
{
|
||||
if ( \IPS\CIC )
|
||||
if ( CIC )
|
||||
{
|
||||
$configurationId = \IPS\Db::i()->select( 'id', 'core_file_storage', array( "method=?", 'Amazon' ), "id ASC" )->first();
|
||||
$configurationId = Db::i()->select( 'id', 'core_file_storage', array( "method=?", 'Amazon' ), "id ASC" )->first();
|
||||
}
|
||||
else
|
||||
{
|
||||
$configurationId = \IPS\Db::i()->select( 'id', 'core_file_storage', array( "method=?", 'FileSystem' ), "id ASC" )->first();
|
||||
$configurationId = Db::i()->select( 'id', 'core_file_storage', array( "method=?", 'FileSystem' ), "id ASC" )->first();
|
||||
}
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
catch( UnderflowException $e )
|
||||
{
|
||||
$configurationId = \IPS\Db::i()->select( 'id', 'core_file_storage', NULL, "id ASC" )->first();
|
||||
$configurationId = Db::i()->select( 'id', 'core_file_storage', NULL, "id ASC" )->first();
|
||||
}
|
||||
|
||||
$settings['filestorage__forums_Cards'] = $configurationId;
|
||||
\IPS\Settings::i()->changeValues( array( 'upload_settings' => json_encode( $settings ) ) );
|
||||
Settings::i()->changeValues( array( 'upload_settings' => json_encode( $settings ) ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -12,16 +12,22 @@
|
||||
namespace IPS\forums\setup\upg_105021;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Db;
|
||||
use function defined;
|
||||
use function IPS\Cicloud\getForcedArchiving;
|
||||
use const IPS\CIC2;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.5.0 Beta 5 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
class Upgrade
|
||||
{
|
||||
/**
|
||||
* Auto-enable archiving on CIC2 if appropriate
|
||||
@@ -31,10 +37,10 @@ class _Upgrade
|
||||
public function step1()
|
||||
{
|
||||
/* Auto-enable post archiving if the community is CIC2 and has more than 255K posts */
|
||||
if ( \IPS\CIC2 AND \IPS\Cicloud\getForcedArchiving() )
|
||||
if ( CIC2 AND getForcedArchiving() )
|
||||
{
|
||||
/* Make sure archiving is on */
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'archive' ) );
|
||||
Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'archive' ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -12,16 +12,24 @@
|
||||
namespace IPS\forums\setup\upg_105116;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Db;
|
||||
use IPS\forums\Topic;
|
||||
use IPS\Settings;
|
||||
use function defined;
|
||||
use function IPS\Cicloud\getForcedArchiving;
|
||||
use const IPS\CIC2;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.5.4 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
class Upgrade
|
||||
{
|
||||
/**
|
||||
* Tweak archiving for CIC2
|
||||
@@ -31,23 +39,23 @@ class _Upgrade
|
||||
public function step1()
|
||||
{
|
||||
/* If this is a CIC2 site... */
|
||||
if ( \IPS\CIC2 )
|
||||
if ( CIC2 )
|
||||
{
|
||||
/* Make sure archiving is on if it should be */
|
||||
if( \IPS\Cicloud\getForcedArchiving() )
|
||||
if( getForcedArchiving() )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'archive' ) );
|
||||
Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'archive' ) );
|
||||
}
|
||||
/* Otherwise unarchive everything and make sure archiving is not enabled. They can turn back on later if they want. */
|
||||
else
|
||||
{
|
||||
\IPS\Db::i()->update( 'forums_topics', array( 'topic_archive_status' => \IPS\forums\Topic::ARCHIVE_RESTORE ), array( 'topic_archive_status=?', \IPS\forums\Topic::ARCHIVE_DONE ) );
|
||||
Db::i()->update( 'forums_topics', array( 'topic_archive_status' => Topic::ARCHIVE_RESTORE ), array( 'topic_archive_status=?', Topic::ARCHIVE_DONE ) );
|
||||
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 'archive' ) );
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'unarchive' ) );
|
||||
Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 'archive' ) );
|
||||
Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'unarchive' ) );
|
||||
|
||||
/* This disables the archiving setting */
|
||||
\IPS\Settings::i()->changeValues( array( 'archive_last_post_cloud' => 100 ) );
|
||||
Settings::i()->changeValues( array( 'archive_last_post_cloud' => 100 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"solved_stats_chart_desc"
|
||||
],
|
||||
"edited": [
|
||||
"bw_enable_answers_moderator_desc"
|
||||
"bw_solved_set_by_moderator_desc"
|
||||
],
|
||||
"removed": [
|
||||
"show_all"
|
||||
|
||||
@@ -12,16 +12,21 @@
|
||||
namespace IPS\forums\setup\upg_107025;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Db;
|
||||
use IPS\Task;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.7.2 Beta 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
class Upgrade
|
||||
{
|
||||
/**
|
||||
* Changes to solved mode
|
||||
@@ -31,12 +36,12 @@ class _Upgrade
|
||||
public function step1()
|
||||
{
|
||||
/* Prevent all topics from being emailed after upgrade, just leave those that have been started within the last 14 days as able to be emailed */
|
||||
\IPS\Db::i()->update( 'forums_topics', [ 'solved_reminder_sent' => time() ], [ 'start_date < ?', ( time() - ( 14 * 86400 ) ) ] );
|
||||
Db::i()->update( 'forums_topics', [ 'solved_reminder_sent' => time() ], [ 'start_date < ?', ( time() - ( 14 * 86400 ) ) ] );
|
||||
|
||||
/* Kick off a rebuild so stats are populated */
|
||||
foreach( \IPS\Db::i()->select( '*', 'forums_forums', array( 'topics>? and ( forums_bitoptions & ? or forums_bitoptions & ? or forums_bitoptions & ? )', 0, 4, 8, 16 ) ) as $forum )
|
||||
foreach( Db::i()->select( '*', 'forums_forums', array( 'topics>? and ( forums_bitoptions & ? or forums_bitoptions & ? or forums_bitoptions & ? )', 0, 4, 8, 16 ) ) as $forum )
|
||||
{
|
||||
\IPS\Task::queue( 'forums', 'RebuildSolvedStats', array( 'forum_id' => $forum['id'] ) );
|
||||
Task::queue( 'forums', 'RebuildSolvedStats', array( 'forum_id' => $forum['id'] ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -12,16 +12,20 @@
|
||||
namespace IPS\forums\setup\upg_107028;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Task;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.7.2 Beta 3 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
class Upgrade
|
||||
{
|
||||
/**
|
||||
* Recount forums.
|
||||
@@ -30,7 +34,7 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 4, array( 'class' ) );
|
||||
Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 4, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107702,
|
||||
"name": "4.7.12 Beta 3",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"forums_forums",
|
||||
{
|
||||
"name": "solved_stats_from_cutoff",
|
||||
"type": "INT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": 0,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"auto_increment": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107748,
|
||||
"name": "4.7.16",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107750,
|
||||
"name": "4.7.16",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107751,
|
||||
"name": "4.7.16",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107774,
|
||||
"name": "4.7.18",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107775,
|
||||
"name": "4.7.18",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107781,
|
||||
"name": "4.7.19 Beta 2",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107782,
|
||||
"name": "4.7.19 Beta 3",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107783,
|
||||
"name": "4.7.19 Beta 4",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107784,
|
||||
"name": "4.7.19",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": 107785,
|
||||
"name": "4.7.19",
|
||||
"steps": {
|
||||
"queries": false,
|
||||
"lang": false,
|
||||
"theme": false,
|
||||
"themeSettings": false,
|
||||
"javascript": false,
|
||||
"emailTemplates": false,
|
||||
"hooks": false,
|
||||
"acpSearchKeywords": false,
|
||||
"settings": false,
|
||||
"tasks": false,
|
||||
"modules": false,
|
||||
"widgets": false,
|
||||
"customOptions": false,
|
||||
"customRoutines": false
|
||||
},
|
||||
"forceMainUpgrader": false,
|
||||
"forceManualDownloadNoCiC": false,
|
||||
"forceManualDownloadCiC": false
|
||||
}
|
||||
Loaded 100 of 6736 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user