|
From: Paul S. O. <ps...@us...> - 2002-02-12 15:38:10
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv24263
Modified Files:
modcp.php
Log Message:
Fix 'return to mod CP' href problem
Index: modcp.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/modcp.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** modcp.php 8 Feb 2002 01:30:21 -0000 1.56
--- modcp.php 12 Feb 2002 15:14:51 -0000 1.57
***************
*** 192,196 ****
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
! if($confirm)
{
$topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ? $HTTP_POST_VARS['topic_id_list'] : array($topic_id);
--- 192,196 ----
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
! if ( $confirm )
{
$topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ? $HTTP_POST_VARS['topic_id_list'] : array($topic_id);
***************
*** 329,338 ****
{
$redirect_page = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $l_redirect = sprintf($lang['Click_return_forum'], "<a href=\"$redirect_page\">", "</a>");
}
else
{
! $redirect_page = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $l_redirect = sprintf($lang['Click_return_modcp'], "<a href=\"$redirect_page\">", "</a>");
}
--- 329,338 ----
{
$redirect_page = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $l_redirect = sprintf($lang['Click_return_forum'], '<a href="' . $redirect_page . '">', '</a>');
}
else
{
! $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $l_redirect = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
}
***************
*** 345,349 ****
else
{
! // Not confirmed, show confirmation message
if( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
--- 345,349 ----
else
{
! // Not confirmed, show confirmation message
if( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
***************
*** 416,420 ****
$sql_select = "SELECT *
FROM " . TOPICS_TABLE . "
! WHERE topic_id IN ($topic_list)";
if( !$result = $db->sql_query($sql_select, BEGIN_TRANSACTION) )
--- 416,421 ----
$sql_select = "SELECT *
FROM " . TOPICS_TABLE . "
! WHERE topic_id IN ($topic_list)
! AND topic_moved_id = 0";
if( !$result = $db->sql_query($sql_select, BEGIN_TRANSACTION) )
***************
*** 424,427 ****
--- 425,429 ----
$row = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
for($i = 0; $i < count($row); $i++)
***************
*** 472,484 ****
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message .= sprintf($lang['Click_return_topic'], "<a href=\"$redirect_page\">", "</a>");
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $message .= sprintf($lang['Click_return_modcp'], "<a href=\"$redirect_page\">", "</a>");
}
! $message = $message . "<br \><br \>" . sprintf($lang['Click_return_forum'], "<a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id") . "\">", "</a>");
$template->assign_vars(array(
--- 474,486 ----
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message .= sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $message .= sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
}
! $message = $message . "<br \><br \>" . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id") . '">', '</a>');
$template->assign_vars(array(
***************
*** 553,557 ****
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_status = " . TOPIC_LOCKED . "
! WHERE topic_id IN ($topic_id_sql)";
if( !$result = $db->sql_query($sql) )
{
--- 555,560 ----
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_status = " . TOPIC_LOCKED . "
! WHERE topic_id IN ($topic_id_sql)
! AND topic_moved_id = 0";
if( !$result = $db->sql_query($sql) )
{
***************
*** 562,571 ****
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message = sprintf($lang['Click_return_topic'], "<a href=\"$redirect_page\">", "</a>");
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $message = sprintf($lang['Click_return_modcp'], "<a href=\"$redirect_page\">", "</a>");
}
--- 565,574 ----
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message = sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $message = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
}
***************
*** 593,597 ****
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_status = " . TOPIC_UNLOCKED . "
! WHERE topic_id IN ($topic_id_sql)";
if( !$result = $db->sql_query($sql) )
{
--- 596,601 ----
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_status = " . TOPIC_UNLOCKED . "
! WHERE topic_id IN ($topic_id_sql)
! AND topic_moved_id = 0";
if( !$result = $db->sql_query($sql) )
{
***************
*** 602,611 ****
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message = sprintf($lang['Click_return_topic'], "<a href=\"$redirect_page\">", "</a>");
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $message = sprintf($lang['Click_return_modcp'], "<a href=\"$redirect_page\">", "</a>");
}
--- 606,615 ----
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message = sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $message = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
}
***************
*** 695,699 ****
);
! $message = $lang['Topic_split'] . "<br /><br />" . sprintf($lang['Click_return_topic'], "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
--- 699,703 ----
);
! $message = $lang['Topic_split'] . "<br /><br />" . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
***************
*** 969,986 ****
);
- $sql = "SELECT t.*, u.username, u.user_id, p.post_time
- FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p
- WHERE t.forum_id = $forum_id
- AND t.topic_poster = u.user_id
- AND p.post_id = t.topic_last_post_id
- ORDER BY t.topic_type DESC, p.post_time DESC
- LIMIT $start, " . $board_config['topics_per_page'];
-
- if(!$t_result = $db->sql_query($sql))
- {
- message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
- }
- $topic_rowset = $db->sql_fetchrowset($t_result);
-
//
// Set template files
--- 973,976 ----
***************
*** 997,1037 ****
obtain_word_list($orig_word, $replacement_word);
! for($i = 0; $i < count($topic_rowset); $i++)
{
$topic_title = "";
! if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
{
! $folder_image = "<img src=\"" . $images['folder_locked'] . "\" alt=\"Topic Locked\">";
}
else
{
! if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
{
! $folder_image = "<img src=\"" . $images['folder_announce'] . "\">";
}
! else if( $topic_rowset[$i]['topic_type'] == POST_STICKY )
{
! $folder_image = "<img src=\"" . $images['folder_sticky'] . "\">";
}
else
{
! $folder_image = "<img src=\"" . $images['folder'] . "\">";
}
}
! $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)
{
$topic_type = $lang['Topic_Announcement'] . " ";
}
! else if($topic_type == POST_STICKY)
{
$topic_type = $lang['Topic_Sticky'] . " ";
}
! else if($topic_status == TOPIC_MOVED)
{
$topic_type = $lang['Topic_Moved'] . " ";
--- 987,1046 ----
obtain_word_list($orig_word, $replacement_word);
! $sql = "SELECT t.*, u.username, u.user_id, p.post_time
! FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p
! WHERE t.forum_id = $forum_id
! AND t.topic_poster = u.user_id
! AND p.post_id = t.topic_last_post_id
! ORDER BY t.topic_type DESC, p.post_time DESC
! LIMIT $start, " . $board_config['topics_per_page'];
!
! if ( !($result = $db->sql_query($sql)) )
! {
! message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
! }
!
! while ( $row = $db->sql_fetchrow($result) )
{
$topic_title = "";
! if ( $row['topic_status'] == TOPIC_LOCKED )
{
! $folder_img = $images['folder_locked'];
! $folder_alt = $lang['Topic_locked'];
}
else
{
! if ( $row['topic_type'] == POST_ANNOUNCE )
{
! $folder_img = $images['folder_announce'];
! $folder_alt = $lang['Announcement'];
}
! else if ( $row['topic_type'] == POST_STICKY )
{
! $folder_img = $images['folder_sticky'];
! $folder_alt = $lang['Sticky'];
}
else
{
! $folder_img = $images['folder'];
! $folder_alt = $lang['No_new_posts'];
}
}
! $folder_image = '<img src="' . $folder_img . '" alt="' . $folder_alt . '" title="' . $folder_alt . '" />';
!
! $topic_id = $row['topic_id'];
! $topic_type = $row['topic_type'];
! $topic_status = $row['topic_status'];
! if ( $topic_type == POST_ANNOUNCE )
{
$topic_type = $lang['Topic_Announcement'] . " ";
}
! else if ( $topic_type == POST_STICKY )
{
$topic_type = $lang['Topic_Sticky'] . " ";
}
! else if ( $topic_status == TOPIC_MOVED )
{
$topic_type = $lang['Topic_Moved'] . " ";
***************
*** 1042,1052 ****
}
! if( $topic_rowset[$i]['topic_vote'] )
{
$topic_type .= $lang['Topic_Poll'] . " ";
}
! $topic_title = $topic_rowset[$i]['topic_title'];
! if( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
--- 1051,1061 ----
}
! if ( $row['topic_vote'] )
{
$topic_type .= $lang['Topic_Poll'] . " ";
}
! $topic_title = $row['topic_title'];
! if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
***************
*** 1054,1060 ****
$u_view_topic = append_sid("modcp.$phpEx?mode=split&" . POST_TOPIC_URL . "=$topic_id");
! $topic_replies = $topic_rowset[$i]['topic_replies'];
! $last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);
$template->assign_block_vars("topicrow", array(
--- 1063,1069 ----
$u_view_topic = append_sid("modcp.$phpEx?mode=split&" . POST_TOPIC_URL . "=$topic_id");
! $topic_replies = $row['topic_replies'];
! $last_post_time = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
$template->assign_block_vars("topicrow", array(
|