|
From: Paul S. O. <ps...@us...> - 2002-05-14 15:19:24
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv14054
Modified Files:
Tag: phpBB-2_0_0
update_to_201.php viewforum.php viewtopic.php
Log Message:
More fixes ... hopefully corrects for moved topic/pagination issues ... needs testing (run update_to_201.php ... if you are already running 2.0.1 you'll need to modify the case statements in update_to_201 or necessary checks won't complete)
Index: update_to_201.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/Attic/update_to_201.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** update_to_201.php 10 Apr 2002 12:22:53 -0000 1.1.2.1
--- update_to_201.php 14 May 2002 15:19:20 -0000 1.1.2.2
***************
*** 21,50 ****
if ( $row = $db->sql_fetchrow($result) )
{
! if ( $row['config_value'] == 'RC-3' || $row['config_value'] == 'RC-4' || $row['config_value'] == '.0.0' )
{
! if ( $row['config_value'] == 'RC-3' )
! {
$sql = array();
! switch ( SQL_LAYER )
{
! case 'mysql':
! case 'mysql4':
! $sql[] = "ALTER TABLE " . USERS_TABLE . " DROP
! COLUMN user_autologin_key";
! break;
!
! case 'mssql-odbc':
! case 'mssql':
! case 'msaccess':
! $sql[] = "ALTER TABLE " . USERS_TABLE . " DROP
! COLUMN user_autologin_key";
! break;
!
! case 'postgresql':
! $sql[] = "ALTER TABLE " . USERS_TABLE . " ALTER
! COLUMN user_autologin_key DROP";
! default:
! die("No DB LAYER found!");
! break;
}
--- 21,56 ----
if ( $row = $db->sql_fetchrow($result) )
{
! switch ( $row['config_value'] )
{
! case 'RC-3':
! case 'RC-4':
! case '.0.0':
$sql = array();
!
! switch ( $row['config_value'] )
{
! case 'RC-3':
! switch ( SQL_LAYER )
! {
! case 'mysql':
! case 'mysql4':
! $sql[] = "ALTER TABLE " . USERS_TABLE . " DROP
! COLUMN user_autologin_key";
! break;
!
! case 'mssql-odbc':
! case 'mssql':
! case 'msaccess':
! $sql[] = "ALTER TABLE " . USERS_TABLE . " DROP
! COLUMN user_autologin_key";
! break;
!
! case 'postgresql':
! $sql[] = "ALTER TABLE " . USERS_TABLE . " ALTER
! COLUMN user_autologin_key DROP";
! default:
! die("No DB LAYER found!");
! break;
! }
}
***************
*** 66,82 ****
}
}
- }
! 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");
}
}
--- 72,136 ----
}
}
! unset($sql);
!
! switch ( $row['config_value'] )
! {
! case 'RC-3':
! case 'RC-4':
! case '.0.0':
! $sql = "SELECT topic_id, topic_moved_id
! FROM " . TOPICS_TABLE . "
! 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)) )
! {
! die("Couldn't update version info");
! }
! die("UPDATING COMPLETE -> 2.0.1 Final installed");
! break;
! default:
! die("NO UPDATES REQUIRED");
! break;
}
}
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.139.2.3
retrieving revision 1.139.2.4
diff -C2 -r1.139.2.3 -r1.139.2.4
*** viewforum.php 13 May 2002 13:18:18 -0000 1.139.2.3
--- viewforum.php 14 May 2002 15:19:20 -0000 1.139.2.4
***************
*** 103,107 ****
if ( !$userdata['session_logged_in'] )
{
! $redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : "" );
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=viewforum.$phpEx&$redirect", true));
--- 103,107 ----
if ( !$userdata['session_logged_in'] )
{
! $redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : '' );
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=viewforum.$phpEx&$redirect", true));
Index: viewtopic.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v
retrieving revision 1.186.2.5
retrieving revision 1.186.2.6
diff -C2 -r1.186.2.5 -r1.186.2.6
*** viewtopic.php 13 May 2002 13:18:18 -0000 1.186.2.5
--- viewtopic.php 14 May 2002 15:19:20 -0000 1.186.2.6
***************
*** 114,131 ****
}
! if ( !($row = $db->sql_fetchrow($result)) )
{
! if( $HTTP_GET_VARS['view'] == 'next' )
! {
! message_die(GENERAL_MESSAGE, 'No_newer_topics');
! }
! else
! {
! message_die(GENERAL_MESSAGE, 'No_older_topics');
! }
}
else
{
! $topic_id = $row['topic_id'];
}
}
--- 114,125 ----
}
! if ( $row = $db->sql_fetchrow($result) )
{
! $topic_id = $row['topic_id'];
}
else
{
! $message = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'No_newer_topics' : 'No_older_topics';
! message_die(GENERAL_MESSAGE, $message);
}
}
|