A few updates, mainly template related

git-svn-id: file:///svn/phpbb/trunk@686 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-07-17 22:40:45 +00:00
parent f2e90f674f
commit 9bfae76bef
4 changed files with 190 additions and 130 deletions

View file

@ -487,7 +487,8 @@ $lang['Not_Authorised'] = "Not Authorised";
// //
// Moderator Control Panel // Moderator Control Panel
// //
$lang['ModCp_Explain'] = "Using the form below you can preform mass operations on this forum. You can lock, unlock, move, or delete any number of topics"; $lang['Mod_CP'] = "Moderator Control Panel";
$lang['Mod_CP_explain'] = "Using the form below you can perform mass moderation operations on this forum. You can lock, unlock, move or delete any number of topics";
$lang['Select'] = "Select"; $lang['Select'] = "Select";
$lang['Delete'] = "Delete"; $lang['Delete'] = "Delete";
$lang['Move'] = "Move"; $lang['Move'] = "Move";
@ -497,12 +498,16 @@ $lang['Topics_Removed'] = "The selected topics have been successfully removed fr
$lang['Topics_Locked'] = "The selected topics have been locked"; $lang['Topics_Locked'] = "The selected topics have been locked";
$lang['Topics_Unlocked'] = "The selected topics have been unlocked"; $lang['Topics_Unlocked'] = "The selected topics have been unlocked";
$lang['Return_to_modcp'] = "to return to the moderator control panel"; $lang['Return_to_modcp'] = "to return to the moderator control panel";
$lang['Confirm_delete_topic'] = "Are you sure you want to remove the selected topic(s)?"; $lang['Confirm_delete_topic'] = "Are you sure you want to remove the selected topic/s?";
$lang['Confirm_lock_topic'] = "Are you sure you want to lock the selected topic(s)?"; $lang['Confirm_lock_topic'] = "Are you sure you want to lock the selected topic/s?";
$lang['Confirm_unlock_topic'] = "Are you sure you want to unlock the selected topic(s)?"; $lang['Confirm_unlock_topic'] = "Are you sure you want to unlock the selected topic/s?";
$lang['Confirm_move_topic'] = "Are you sure you want to move the selected topic(s)?"; $lang['Confirm_move_topic'] = "Are you sure you want to move the selected topic/s?";
$lang['Split_posts'] = "Split Posts"; $lang['Split_Topic'] = "Split Topic Control Panel";
$lang['Split_after'] = "Split Posts Beyond Selected"; $lang['Split_Topic_explain'] = "Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post";
$lang['Split_title'] = "New topic title";
$lang['Split_forum'] = "Forum for new topic";
$lang['Split_posts'] = "Split selected posts";
$lang['Split_after'] = "Split from selected post";
$lang['Topic_split'] = "The selected topic has been split successfully"; $lang['Topic_split'] = "The selected topic has been split successfully";
$lang['Too_many_error'] = "You have selected too many posts. You can only select one post to split a topic after!"; $lang['Too_many_error'] = "You have selected too many posts. You can only select one post to split a topic after!";

View file

