|
From: Bart v. B. <ba...@us...> - 2001-11-14 20:21:06
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv19390/phpBB2
Modified Files:
modcp.php
Log Message:
Added checkbox for shadowtopic on topic move, enabled deleting of shadow topics
Index: modcp.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/modcp.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** modcp.php 2001/11/13 17:36:27 1.44
--- modcp.php 2001/11/14 20:21:01 1.45
***************
*** 265,285 ****
}
! $sql = "DELETE
! 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);
! }
! $sql = "DELETE
! 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);
}
! if( $vote_id_sql != "" )
{
$sql = "DELETE
--- 265,288 ----
}
! if( $post_id_sql != '' )
{
! $sql = "DELETE
! 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);
! }
! $sql = "DELETE
! 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);
! }
}
! if( $vote_id_sql != '' )
{
$sql = "DELETE
***************
*** 412,421 ****
{
$topic_id = $row[$i]['topic_id'];
!
! $sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_last_post_id, topic_moved_id)
! VALUES ($old_forum_id, '" . addslashes($row[$i]['topic_title']) . "', '" . $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_last_post_id'] . ", $topic_id)";
! if( !$result = $db->sql_query($sql) )
{
! message_die(GENERAL_ERROR, "Could not insert new topic", "Error", __LINE__, __FILE__, $sql);
}
--- 415,428 ----
{
$topic_id = $row[$i]['topic_id'];
!
! if( isset($HTTP_POST_VARS['move_leave_shadow']) )
{
! // Insert topic in the old forum that indicates that the forum has moved.
! $sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_last_post_id, topic_moved_id)
! VALUES ($old_forum_id, '" . addslashes($row[$i]['topic_title']) . "', '" . $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_last_post_id'] . ", $topic_id)";
! if( !$result = $db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, "Could not insert shadow topic", "Error", __LINE__, __FILE__, $sql);
! }
}
***************
*** 451,455 ****
--- 458,466 ----
$message = sprintf($lang['Click_return_modcp'], "<a href=\"$redirect_page\">", "</a>");
}
+ $return_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id");
+ $returnforum = sprintf($lang['Click_return_forum'], "<a href=\"$return_forum_url\">", "</a>");
+ $message = $message . "<br \><br \>$returnforum";
+
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
***************
*** 493,496 ****
--- 504,508 ----
"L_MOVE_TO_FORUM" => $lang['Move_to_forum'],
+ "L_LEAVESHADOW" => $lang['Leave_shadow_topic'],
"L_YES" => $lang['Yes'],
"L_NO" => $lang['No'],
***************
*** 1011,1015 ****
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_last_post_id
- AND t.topic_status <> " . TOPIC_MOVED . "
ORDER BY t.topic_type DESC, p.post_time DESC
LIMIT $start, " . $board_config['topics_per_page'];
--- 1023,1026 ----
***************
*** 1061,1064 ****
--- 1072,1076 ----
$topic_id = $topic_rowset[$i]['topic_id'];
$topic_type = $topic_rowset[$i]['topic_type'];
+ $topic_status = $topic_rowset[$i]['topic_status'];
if($topic_type == POST_ANNOUNCE)
***************
*** 1070,1073 ****
--- 1082,1089 ----
$topic_type = $lang['Topic_Sticky'] . " ";
}
+ else if($topic_status == TOPIC_MOVED)
+ {
+ $topic_type = $lang['Topic_Moved'] . " ";
+ }
else
{
***************
*** 1118,1120 ****
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
\ No newline at end of file
--- 1134,1136 ----
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
|