diff options
| author | James Atkinson <thefinn@users.sourceforge.net> | 2001-07-06 21:54:33 +0000 |
|---|---|---|
| committer | James Atkinson <thefinn@users.sourceforge.net> | 2001-07-06 21:54:33 +0000 |
| commit | fd2ec7fad595af91f7f89603298224d160939584 (patch) | |
| tree | e3ccd9ae93d49c5661dc4294493ed355eb30cfbf | |
| parent | 977503911a3198459817cfe7492abdeb49a52996 (diff) | |
| download | forums-fd2ec7fad595af91f7f89603298224d160939584.tar forums-fd2ec7fad595af91f7f89603298224d160939584.tar.gz forums-fd2ec7fad595af91f7f89603298224d160939584.tar.bz2 forums-fd2ec7fad595af91f7f89603298224d160939584.tar.xz forums-fd2ec7fad595af91f7f89603298224d160939584.zip | |
Mass lock/unlock done. Locked topic handling in viewforum
git-svn-id: file:///svn/phpbb/trunk@589 89ea8834-ac86-4346-8a33-228a782c2dd0
| -rw-r--r-- | phpBB/common.php | 2 | ||||
| -rwxr-xr-x | phpBB/language/lang_english.php | 2 | ||||
| -rw-r--r-- | phpBB/modcp.php | 56 | ||||
| -rw-r--r-- | phpBB/templates/Default/modcp_body.tpl | 2 | ||||
| -rw-r--r-- | phpBB/viewforum.php | 16 |
5 files changed, 67 insertions, 11 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index f3ef262412..8eb648495a 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -54,6 +54,8 @@ $images['posticon'] = "$url_images/posticon.gif"; $images['folder'] = "$url_images/folder.gif"; $images['new_folder'] = "$url_images/red_folder.gif"; $images['latest_reply'] = "$url_images/latest_reply.gif"; +$images['locked_folder'] = "$url_images/folder_lock.gif"; + include('includes/template.inc'); diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 2b60d4fd81..7ad0fafc7d 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -441,6 +441,8 @@ $lang['Move'] = "Move"; $lang['Lock'] = "Lock"; $lang['Unlock'] = "Unlock"; $lang['Topics_Removed'] = "The selected topics have been successfully removed from the database."; +$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"; // diff --git a/phpBB/modcp.php b/phpBB/modcp.php index d770f2f324..de56cfb5d4 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -212,7 +212,7 @@ switch($mode) } } - $msg = $lang['Topics_Removed'] .= "<br />" . "<a href=\"".append_sid("modcp.$phpEx?".POST_FORUM_URL."=$forum_id")."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $lang['Return_to_modcp']; + $msg = $lang['Topics_Removed'] . "<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); } @@ -224,11 +224,55 @@ switch($mode) break; case 'lock': - echo 'Lock'; + if($HTTP_POST_VARS['preform_op']) + { + $topics = $HTTP_POST_VARS['preform_op']; + $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); + } + } break; case 'unlock': - echo 'Unlock'; + if($HTTP_POST_VARS['preform_op']) + { + $topics = $HTTP_POST_VARS['preform_op']; + $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]; + } + + 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); + } + } break; default: @@ -246,7 +290,7 @@ switch($mode) $start = 0; } - $sql = "SELECT t.topic_title, t.topic_id, t.topic_replies, 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 WHERE t.forum_id = $forum_id AND t.topic_poster = u.user_id @@ -266,13 +310,13 @@ switch($mode) { $topic_id = $topics[$x]['topic_id']; $topic_title = stripslashes($topics[$x]['topic_title']); - $s_topic_url = 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']; $last_post_time = create_date($board_config['default_dateformat'], $topics[$x]['post_time'], $board_config['default_timezone']); $template->assign_block_vars("topicrow", array( - "S_TOPIC_URL" => $s_topic_url, + "U_VIEW_TOPIC" => $u_view_topic, "TOPIC_TITLE" => $topic_title, "REPLIES" => $topic_replies, "LAST_POST" => $last_post_time, diff --git a/phpBB/templates/Default/modcp_body.tpl b/phpBB/templates/Default/modcp_body.tpl index eb0428b260..87569c810d 100644 --- a/phpBB/templates/Default/modcp_body.tpl +++ b/phpBB/templates/Default/modcp_body.tpl @@ -23,7 +23,7 @@ </tr> <!-- BEGIN topicrow --> <tr class="tablebody"> - <td bgcolor="#CCCCCC"><a href="{topicrow.S_TOPIC_URL}">{topicrow.TOPIC_TITLE}</a></td> + <td bgcolor="#CCCCCC"><a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></td> <td bgcolor="#DDDDDD" align="center">{topicrow.REPLIES}</td> <td bgcolor="#CCCCCC" align="center">{topicrow.LAST_POST}</td> <td bgcolor="#DDDDDD"><input type="checkbox" name="preform_op[]" value="{topicrow.TOPIC_ID}">{L_SELECT}</td> diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index ad71cb117a..cab3c0ea1e 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -361,14 +361,22 @@ if($total_topics) // } // else // { - if($userdata['session_start'] == $userdata['session_time']) - { - $folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_last_visit']) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">"; + if($topic_rowset[$x]['topic_status'] == TOPIC_LOCKED) + { + $folder_image = "<img src=\"" . $images['locked_folder'] . "\" alt=\"Topic Locked\">"; } else { - $folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_time'] - 300) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">"; + if($userdata['session_start'] == $userdata['session_time']) + { + $folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_last_visit']) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">"; + } + else + { + $folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_time'] - 300) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">"; + } } + // } $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&" . $replies); |