@ -44,27 +44,34 @@ $topic_id = ($HTTP_POST_VARS[POST_TOPIC_URL]) ? $HTTP_POST_VARS[POST_TOPIC_URL]
if(empty($forum_id) || !isset($forum_id)) if(empty($forum_id) || !isset($forum_id))
{ {
$sql = "SELECT f.forum_id, f.forum_topics FROM ".TOPICS_TABLE." t, ".FORUMS_TABLE." f WHERE t.topic_id = ".$topic_id." AND f.forum_id = t.forum_id"; $sql = "SELECT f.forum_id, f.forum_name, f.forum_topics
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.topic_id = " . $topic_id . "
AND f.forum_id = t.forum_id";
if(!$result = $db->sql_query($sql)) if(!$result = $db->sql_query($sql))
{ {
message_die(GENERAL_MESSAGE, $lang['Topic_post_not_exist'], "", __LINE__, __FILE__, $sql); message_die(GENERAL_MESSAGE, $lang['Topic_post_not_exist'], "", __LINE__, __FILE__, $sql);
} }
$topic_row = $db->sql_fetchrowset($result); $topic_row = $db->sql_fetchrowset($result);
$forum_topics = $topic_row[0]['forum_topics']; $forum_topics = $topic_row[0]['forum_topics'];
$forum_id = $topic_row[0]['forum_id']; $forum_id = $topic_row[0]['forum_id'];
$forum_name = $topic_row[0]['forum_name'];
} }
else else
{ {
$sql = "SELECT forum_topics FROM ".FORUMS_TABLE." WHERE forum_id = ".$forum_id; $sql = "SELECT forum_name, forum_topics
FROM " . FORUMS_TABLE . "
WHERE forum_id = " . $forum_id;
if(!$result = $db->sql_query($sql)) if(!$result = $db->sql_query($sql))
{ {
message_die(GENERAL_MESSAGE, $lang['Topic_post_not_exist'], "", __LINE__, __FILE__, $sql); message_die(GENERAL_MESSAGE, $lang['Topic_post_not_exist'], "", __LINE__, __FILE__, $sql);
} }
$topic_row = $db->sql_fetchrowset($result); $topic_row = $db->sql_fetchrowset($result);
$forum_topics = $topic_row[0]['forum_topics'];
}
$is_mod = 0; $forum_topics = $topic_row[0]['forum_topics'];
$forum_name = $topic_row[0]['forum_name'];
}
// //
// Start session management // Start session management
@ -80,13 +87,13 @@ init_userprefs($userdata);
// Start auth check // Start auth check
// //
$is_auth = auth(AUTH_ALL, $forum_id, $userdata); $is_auth = auth(AUTH_ALL, $forum_id, $userdata);
$is_mod = ( $is_auth['auth_mod'] ) ? TRUE : FALSE;
// //
// End Auth Check // End Auth Check
// //
if(!$is_mod) $is_mod = ( $is_auth['auth_mod'] ) ? TRUE : FALSE;
if( !$is_mod )
{ {
message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']); message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']);
} }
@ -96,7 +103,7 @@ if(!$is_mod)
// Check if user did or did not confirm // Check if user did or did not confirm
// If they did not, forward them to the last page they were on // If they did not, forward them to the last page they were on
// //
$confirm = ($HTTP_POST_VARS['confirm']) ? 1 : 0; $confirm = ($HTTP_POST_VARS['confirm']) ? TRUE : FALSE;
if($HTTP_POST_VARS['not_confirm']) if($HTTP_POST_VARS['not_confirm'])
{ {
header("Location: index.$phpEx"); header("Location: index.$phpEx");
@ -105,16 +112,25 @@ if($HTTP_POST_VARS['not_confirm'])
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
// Set template files // Set template files
$template->set_filenames(array("body" => "modcp_body.tpl", "confirm" => "confirm_body.tpl", "split_body" => "split_body.tpl")); $template->set_filenames(array(
"body" => "modcp_body.tpl",
"confirm" => "confirm_body.tpl",
"split_body" => "split_body.tpl")
);
$template->assign_vars(array(
"FORUM_NAME" => $forum_name,
"U_VIEW_FORUM" => "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id")
);
$mode = ($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; $mode = ($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
$quick_op = ($HTTP_GET_VARS['quick_op']) ? $HTTP_GET_VARS['quick_op'] : $HTTP_POST_VARS['quick_op']; $quick_op = ($HTTP_POST_VARS['quick_op']) ? $HTTP_POST_VARS['quick_op'] : $HTTP_GET_VARS['quick_op'];
$delete = ($HTTP_POST_VARS['delete']) ? 1 : 0;
$move = ($HTTP_POST_VARS['move']) ? 1 : 0;
$lock = ($HTTP_POST_VARS['lock']) ? 1 : 0;
$unlock = ($HTTP_POST_VARS['unlock']) ? 1 : 0;
$delete = ($HTTP_POST_VARS['delete']) ? TRUE : FALSE;
$move = ($HTTP_POST_VARS['move']) ? TRUE : FALSE;
$lock = ($HTTP_POST_VARS['lock']) ? TRUE : FALSE;
$unlock = ($HTTP_POST_VARS['unlock']) ? TRUE : FALSE;
if(!$mode) if(!$mode)
{ {
@ -333,7 +349,7 @@ switch($mode)
} }
$template->assign_vars(array("MESSAGE_TITLE" => $lang['Confirm'], $template->assign_vars(array("MESSAGE_TITLE" => $lang['Confirm'],
"MESSAGE_TEXT" => $lang['Confirm_lock_topic'], "MESSAGE_TEXT" => $lang['Confirm_lock_topic'],
"L_YES" => $lang['Yes'], "L_YES" => $lang['Yes'],
"L_NO" => $lang['No'], "L_NO" => $lang['No'],
"S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"), "S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"),
@ -343,6 +359,7 @@ switch($mode)
} }
break; break;
case 'unlock': case 'unlock':
if($confirm) if($confirm)
{ {
@ -367,7 +384,7 @@ switch($mode)
if(!$result = $db->sql_query($sql)) if(!$result = $db->sql_query($sql))
{ {
message_die(GENERAL_ERROR, "Coule not update topics table!", "Error", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Could not update topics table!", "Error", __LINE__, __FILE__, $sql);
} }
else else
{ {
@ -383,15 +400,18 @@ switch($mode)
} }
$msg = $lang['Topics_Unlocked'] . "<br />" . "<a href=\"".append_sid($next_page)."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $return_message; $msg = $lang['Topics_Unlocked'] . "<br />" . "<a href=\"".append_sid($next_page)."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $return_message;
message_die(GENERAL_MESSAGE, $msg); message_die(GENERAL_MESSAGE, $msg);
} }
} }
else else
{ {
$hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'"><input type="hidden" name="'.POST_FORUM_URL.'" value="'.$forum_id.'"><input type="hidden" name="quick_op" value="'.$quick_op.'">'; $hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '"><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '"><input type="hidden" name="quick_op" value="' . $quick_op . '">';
if($HTTP_POST_VARS['preform_op']) if($HTTP_POST_VARS['preform_op'])
{ {
$topics = $HTTP_POST_VARS['preform_op']; $topics = $HTTP_POST_VARS['preform_op'];
for($x = 0; $x < count($topics); $x++) for($x = 0; $x < count($topics); $x++)
{ {
$hidden_fields .= '<input type="hidden" name="preform_op[]" value="'.$topics[$x].'">'; $hidden_fields .= '<input type="hidden" name="preform_op[]" value="'.$topics[$x].'">';
@ -402,27 +422,34 @@ switch($mode)
$hidden_fields .= '<input type="hidden" name="'.POST_TOPIC_URL.'" value="'.$topic_id.'">'; $hidden_fields .= '<input type="hidden" name="'.POST_TOPIC_URL.'" value="'.$topic_id.'">';
} }
$template->assign_vars(array("MESSAGE_TITLE" => $lang['Confirm'], $template->assign_vars(array(
"MESSAGE_TEXT" => $lang['Confirm_unlock_topic'], "MESSAGE_TITLE" => $lang['Confirm'],
"L_YES" => $lang['Yes'], "MESSAGE_TEXT" => $lang['Confirm_unlock_topic'],
"L_NO" => $lang['No'],
"S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"), "L_YES" => $lang['Yes'],
"S_HIDDEN_FIELDS" => $hidden_fields)); "L_NO" => $lang['No'],
"S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"),
"S_HIDDEN_FIELDS" => $hidden_fields)
);
$template->pparse("confirm"); $template->pparse("confirm");
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
} }
break; break;
case 'split': case 'split':
if($HTTP_POST_VARS['split']) if($HTTP_POST_VARS['split_type_all'] || $HTTP_POST_VARS['split_type_beyond'])
{ {
$posts = $HTTP_POST_VARS['preform_op']; $posts = $HTTP_POST_VARS['preform_op'];
$sql = "SELECT poster_id, topic_id, post_time FROM ".POSTS_TABLE." WHERE post_id = ".$posts[0]; $sql = "SELECT poster_id, topic_id, post_time
if(!$result = $db->sql_query($sql, BEGIN_TRANSACTION)) FROM " . POSTS_TABLE . "
WHERE post_id = ".$posts[0];
if(!$result = $db->sql_query($sql))
{ {
message_die(GENERAL_ERROR, "Could not get post information", "Error", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Could not get post information", "", __LINE__, __FILE__, $sql);
} }
$post_rowset = $db->sql_fetchrowset($result); $post_rowset = $db->sql_fetchrowset($result);
@ -433,50 +460,60 @@ switch($mode)
$subject = trim(strip_tags(htmlspecialchars(addslashes($HTTP_POST_VARS['subject'])))); $subject = trim(strip_tags(htmlspecialchars(addslashes($HTTP_POST_VARS['subject']))));
if(empty($subject)) if(empty($subject))
{ {
message_die(GENERAL_ERROR, $lang['Empty_subject'], $lang['Error'], __LINE__, __FILE__); message_die(GENERAL_MESSAGE, $lang['Empty_subject']);
} }
$new_forum_id = $HTTP_POST_VARS['new_forum_id']; $new_forum_id = $HTTP_POST_VARS['new_forum_id'];
$topic_time = get_gmt_ts(); $topic_time = get_gmt_ts();
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_notify, topic_status, topic_type) $sql = "INSERT INTO " . TOPICS_TABLE . "
VALUES ('$subject', $first_poster, " . $topic_time . ", $new_forum_id, 0, " . TOPIC_UNLOCKED . ", ".POST_NORMAL.")"; (topic_title, topic_poster, topic_time, forum_id, topic_notify, topic_status, topic_type)
VALUES ('$subject', $first_poster, " . $topic_time . ", $new_forum_id, 0, " . TOPIC_UNLOCKED . ", " . POST_NORMAL . ")";
if(!$result = $db->sql_query($sql, BEGIN_TRANSACTION)) if(!$result = $db->sql_query($sql, BEGIN_TRANSACTION))
{ {
message_die(GENERAL_ERROR, "Could not insert new topic", "Error", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Could not insert new topic", "", __LINE__, __FILE__, $sql);
} }
$new_topic_id = $db->sql_nextid(); $new_topic_id = $db->sql_nextid();
if($HTTP_POST_VARS['split_type'] == "split")
if($HTTP_POST_VARS['split_type_all'])
{ {
$sql = "UPDATE ".POSTS_TABLE." SET topic_id = $new_topic_id WHERE "; $sql = "UPDATE " . POSTS_TABLE . "
SET topic_id = $new_topic_id
WHERE ";
for($x = 0; $x < count($posts); $x++) for($x = 0; $x < count($posts); $x++)
{ {
if($x > 0) if($x > 0)
{ {
$sql .= " OR "; $sql .= " OR ";
} }
$sql .= "post_id = ".$posts[$x]; $sql .= "post_id = " . $posts[$x];
$last_post_id = $posts[$x]; $last_post_id = $posts[$x];
} }
} }
else if($HTTP_POST_VARS['split_type'] == "split_after") else if($HTTP_POST_VARS['split_type_beyond'])
{ {
$sql = "UPDATE ".POSTS_TABLE." SET topic_id = $new_topic_id WHERE post_time >= $post_time AND topic_id = $topic_id"; $sql = "UPDATE " . POSTS_TABLE . "
SET topic_id = $new_topic_id
WHERE post_time >= $post_time
AND topic_id = $topic_id";
} }
if(!$result = $db->sql_query($sql, END_TRANSACTION)) if(!$result = $db->sql_query($sql, END_TRANSACTION))
{ {
message_die(GENERAL_ERROR, "Could not update posts table!", $lang['Error'], __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Could not update posts table!", "", __LINE__, __FILE__, $sql);
} }
else else
{ {
sync("topic", $new_topic_id); sync("topic", $new_topic_id);
sync("topic", $topic_id); sync("topic", $topic_id);
sync("forum", $forum_id); sync("forum", $forum_id);
$next_page = "viewtopic.$phpEx?".POST_TOPIC_URL."=$new_topic_id";
$next_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$new_topic_id";
$return_message = $lang['to_return_topic']; $return_message = $lang['to_return_topic'];
message_die(GENERAL_MESSAGE, $lang['Topic_split'] . "<br />" . "<a href=\"".append_sid($next_page)."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $return_message);
message_die(GENERAL_MESSAGE, $lang['Topic_split'] . "<br /><a href=\"" . append_sid($next_page)."\">" . $lang['Click'] . " " . $lang['Here'] ."</a> " . $return_message);
} }
} }
else else
@ -484,39 +521,48 @@ switch($mode)
$topic_id = ($HTTP_POST_VARS[POST_TOPIC_URL]) ? $HTTP_POST_VARS[POST_TOPIC_URL] : $HTTP_GET_VARS[POST_TOPIC_URL]; $topic_id = ($HTTP_POST_VARS[POST_TOPIC_URL]) ? $HTTP_POST_VARS[POST_TOPIC_URL] : $HTTP_GET_VARS[POST_TOPIC_URL];
$sql = "SELECT u.username, p.post_time, p.post_id, p.bbcode_uid, pt.post_text, pt.post_subject, p.post_username $sql = "SELECT u.username, p.post_time, p.post_id, p.bbcode_uid, pt.post_text, pt.post_subject, p.post_username
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id AND p.poster_id = u.user_id
AND p.post_id = pt.post_id AND p.post_id = pt.post_id
ORDER BY p.post_time ASC"; ORDER BY p.post_time ASC";
if(!$result = $db->sql_query($sql)) if(!$result = $db->sql_query($sql))
{ {
message_die(GENERAL_ERROR, "Could not get topic/post information", "Error", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Could not get topic/post information", "", __LINE__, __FILE__, $sql);
} }
if(($total_posts = $db->sql_numrows($result)) > 0) $s_hidden_fields = "<input type=\"hidden\" name=\"" . POST_FORUM_URL . "\" value=\"$forum_id\"><input type=\"hidden\" name=\"mode\" value=\"split\">";
if( ( $total_posts = $db->sql_numrows($result) ) > 0 )
{ {
$postrow = $db->sql_fetchrowset($result); $postrow = $db->sql_fetchrowset($result);
$template->assign_vars(array("L_AUTHOR" => $lang['Author'], $template->assign_vars(array(
"L_MESSAGE" => $lang['Message'], "L_SPLIT_TOPIC" => $lang['Split_Topic'],
"L_SELECT" => $lang['Select'], "L_SPLIT_TOPIC_EXPLAIN" => $lang['Split_Topic_explain'],
"L_SUBJECT" => $lang['Subject'], "L_AUTHOR" => $lang['Author'],
"L_POSTED" => $lang['Posted'], "L_MESSAGE" => $lang['Message'],
"L_SPLIT_POSTS" => $lang['Split_posts'], "L_SELECT" => $lang['Select'],
"L_SUBMIT" => $lang['Submit'], "L_SPLIT_SUBJECT" => $lang['Split_title'],
"L_SPLIT_AFTER" => $lang['Split_after'], "L_SPLIT_FORUM" => $lang['Split_forum'],
"S_MODCP_URL" => append_sid("modcp.$phpEx"), "L_POSTED" => $lang['Posted'],
"POST_FORUM_URL" => POST_FORUM_URL, "L_SPLIT_POSTS" => $lang['Split_posts'],
"FORUM_ID" => $forum_id, "L_SUBMIT" => $lang['Submit'],
"FORUM_INPUT" => make_forum_box("new_forum_id", $forum_id))); "L_SPLIT_AFTER" => $lang['Split_after'],
"S_SPLIT_ACTION" => append_sid("modcp.$phpEx"),
"S_HIDDEN_FIELDS" => $s_hidden_fields,
"FORUM_INPUT" => make_forum_box("new_forum_id", $forum_id))
);
for($i = 0; $i < $total_posts; $i++) for($i = 0; $i < $total_posts; $i++)
{ {
$post_id = $postrow[$i]['post_id'];
$poster_id = $postrow[$i]['user_id']; $poster_id = $postrow[$i]['user_id'];
$poster = stripslashes($postrow[$i]['username']); $poster = stripslashes($postrow[$i]['username']);
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['default_timezone']); $post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['default_timezone']);
$post_id = $postrow[$i]['post_id'];
if($poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '') if($poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '')
{ {
@ -547,47 +593,63 @@ switch($mode)
$message = make_clickable($message); $message = make_clickable($message);
$message = str_replace("\n", "<br />", $message); $message = str_replace("\n", "<br />", $message);
$message = eregi_replace("\[addsig]$", "<br /><br />_________________<br />" . nl2br($user_sig), $message); $message = eregi_replace("\[addsig]$", "", $message);
//$message = (strlen($message) > 100) ? substr($message, 0, 100) . " ..." : $message; //$message = (strlen($message) > 100) ? substr($message, 0, 100) . " ..." : $message;
if(!($i % 2))
{
$color = "#" . $theme['td_color1'];
}
else
{
$color = "#" . $theme['td_color2'];
}
$template->assign_block_vars("postrow", array( $template->assign_block_vars("postrow", array(
"POSTER_NAME" => $poster, "POSTER_NAME" => $poster,
"POST_DATE" => $post_date, "POST_DATE" => $post_date,
"POST_SUBJECT" => $post_subject, "POST_SUBJECT" => $post_subject,
"MESSAGE" => $message, "MESSAGE" => $message,
"POST_ID" => $post_id)); "POST_ID" => $post_id,
"ROW_COLOR" => $color)
);
} }
$template->pparse("split_body"); $template->pparse("split_body");
} }
} }
break;
break;
default: default:
$template->assign_vars(array("L_MOD_EXPLAIN" => $lang['ModCp_Explain'], $template->assign_vars(array(
"L_SELECT" => $lang['Select'], "L_MOD_CP" => $lang['Mod_CP'],
"L_DELETE" => $lang['Delete'], "L_MOD_CP_EXPLAIN" => $lang['Mod_CP_explain'],
"L_MOVE" => $lang['Move'], "L_SELECT" => $lang['Select'],
"L_LOCK" => $lang['Lock'], "L_DELETE" => $lang['Delete'],
"L_UNLOCK" => $lang['Unlock'], "L_MOVE" => $lang['Move'],
"S_MODCP_URL" => append_sid("modcp.$phpEx") )); "L_LOCK" => $lang['Lock'],
"L_UNLOCK" => $lang['Unlock'],
"S_HIDDEN_FIELDS" => "<input type=\"hidden\" name=\"" . POST_FORUM_URL . "\" value=\"$forum_id\">",
"S_MODCP_ACTION" => append_sid("modcp.$phpEx"))
);
if(!$start) if(!$start)
{ {
$start = 0; $start = 0;
} }
$sql = "SELECT t.topic_title, t.topic_id, t.topic_replies, t.topic_status, t.topic_type, u.username, u.user_id, p.post_time $sql = "SELECT t.topic_title, t.topic_id, t.topic_replies, t.topic_status, t.topic_type, u.username, u.user_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p
WHERE t.forum_id = $forum_id WHERE t.forum_id = $forum_id
AND t.topic_poster = u.user_id AND t.topic_poster = u.user_id
AND p.post_id = t.topic_last_post_id AND p.post_id = t.topic_last_post_id
AND t.topic_type <> " . POST_GLOBAL_ANNOUNCE . " AND t.topic_type <> " . POST_GLOBAL_ANNOUNCE . "
ORDER BY t.topic_type DESC, p.post_time DESC ORDER BY t.topic_type DESC, p.post_time DESC
LIMIT $start, ".$board_config['topics_per_page']; LIMIT $start, " . $board_config['topics_per_page'];
if(!$t_result = $db->sql_query($sql)) if(!$t_result = $db->sql_query($sql))
{ {
@ -623,21 +685,25 @@ switch($mode)
$topic_title .= stripslashes($topics[$x]['topic_title']); $topic_title .= stripslashes($topics[$x]['topic_title']);
$u_view_topic = append_sid("viewtopic.$phpEx?".POST_TOPIC_URL."=$topic_id"); $u_view_topic = append_sid("viewtopic.$phpEx?".POST_TOPIC_URL."=$topic_id");
$topic_replies = $topics[$x]['topic_replies']; $topic_replies = $topics[$x]['topic_replies'];
$last_post_time = create_date($board_config['default_dateformat'], $topics[$x]['post_time'], $board_config['default_timezone']); $last_post_time = create_date($board_config['default_dateformat'], $topics[$x]['post_time'], $board_config['default_timezone']);
$template->assign_block_vars("topicrow", array( $template->assign_block_vars("topicrow", array(
"U_VIEW_TOPIC" => $u_view_topic, "U_VIEW_TOPIC" => $u_view_topic,
"FOLDER_IMG" => $folder_image,
"TOPIC_TITLE" => $topic_title, "FOLDER_IMG" => $folder_image,
"REPLIES" => $topic_replies, "TOPIC_TITLE" => $topic_title,
"LAST_POST" => $last_post_time, "REPLIES" => $topic_replies,
"TOPIC_ID" => $topic_id)); "LAST_POST" => $last_post_time,
"TOPIC_ID" => $topic_id)
);
} }
$pagination = generate_pagination("modcp.$phpEx?".POST_FORUM_URL."=$forum_id", $forum_topics, $board_config['topics_per_page'], $start); $pagination = generate_pagination("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id", $forum_topics, $board_config['topics_per_page'], $start);
$template->assign_vars(array("PAGINATION" => $pagination, $template->assign_vars(array(
"PAGINATION" => $pagination,
"FORUM_ID" => $forum_id, "FORUM_ID" => $forum_id,
"POST_FORUM_URL" => POST_FORUM_URL, "POST_FORUM_URL" => POST_FORUM_URL,
"ON_PAGE" => (floor($start/$board_config['topics_per_page'])+1), "ON_PAGE" => (floor($start/$board_config['topics_per_page'])+1),

View file

@ -1,21 +1,21 @@
<div align="center"><table width="98%" cellspacing="0" cellpadding="4" border="0"> <div align="center"><table width="98%" cellspacing="0" cellpadding="4" border="0">
<tr><form method="post" action="{S_POST_DAYS_ACTION}"> <tr><form method="post" action="{S_POST_DAYS_ACTION}">
<td align="left" valign="bottom" nowrap><span class="gensmall"><a href="{U_INDEX}">{SITENAME}&nbsp;{L_INDEX}</a> -> {FORUM_NAME}</span></td> <td align="left" valign="bottom" nowrap><span class="gensmall"><a href="{U_INDEX}">{SITENAME}&nbsp;{L_INDEX}</a> -> <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
</form></tr> </form></tr>
</table></div> </table></div>
<div align="center"><table border="0" cellpadding="1" cellspacing="0" width="98%"> <div align="center"><table border="0" cellpadding="1" cellspacing="0" width="98%">
<tr><form method="post" action="{S_MODCP_URL}"> <tr><form method="post" action="{S_MODCP_ACTION}">
<td class="tablebg"><table border="0" cellpadding="4" cellspacing="1" width="100%"> <td class="tablebg"><table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr> <tr>
<td class="cat" colspan="5" align="center"><span class="cattitle">Moderator Contol Panel</span></td> <td class="cat" colspan="5" align="center"><span class="cattitle">{L_MOD_CP}</span><br><span class="gensmall">{L_MOD_CP_EXPLAIN}</span></td>
</tr> </tr>
<tr> <tr>
<th>&nbsp;</th> <th width="4%">&nbsp;</th>
<th>&nbsp;{L_TOPICS}&nbsp;</th> <th>&nbsp;{L_TOPICS}&nbsp;</th>
<th width="8%">&nbsp;{L_REPLIES}&nbsp;</th> <th width="8%">&nbsp;{L_REPLIES}&nbsp;</th>
<th width="17%">&nbsp;{L_LASTPOST}&nbsp;</th> <th width="17%">&nbsp;{L_LASTPOST}&nbsp;</th>
<th width="8%">&nbsp;{L_SELECT}&nbsp;</th> <th width="5%">&nbsp;{L_SELECT}&nbsp;</th>
</tr> </tr>
<!-- BEGIN topicrow --> <!-- BEGIN topicrow -->
<tr> <tr>
@ -26,14 +26,12 @@
<td class="row1" align="center" valign="middle"><input type="checkbox" name="preform_op[]" value="{topicrow.TOPIC_ID}"></td> <td class="row1" align="center" valign="middle"><input type="checkbox" name="preform_op[]" value="{topicrow.TOPIC_ID}"></td>
</tr> </tr>
<!-- END topicrow --> <!-- END topicrow -->
<tr>
<th colspan="5" align="right">&nbsp;&nbsp;<input type="hidden" name="{POST_FORUM_URL}" value="{FORUM_ID}">&nbsp;<input type="submit" name="delete" value="{L_DELETE}">&nbsp;<input type="submit" name="move" value="{L_MOVE}">&nbsp;<input type="submit" name="lock" value="{L_LOCK}">&nbsp;<input type="submit" name="unlock" value="{L_UNLOCK}">&nbsp;</th>
</tr>
<tr> <tr>
<td class="cat" colspan="5"><table width="100%" cellspacing="0" cellpadding="0" border="0"> <td class="cat" colspan="5"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td align="left" valign="middle">&nbsp;<span class="gen">{L_PAGE} <b>{ON_PAGE}</b> {L_OF} <b>{TOTAL_PAGES}</b></span>&nbsp;</td> <td align="left" valign="middle">&nbsp;<span class="gen">{L_PAGE} <b>{ON_PAGE}</b> {L_OF} <b>{TOTAL_PAGES}</b></span>&nbsp;</td>
<td align="right" valign="middle"><span class="gen">{PAGINATION}&nbsp;</span>&nbsp;</td> <td align="right" valign="middle"><span class="gen">{PAGINATION}&nbsp;</span>&nbsp;</td>
<td align="right">&nbsp;&nbsp;{S_HIDDEN_FIELDS}<input type="submit" name="delete" value="{L_DELETE}">&nbsp;&nbsp;<input type="submit" name="move" value="{L_MOVE}">&nbsp;&nbsp;<input type="submit" name="lock" value="{L_LOCK}">&nbsp;&nbsp;<input type="submit" name="unlock" value="{L_UNLOCK}"></td>
</tr> </tr>
</table></td> </table></td>
</tr> </tr>

View file

@ -1,57 +1,48 @@
<div align="center"><table width="98%" cellspacing="0" cellpadding="4" border="0"> <div align="center"><table width="98%" cellspacing="0" cellpadding="4" border="0">
<tr> <tr>
<td align="left" valign="bottom" nowrap><span class="gensmall"><a href="{U_INDEX}">{SITENAME}&nbsp;{L_INDEX}</a> -> {FORUM_NAME}</span></td> <td align="left" valign="bottom" nowrap><span class="gensmall"><a href="{U_INDEX}">{SITENAME}&nbsp;{L_INDEX}</a> -> <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
</tr> </tr>
</table></div> </table></div>
<div align="center"><table border="0" cellpadding="1" cellspacing="0" width="98%"> <div align="center"><table border="0" cellpadding="1" cellspacing="0" width="98%">
<tr><form method="post" action="{S_MODCP_URL}"> <tr><form method="post" action="{S_SPLIT_ACTION}">
<td class="tablebg"><table border="0" cellpadding="4" cellspacing="1" width="100%"> <td class="tablebg"><table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr> <tr>
<td class="cat" colspan="3" align="center"><span class="cattitle">Split Topic</span></td> <td class="cat" colspan="3" align="center"><span class="cattitle">{L_SPLIT_TOPIC}</span><br><span class="gensmall">{L_SPLIT_TOPIC_EXPLAIN}</span></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><span class="gen"><b>{L_SUBJECT}</b></span></td> <td class="row1"><span class="gen">{L_SPLIT_SUBJECT}</span></td>
<td class="row2" colspan="2"><span class="courier"><input type="text" size="50" maxlength="100" name="subject"></span></td> <td class="row2" colspan="2"><span class="courier"><input type="text" size="50" maxlength="100" name="subject"></span></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><span class="gen"><b>{L_FORUM}</b></span></td> <td class="row1"><span class="gen">{L_SPLIT_FORUM}</span></td>
<td class="row2" colspan="2"><span class="courier">{FORUM_INPUT}</span></td> <td class="row2" colspan="2"><span class="courier">{FORUM_INPUT}</span></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><span class="gen"><b>{L_AUTHOR}</b></span></td> <th>{L_AUTHOR}</th>
<td class="row2"><span class="gen"><b>{L_MESSAGE}</b></span></td> <th>{L_MESSAGE}</th>
<td class="row1"><span class="gen"><b>{L_SELECT}</b></span></td> <th>{L_SELECT}</th>
</tr> </tr>
<!-- BEGIN postrow --> <!-- BEGIN postrow -->
<tr> <tr bgcolor="{postrow.ROW_COLOR}">
<td class="row1" width="20%" align="left" valign="top"><table height="100%" cellspacing="0" cellpadding="0" border="0"> <td width="20%" align="left" valign="top"><table height="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td valign="top"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{postrow.POSTER_NAME}</b></font><br><br></td> <td valign="top"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{postrow.POSTER_NAME}</b></font><br><br></td>
</tr> </tr>
</table></td> </table></td>
<td class="row2" width="80%" height="100%"><table width="100%" height="100%" cellspacing="1" cellpadding="0" border="0"> <td width="75%" height="100%"><table width="100%" height="100%" cellspacing="1" cellpadding="0" border="0">
<tr> <tr>
<td><img src="images/icon_minipost.gif" alt="Post image icon"><font face="{T_FONTFACE1}" size="{T_FONTSIZE1}">{L_POSTED}: {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post Subject: {postrow.POST_SUBJECT}</font><hr></td> <td><img src="images/icon_minipost.gif" alt="Post image icon"><font face="{T_FONTFACE1}" size="{T_FONTSIZE1}">{L_POSTED}: {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post Subject: {postrow.POST_SUBJECT}</font><hr></td>
</tr> </tr>
<tr> <tr>
<td height="100%" valign="top"><font face="{T_FONTFACE3}" size="{T_FONTSIZE2}" color="{T_FONTCOLOR1}">{postrow.MESSAGE}</font></td> <td height="100%" valign="top"><font face="{T_FONTFACE3}" size="{T_FONTSIZE2}" color="{T_FONTCOLOR1}">{postrow.MESSAGE}</font></td>
</tr> </tr>
<tr>
<td><hr></td>
</tr>
</table></td> </table></td>
<td class="row1" width="20%" align="center"> <td width="5%" align="center">&nbsp;<input type="checkbox" name="preform_op[]" value="{postrow.POST_ID}">&nbsp;</td>
<input type="checkbox" name="preform_op[]" value="{postrow.POST_ID}">&nbsp;<font face="{T_FONTFACE3}" size="{T_FONTSIZE2}" color="{T_FONTCOLOR1}">{L_SELECT}</font>
</td>
</tr> </tr>
<!-- END postrow --> <!-- END postrow -->
<tr> <tr>
<th colspan="5" align="right">&nbsp;&nbsp;<input type="hidden" name="{POST_FORUM_URL}" value="{FORUM_ID}">&nbsp;<input type="hidden" name="mode" value="split"> <td class="cat" colspan="5" align="right">{S_HIDDEN_FIELDS}<input type="submit" name="split_type_all" value="{L_SPLIT_POSTS}">&nbsp;&nbsp;<input type="submit" name="split_type_beyond" value="{L_SPLIT_AFTER}"></td>
<input type="radio" name="split_type" value="split"><font face="{T_FONTFACE3}" size="{T_FONTSIZE2}" color="{T_FONTCOLOR1}">{L_SPLIT_POSTS}</font><br />
<input type="radio" name="split_type" value="split_after"><font face="{T_FONTFACE3}" size="{T_FONTSIZE2}" color="{T_FONTCOLOR1}">{L_SPLIT_AFTER}</font><br />
<input type="submit" name="split" value="{L_SUBMIT}"></form>
</th>
</tr> </tr>
</table></td> </table></td>
</form></tr> </form></tr>