|
From: Paul S. O. <ps...@us...> - 2002-05-14 15:19:24
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv14054/includes
Modified Files:
Tag: phpBB-2_0_0
functions_admin.php functions_post.php usercp_sendpasswd.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: functions_admin.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_admin.php,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -r1.5 -r1.5.2.1
*** functions_admin.php 2 Apr 2002 14:53:40 -0000 1.5
--- functions_admin.php 14 May 2002 15:19:20 -0000 1.5.2.1
***************
*** 65,69 ****
$sql = "SELECT forum_id
FROM " . FORUMS_TABLE;
! if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get forum IDs', '', __LINE__, __FILE__, $sql);
--- 65,69 ----
$sql = "SELECT forum_id
FROM " . FORUMS_TABLE;
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get forum IDs', '', __LINE__, __FILE__, $sql);
***************
*** 79,83 ****
$sql = "SELECT topic_id
FROM " . TOPICS_TABLE;
! if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get topic ID', '', __LINE__, __FILE__, $sql);
--- 79,83 ----
$sql = "SELECT topic_id
FROM " . TOPICS_TABLE;
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get topic ID', '', __LINE__, __FILE__, $sql);
***************
*** 91,100 ****
case 'forum':
! $sql = "SELECT MAX(p.post_id) AS last_post, COUNT(p.post_id) AS total
! FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
! WHERE p.forum_id = $id
! AND t.topic_id = p.topic_id
! AND t.topic_status <> " . TOPIC_MOVED;
! if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
--- 91,98 ----
case 'forum':
! $sql = "SELECT MAX(post_id) AS last_post, COUNT(post_id) AS total
! FROM " . POSTS_TABLE . "
! WHERE forum_id = $id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
***************
*** 114,120 ****
$sql = "SELECT COUNT(topic_id) AS total
FROM " . TOPICS_TABLE . "
! WHERE forum_id = $id
! AND topic_status <> " . TOPIC_MOVED;
! if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get topic count', '', __LINE__, __FILE__, $sql);
--- 112,117 ----
$sql = "SELECT COUNT(topic_id) AS total
FROM " . TOPICS_TABLE . "
! WHERE forum_id = $id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get topic count', '', __LINE__, __FILE__, $sql);
***************
*** 136,140 ****
FROM " . POSTS_TABLE . "
WHERE topic_id = $id";
! if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
--- 133,137 ----
FROM " . POSTS_TABLE . "
WHERE topic_id = $id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
***************
*** 143,149 ****
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 = $id";
if ( !$db->sql_query($sql) )
{
--- 140,144 ----
if ( $row = $db->sql_fetchrow($result) )
{
! $sql = ( $row['total_posts'] ) ? "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 = $id" : "DELETE FROM " . TOPICS_TABLE . " WHERE topic_id = $id";
if ( !$db->sql_query($sql) )
{
***************
*** 151,155 ****
}
}
-
break;
}
--- 146,149 ----
Index: functions_post.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_post.php,v
retrieving revision 1.9.2.3
retrieving revision 1.9.2.4
diff -C2 -r1.9.2.3 -r1.9.2.4
*** functions_post.php 13 May 2002 01:30:59 -0000 1.9.2.3
--- functions_post.php 14 May 2002 15:19:20 -0000 1.9.2.4
***************
*** 250,254 ****
if ( $result = $db->sql_query($sql) )
{
! if( $row = $db->sql_fetchrow($result) )
{
if ( $row['last_post_time'] > 0 && ( $current_time - $row['last_post_time'] ) < $board_config['flood_interval'] )
--- 250,254 ----
if ( $result = $db->sql_query($sql) )
{
! if ( $row = $db->sql_fetchrow($result) )
{
if ( $row['last_post_time'] > 0 && ( $current_time - $row['last_post_time'] ) < $board_config['flood_interval'] )
***************
*** 273,277 ****
}
! if( $mode == 'newtopic' )
{
$topic_id = $db->sql_nextid();
--- 273,277 ----
}
! if ( $mode == 'newtopic' )
{
$topic_id = $db->sql_nextid();
***************
*** 286,290 ****
}
! if( $mode != 'editpost' )
{
$post_id = $db->sql_nextid();
--- 286,290 ----
}
! if ( $mode != 'editpost' )
{
$post_id = $db->sql_nextid();
***************
*** 327,331 ****
$old_poll_result[$row['vote_option_id']] = $row['vote_result'];
! if( !isset($poll_options[$row['vote_option_id']]) )
{
$delete_option_sql .= ( $delete_option_sql != '' ) ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];
--- 327,331 ----
$old_poll_result[$row['vote_option_id']] = $row['vote_result'];
! if ( !isset($poll_options[$row['vote_option_id']]) )
{
$delete_option_sql .= ( $delete_option_sql != '' ) ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];
***************
*** 343,347 ****
while ( list($option_id, $option_text) = each($poll_options) )
{
! if( !empty($option_text) )
{
$option_text = str_replace("\'", "''", $option_text);
--- 343,347 ----
while ( list($option_id, $option_text) = each($poll_options) )
{
! if ( !empty($option_text) )
{
$option_text = str_replace("\'", "''", $option_text);
***************
*** 357,361 ****
}
! if( $delete_option_sql != '' )
{
$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
--- 357,361 ----
}
! if ( $delete_option_sql != '' )
{
$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
***************
*** 470,474 ****
$sql = "UPDATE " . TOPICS_TABLE . " SET
$topic_update_sql
! WHERE topic_id = $topic_id";
if ( !($result = $db->sql_query($sql)) )
{
--- 470,475 ----
$sql = "UPDATE " . TOPICS_TABLE . " SET
$topic_update_sql
! WHERE topic_id = $topic_id
! OR topic_moved_id = $topic_id";
if ( !($result = $db->sql_query($sql)) )
{
***************
*** 501,505 ****
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
- $topic_update_sql = '';
if ( $mode != 'poll_delete' )
{
--- 502,505 ----
***************
*** 518,522 ****
}
- $topic_update_sql .= 'topic_replies = topic_replies - 1';
if ( $post_data['last_post'] )
{
--- 518,521 ----
***************
*** 544,548 ****
}
! if( $mode == 'poll_delete' || ( $mode == 'delete' && $post_data['first_post'] && $post_data['last_post'] ) && $post_data['has_poll'] && $post_data['edit_poll'] )
{
$sql = "DELETE FROM " . VOTE_DESC_TABLE . "
--- 543,547 ----
}
! if ( $mode == 'poll_delete' || ( $mode == 'delete' && $post_data['first_post'] && $post_data['last_post'] ) && $post_data['has_poll'] && $post_data['edit_poll'] )
{
$sql = "DELETE FROM " . VOTE_DESC_TABLE . "
***************
*** 568,596 ****
}
- //
- // Ok we set variables above that were intended to update the topics table
- // so let's go ahead and use it already :)
- //
- if( !empty($topic_update_sql) && !($post_data['first_post'] && $post_data['last_post']) )
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET ' . $topic_update_sql . "
- WHERE topic_id = $topic_id OR
- topic_moved_id = $topic_id";
- if ( !($db->sql_query($sql)) )
- {
- message_die(GENERAL_ERROR, 'Error in updating reply counts', '', __LINE__, __FILE__, $sql);
- }
- }
-
if ( $mode == 'delete' && $post_data['first_post'] && $post_data['last_post'] )
{
! $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id) . '">';
$message = $lang['Deleted'];
}
else
{
! $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id) . '">';
! $message = ( ( $mode == "poll_delete" ) ? $lang['Poll_delete'] : $lang['Deleted'] ) . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
}
--- 567,579 ----
}
if ( $mode == 'delete' && $post_data['first_post'] && $post_data['last_post'] )
{
! $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">';
$message = $lang['Deleted'];
}
else
{
! $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '">';
! $message = ( ( $mode == 'poll_delete' ) ? $lang['Poll_delete'] : $lang['Deleted'] ) . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
}
***************
*** 612,616 ****
if ( $mode == 'delete' )
{
! $delete_sql = ( !$post_data['first_post'] && !$post_data['last_post'] ) ? " AND user_id = " . $userdata['user_id'] : "";
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id" . $delete_sql;
if ( !($result = $db->sql_query($sql)) )
--- 595,599 ----
if ( $mode == 'delete' )
{
! $delete_sql = ( !$post_data['first_post'] && !$post_data['last_post'] ) ? " AND user_id = " . $userdata['user_id'] : '';
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id" . $delete_sql;
if ( !($result = $db->sql_query($sql)) )
***************
*** 664,668 ****
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
! $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
$update_watched_sql = '';
--- 647,651 ----
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
! $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
$update_watched_sql = '';
***************
*** 853,855 ****
}
! ?>
--- 836,838 ----
}
! ?>
\ No newline at end of file
Index: usercp_sendpasswd.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/usercp_sendpasswd.php,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -C2 -r1.6.2.1 -r1.6.2.2
*** usercp_sendpasswd.php 12 May 2002 17:57:34 -0000 1.6.2.1
--- usercp_sendpasswd.php 14 May 2002 15:19:20 -0000 1.6.2.2
***************
*** 126,130 ****
'L_EMAIL_ADDRESS' => $lang['Email_address'],
'L_SUBMIT' => $lang['Submit'],
! 'L_RESET' => $lang['Reset'])
);
--- 126,132 ----
'L_EMAIL_ADDRESS' => $lang['Email_address'],
'L_SUBMIT' => $lang['Submit'],
! 'L_RESET' => $lang['Reset'],
!
! 'S_PROFILE_ACTION' => append_sid("profile.$phpEx?mode=sendpassword"))
);
|