mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
oops, need to re-sync forums just in case too
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@2580 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
290a897da4
commit
56ca0b0045
1 changed files with 46 additions and 43 deletions
|
@ -8,6 +8,7 @@ include($phpbb_root_path . 'extension.inc');
|
||||||
include($phpbb_root_path . 'config.'.$phpEx);
|
include($phpbb_root_path . 'config.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||||
|
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||||
|
|
||||||
$sql = "SELECT config_value
|
$sql = "SELECT config_value
|
||||||
|
@ -82,56 +83,58 @@ if ( $row = $db->sql_fetchrow($result) )
|
||||||
$sql = "SELECT topic_id, topic_moved_id
|
$sql = "SELECT topic_id, topic_moved_id
|
||||||
FROM " . TOPICS_TABLE . "
|
FROM " . TOPICS_TABLE . "
|
||||||
WHERE topic_moved_id <> 0";
|
WHERE topic_moved_id <> 0";
|
||||||
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
|
{
|
||||||
|
die("Couldn't update version info");
|
||||||
|
}
|
||||||
|
|
||||||
|
$topic_ary = array();
|
||||||
|
while ( $row = $db->sql_fetchrow($result) )
|
||||||
|
{
|
||||||
|
$topic_ary[$row['topic_id']] = $row['topic_moved_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
while ( list($topic_id, $topic_moved_id) = each($topic_ary) )
|
||||||
|
{
|
||||||
|
$sql = "SELECT MAX(post_id) AS last_post, MIN(post_id) AS first_post, COUNT(post_id) AS total_posts
|
||||||
|
FROM " . POSTS_TABLE . "
|
||||||
|
WHERE topic_id = $topic_moved_id";
|
||||||
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $row = $db->sql_fetchrow($result) )
|
||||||
|
{
|
||||||
|
$sql = "UPDATE " . TOPICS_TABLE . "
|
||||||
|
SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . "
|
||||||
|
WHERE topic_id = $topic_id";
|
||||||
|
if ( !$db->sql_query($sql) )
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($sql);
|
||||||
|
|
||||||
|
$sql = "UPDATE " . CONFIG_TABLE . "
|
||||||
|
SET config_value = '.0.1'
|
||||||
|
WHERE config_name = 'version'";
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
{
|
{
|
||||||
die("Couldn't update version info");
|
die("Couldn't update version info");
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic_ary = array();
|
sync('all forums');
|
||||||
while ( $row = $db->sql_fetchrow($result) )
|
|
||||||
{
|
|
||||||
$topic_ary[$row['topic_id']] = $row['topic_moved_id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
while ( list($topic_id, $topic_moved_id) = each($topic_ary) )
|
die("UPDATING COMPLETE -> 2.0.1 Final installed");
|
||||||
{
|
break;
|
||||||
$sql = "SELECT MAX(post_id) AS last_post, MIN(post_id) AS first_post, COUNT(post_id) AS total_posts
|
|
||||||
FROM " . POSTS_TABLE . "
|
|
||||||
WHERE topic_id = $topic_moved_id";
|
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $row = $db->sql_fetchrow($result) )
|
default:
|
||||||
{
|
die("NO UPDATES REQUIRED");
|
||||||
$sql = "UPDATE " . TOPICS_TABLE . "
|
break;
|
||||||
SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . "
|
|
||||||
WHERE topic_id = $topic_id";
|
|
||||||
if ( !$db->sql_query($sql) )
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($sql);
|
|
||||||
|
|
||||||
$sql = "UPDATE " . CONFIG_TABLE . "
|
|
||||||
SET config_value = '.0.1'
|
|
||||||
WHERE config_name = 'version'";
|
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
|
||||||
{
|
|
||||||
die("Couldn't update version info");
|
|
||||||
}
|
|
||||||
|
|
||||||
die("UPDATING COMPLETE -> 2.0.1 Final installed");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
die("NO UPDATES REQUIRED");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue