diff options
| author | James Atkinson <thefinn@users.sourceforge.net> | 2001-07-10 23:25:33 +0000 |
|---|---|---|
| committer | James Atkinson <thefinn@users.sourceforge.net> | 2001-07-10 23:25:33 +0000 |
| commit | 777f847473a9c740d991795c5e441b716c221120 (patch) | |
| tree | 1daac15cfc53de1a6486f67b558b48ef32316c98 /phpBB | |
| parent | bfcabd3df2a4377d879cb5cc22d9cb4cafeec8f5 (diff) | |
| download | forums-777f847473a9c740d991795c5e441b716c221120.tar forums-777f847473a9c740d991795c5e441b716c221120.tar.gz forums-777f847473a9c740d991795c5e441b716c221120.tar.bz2 forums-777f847473a9c740d991795c5e441b716c221120.tar.xz forums-777f847473a9c740d991795c5e441b716c221120.zip | |
Confirm works with lock/unlock now too. Next up, move and split
git-svn-id: file:///svn/phpbb/trunk@620 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
| -rwxr-xr-x | phpBB/language/lang_english.php | 8 | ||||
| -rw-r--r-- | phpBB/modcp.php | 141 |
2 files changed, 104 insertions, 45 deletions
diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 9f00606b32..76c5cc6f2a 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -492,10 +492,10 @@ $lang['Topics_Removed'] = "The selected topics have been successfully removed fr $lang['Topics_Locked'] = "The selected topics have been locked"; $lang['Topics_Unlocked'] = "The selected topics have been unlocked"; $lang['Return_to_modcp'] = "to return to the moderator control panel"; -$lang['Confirm_delete_topic'] = "Are you sure you want to remove this topic(s)?"; -$lang['Confirm_lock_topic'] = "Are you sure you want to lock this topic(s)?"; -$lang['Confirm_unlock_topic'] = "Are you sure you want to unlock this topic(s)?"; -$lang['Confirm_move_topic'] = "Are you sure you want to move this 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_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)?"; // // Old format ... _DON'T_add_any_ new entries here!! diff --git a/phpBB/modcp.php b/phpBB/modcp.php index 879a9d620a..815f0d5f33 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -270,65 +270,124 @@ switch($mode) break; case 'lock': - if($HTTP_POST_VARS['preform_op']) - { - $topics = $HTTP_POST_VARS['preform_op']; - } - else - { - $topics = array($HTTP_GET_VARS[POST_TOPIC_URL]); - } - - $sql = "UPDATE " . TOPICS_TABLE . " SET topic_status = " . TOPIC_LOCKED . " WHERE "; - for($x = 0; $x < count($topics); $x++) + if($confirm) { - if($x > 0) + if($HTTP_POST_VARS['preform_op']) { - $sql .= " OR "; + $topics = $HTTP_POST_VARS['preform_op']; + } + else + { + $topics = array($HTTP_GET_VARS[POST_TOPIC_URL]); + } + + $sql = "UPDATE " . TOPICS_TABLE . " SET topic_status = " . TOPIC_LOCKED . " WHERE "; + for($x = 0; $x < count($topics); $x++) + { + if($x > 0) + { + $sql .= " OR "; + } + $sql .= "topic_id = " . $topics[$x]; + } + + if(!$result = $db->sql_query($sql)) + { + message_die(GENERAL_ERROR, "Coule not update topics table!", "Error", __LINE__, __FILE__, $sql); + } + else + { + $msg = $lang['Topics_Locked'] . "<br />" . "<a href=\"".append_sid("modcp.$phpEx?".POST_FORUM_URL."=$forum_id")."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $lang['Return_to_modcp']; + message_die(GENERAL_MESSAGE, $msg); } - $sql .= "topic_id = " . $topics[$x]; - } - - if(!$result = $db->sql_query($sql)) - { - message_die(GENERAL_ERROR, "Coule not update topics table!", "Error", __LINE__, __FILE__, $sql); } else { - $msg = $lang['Topics_Locked'] . "<br />" . "<a href=\"".append_sid("modcp.$phpEx?".POST_FORUM_URL."=$forum_id")."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $lang['Return_to_modcp']; - message_die(GENERAL_MESSAGE, $msg); + $hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'"><input type="hidden" name="'.POST_FORUM_URL.'" value="'.$forum_id.'">'; + if($HTTP_POST_VARS['preform_op']) + { + $topics = $HTTP_POST_VARS['preform_op']; + for($x = 0; $x < count($topics); $x++) + { + $hidden_fields .= '<input type="hidden" name="preform_op[]" value="'.$topics[$x].'">'; + } + } + else + { + $hidden_fields .= '<input type="hidden" name="'.POST_TOPIC_URL.'" value="'.$topic_id.'">'; + } + + $template->assign_vars(array("MESSAGE_TITLE" => $lang['Confirm'], + "MESSAGE_TEXT" => $lang['Confirm_lock_topic'], + "L_YES" => $lang['Yes'], + "L_NO" => $lang['No'], + "S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"), + "HIDDEN_FIELDS" => $hidden_fields)); + $template->pparse("confirm"); + include('includes/page_tail.'.$phpEx); + exit(); } break; case 'unlock': - if($HTTP_POST_VARS['preform_op']) - { - $topics = $HTTP_POST_VARS['preform_op']; - } - else + if($confirm) { - $topics = array($HTTP_GET_VARS[POST_TOPIC_URL]); - } + if($HTTP_POST_VARS['preform_op']) + { + $topics = $HTTP_POST_VARS['preform_op']; + } + else + { + $topics = array($HTTP_GET_VARS[POST_TOPIC_URL]); + } + + $sql = "UPDATE " . TOPICS_TABLE . " SET topic_status = " . TOPIC_UNLOCKED . " WHERE "; + for($x = 0; $x < count($topics); $x++) + { + if($x > 0) + { + $sql .= " OR "; + } + $sql .= "topic_id = " . $topics[$x]; + } - $sql = "UPDATE " . TOPICS_TABLE . " SET topic_status = " . TOPIC_UNLOCKED . " WHERE "; - for($x = 0; $x < count($topics); $x++) - { - if($x > 0) + if(!$result = $db->sql_query($sql)) { - $sql .= " OR "; + message_die(GENERAL_ERROR, "Coule not update topics table!", "Error", __LINE__, __FILE__, $sql); + } + else + { + $msg = $lang['Topics_Unlocked'] . "<br />" . "<a href=\"".append_sid("modcp.$phpEx?".POST_FORUM_URL."=$forum_id")."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $lang['Return_to_modcp']; + message_die(GENERAL_MESSAGE, $msg); } - $sql .= "topic_id = " . $topics[$x]; - } - - if(!$result = $db->sql_query($sql)) - { - message_die(GENERAL_ERROR, "Coule not update topics table!", "Error", __LINE__, __FILE__, $sql); } else { - $msg = $lang['Topics_Unlocked'] . "<br />" . "<a href=\"".append_sid("modcp.$phpEx?".POST_FORUM_URL."=$forum_id")."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $lang['Return_to_modcp']; - message_die(GENERAL_MESSAGE, $msg); + $hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'"><input type="hidden" name="'.POST_FORUM_URL.'" value="'.$forum_id.'">'; + if($HTTP_POST_VARS['preform_op']) + { + $topics = $HTTP_POST_VARS['preform_op']; + for($x = 0; $x < count($topics); $x++) + { + $hidden_fields .= '<input type="hidden" name="preform_op[]" value="'.$topics[$x].'">'; + } + } + else + { + $hidden_fields .= '<input type="hidden" name="'.POST_TOPIC_URL.'" value="'.$topic_id.'">'; + } + + $template->assign_vars(array("MESSAGE_TITLE" => $lang['Confirm'], + "MESSAGE_TEXT" => $lang['Confirm_unlock_topic'], + "L_YES" => $lang['Yes'], + "L_NO" => $lang['No'], + "S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"), + "HIDDEN_FIELDS" => $hidden_fields)); + $template->pparse("confirm"); + include('includes/page_tail.'.$phpEx); + exit(); } + break; case 'split': |
