|
From: Paul S. O. <ps...@us...> - 2002-04-03 00:34:55
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv18029
Modified Files:
modcp.php viewforum.php
Log Message:
Various updates with any luck they fix a few minor issues without causing new ones ...
Index: modcp.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/modcp.php,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -r1.69 -r1.70
*** modcp.php 31 Mar 2002 00:06:33 -0000 1.69
--- modcp.php 2 Apr 2002 14:02:05 -0000 1.70
***************
*** 193,197 ****
// Do major work ...
//
! switch($mode)
{
case 'delete':
--- 193,197 ----
// Do major work ...
//
! switch( $mode )
{
case 'delete':
***************
*** 218,228 ****
message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql);
}
- $rowset = $db->sql_fetchrowset($result);
$post_id_sql = '';
! for($i = 0; $i < count($rowset); $i++)
{
! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $rowset[$i]['post_id'];
}
$sql = "SELECT vote_id
--- 218,228 ----
message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql);
}
$post_id_sql = '';
! while ( $row = $db->sql_fetchrow($result) )
{
! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $row['post_id'];
}
+ $db->sql_freeresult($result);
$sql = "SELECT vote_id
***************
*** 233,243 ****
message_die(GENERAL_ERROR, 'Could not get vote id information', '', __LINE__, __FILE__, $sql);
}
- $rowset = $db->sql_fetchrowset($result);
$vote_id_sql = '';
! for($i = 0; $i < count($rowset); $i++)
{
! $vote_id_sql .= ( ( $vote_id_sql != '' ) ? ', ' : '' ) . $rowset[$i]['vote_id'];
}
//
--- 233,243 ----
message_die(GENERAL_ERROR, 'Could not get vote id information', '', __LINE__, __FILE__, $sql);
}
$vote_id_sql = '';
! while ( $row = $db->sql_fetchrow($result) )
{
! $vote_id_sql .= ( ( $vote_id_sql != '' ) ? ', ' : '' ) . $row['vote_id'];
}
+ $db->sql_freeresult($result);
//
***************
*** 248,252 ****
WHERE topic_id IN ($topic_id_sql)
OR topic_moved_id IN ($topic_id_sql)";
! if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not delete topics', '', __LINE__, __FILE__, $sql);
--- 248,252 ----
WHERE topic_id IN ($topic_id_sql)
OR topic_moved_id IN ($topic_id_sql)";
! if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not delete topics', '', __LINE__, __FILE__, $sql);
***************
*** 258,262 ****
FROM " . POSTS_TABLE . "
WHERE post_id IN ($post_id_sql)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete posts', '', __LINE__, __FILE__, $sql);
--- 258,262 ----
FROM " . POSTS_TABLE . "
WHERE post_id IN ($post_id_sql)";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete posts', '', __LINE__, __FILE__, $sql);
***************
*** 266,285 ****
FROM " . POSTS_TEXT_TABLE . "
WHERE post_id IN ($post_id_sql)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql);
}
- $sql = "DELETE
- FROM " . SEARCH_MATCH_TABLE . "
- WHERE post_id IN ($post_id_sql)";
- if ( !($result = $db->sql_query($sql)) )
- {
- message_die(GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql);
- }
-
- //
- // Delete unmatched words
- //
remove_search_post($post_id_sql);
}
--- 266,274 ----
FROM " . POSTS_TEXT_TABLE . "
WHERE post_id IN ($post_id_sql)";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql);
}
remove_search_post($post_id_sql);
}
***************
*** 290,294 ****
FROM " . VOTE_DESC_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete vote descriptions', '', __LINE__, __FILE__, $sql);
--- 279,283 ----
FROM " . VOTE_DESC_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete vote descriptions', '', __LINE__, __FILE__, $sql);
***************
*** 298,302 ****
FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete vote results', '', __LINE__, __FILE__, $sql);
--- 287,291 ----
FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete vote results', '', __LINE__, __FILE__, $sql);
***************
*** 306,310 ****
FROM " . VOTE_USERS_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete vote users', '', __LINE__, __FILE__, $sql);
--- 295,299 ----
FROM " . VOTE_USERS_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete vote users', '', __LINE__, __FILE__, $sql);
***************
*** 315,319 ****
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id IN ($topic_id_sql)";
! if ( !($result = $db->sql_query($sql, END_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not delete watched post list', '', __LINE__, __FILE__, $sql);
--- 304,308 ----
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id IN ($topic_id_sql)";
! if ( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not delete watched post list', '', __LINE__, __FILE__, $sql);
***************
*** 409,413 ****
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($topic_list)
! AND topic_moved_id = 0";
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
--- 398,402 ----
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($topic_list)
! AND topic_status <> " . TOPIC_MOVED;
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
***************
*** 427,431 ****
$sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_first_post_id, topic_last_post_id, topic_moved_id)
VALUES ($old_forum_id, '" . addslashes(str_replace("\'", "''", $row[$i]['topic_title'])) . "', '" . str_replace("\'", "''", $row[$i]['topic_poster']) . "', " . $row[$i]['topic_time'] . ", " . TOPIC_MOVED . ", " . POST_NORMAL . ", " . $row[$i]['topic_vote'] . ", " . $row[$i]['topic_views'] . ", " . $row[$i]['topic_replies'] . ", " . $row[$i]['topic_first_post_id'] . ", " . $row[$i]['topic_last_post_id'] . ", $topic_id)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert shadow topic', '', __LINE__, __FILE__, $sql);
--- 416,420 ----
$sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_first_post_id, topic_last_post_id, topic_moved_id)
VALUES ($old_forum_id, '" . addslashes(str_replace("\'", "''", $row[$i]['topic_title'])) . "', '" . str_replace("\'", "''", $row[$i]['topic_poster']) . "', " . $row[$i]['topic_time'] . ", " . TOPIC_MOVED . ", " . POST_NORMAL . ", " . $row[$i]['topic_vote'] . ", " . $row[$i]['topic_views'] . ", " . $row[$i]['topic_replies'] . ", " . $row[$i]['topic_first_post_id'] . ", " . $row[$i]['topic_last_post_id'] . ", $topic_id)";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert shadow topic', '', __LINE__, __FILE__, $sql);
***************
*** 436,440 ****
SET forum_id = $new_forum_id
WHERE topic_id = $topic_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update old topic', '', __LINE__, __FILE__, $sql);
--- 425,429 ----
SET forum_id = $new_forum_id
WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update old topic', '', __LINE__, __FILE__, $sql);
***************
*** 444,448 ****
SET forum_id = $new_forum_id
WHERE topic_id = $topic_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update post topic ids', '', __LINE__, __FILE__, $sql);
--- 433,437 ----
SET forum_id = $new_forum_id
WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update post topic ids', '', __LINE__, __FILE__, $sql);
***************
*** 630,634 ****
$post_time = $post_rowset['post_time'];
! $post_subject = trim(strip_tags($HTTP_POST_VARS['subject']));
if ( empty($post_subject) )
{
--- 619,623 ----
$post_time = $post_rowset['post_time'];
! $post_subject = trim(htmlspecialchars($HTTP_POST_VARS['subject']));
if ( empty($post_subject) )
{
***************
*** 668,672 ****
}
! if( !($result = $db->sql_query($sql, END_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql);
--- 657,661 ----
}
! if( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql);
***************
*** 952,961 ****
$template->pparse('viewip');
- break;
-
- case 'auth':
- //
- // For future use ...
- //
break;
--- 941,944 ----
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.136
retrieving revision 1.137
diff -C2 -r1.136 -r1.137
*** viewforum.php 31 Mar 2002 00:06:33 -0000 1.136
--- viewforum.php 2 Apr 2002 14:02:05 -0000 1.137
***************
*** 256,260 ****
$row = $db->sql_fetchrow($result);
! $topics_count = $row['forum_topics'];
$limit_topics_time = "AND p.post_time >= $min_topic_time";
--- 256,260 ----
$row = $db->sql_fetchrow($result);
! $topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1;
$limit_topics_time = "AND p.post_time >= $min_topic_time";
***************
*** 266,270 ****
else
{
! $topics_count = $forum_row['forum_topics'];
$limit_topics_time = '';
--- 266,270 ----
else
{
! $topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1;
$limit_topics_time = '';
|