aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-09-16 12:59:00 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-09-16 12:59:00 +0000
commita87703788e1c881173b4f09b41cc38dc30ced07f (patch)
treea3b4d84719c7e2627bc840ffe7841c4b14cf31ba /phpBB
parent01f0a5d16c4bf0092feb68a841bfa564757dd064 (diff)
downloadforums-a87703788e1c881173b4f09b41cc38dc30ced07f.tar
forums-a87703788e1c881173b4f09b41cc38dc30ced07f.tar.gz
forums-a87703788e1c881173b4f09b41cc38dc30ced07f.tar.bz2
forums-a87703788e1c881173b4f09b41cc38dc30ced07f.tar.xz
forums-a87703788e1c881173b4f09b41cc38dc30ced07f.zip
Various changes
git-svn-id: file:///svn/phpbb/trunk@1047 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions.php39
-rwxr-xr-xphpBB/language/lang_english.php3
-rw-r--r--phpBB/modcp.php23
-rw-r--r--phpBB/templates/PSO/modcp_move.tpl13
4 files changed, 50 insertions, 28 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ecc1727452..155259cddf 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -182,43 +182,44 @@ function make_jumpbox()
return($boxstring);
}
-function make_forum_box($box_name, $default_forum = -1)
+//
+// Simple version of jumpbox, just lists authed forums
+//
+function make_forum_select($box_name)
{
- global $db;
+ global $db, $userdata;
- $limit_forums = "";
+ $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
$sql = "SELECT forum_id, forum_name
- FROM " . FORUMS_TABLE . "
+ FROM " . FORUMS_TABLE . "
ORDER BY cat_id, forum_order";
- if(!$q_forums = $db->sql_query($sql))
+ if( !$q_forums = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql);
}
- $total_forums = $db->sql_numrows($q_forums);
- $forum_rows = $db->sql_fetchrowset($q_forums);
- $boxstring = '<select name="'.$box_name.'">';
- if($total_forums)
+ $forum_list = "";
+ while( $row = $db->sql_fetchrow($q_forums) )
{
- for($y = 0; $y < $total_forums; $y++)
+ if( $is_auth_ary[$row['forum_id']]['auth_read'] )
{
- $name = stripslashes($forum_rows[$y]['forum_name']);
- $boxstring .= "<option value=\"".$forum_rows[$y]['forum_id']."\"";
- if($forum_rows[$y]['forum_id'] == $default_forum)
- {
- $boxstring .= " selected=\"selected\"";
- }
- $boxstring .= ">$name</option>\n";
+ $forum_list .= "<option value=\"" . $row['forum_id'] . "\">" . $row['forum_name'] . "</option>";
}
}
+
+ if( $forum_list == "" )
+ {
+ $forum_list .= "<option value=\"-1\">-- ! No Forums ! --</option>\n";
+ }
else
{
- $boxstring .= "<option value=\"-1\">-- ! No Forums ! --</option>\n";
+ $forum_list = '<select name="' . $box_name . '">' . $forum_list . '</select>';
}
- return($boxstring);
+ return($forum_list);
}
+
//
// Initialise user settings on page load
function init_userprefs($userdata)
diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php
index a9b1c6d00a..1ac21588f6 100755
--- a/phpBB/language/lang_english.php
+++ b/phpBB/language/lang_english.php
@@ -605,7 +605,7 @@ $lang['Not_Authorised'] = "Not Authorised";
// Moderator Control Panel
//
$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['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. If this forum is defined as private in some way you can also modify which users can and cannot access it.";
$lang['Select'] = "Select";
$lang['Delete'] = "Delete";
$lang['Move'] = "Move";
@@ -620,6 +620,7 @@ $lang['Confirm_delete_topic'] = "Are you sure you want to remove the selected to
$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?";
+$lang['Move_to_forum'] = "Move to forum";
$lang['Split_Topic'] = "Split Topic Control Panel";
$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";
diff --git a/phpBB/modcp.php b/phpBB/modcp.php
index 3371c2fa2f..f03363c457 100644
--- a/phpBB/modcp.php
+++ b/phpBB/modcp.php
@@ -455,11 +455,10 @@ switch($mode)
{
if( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
{
- message_die(GENERAL_MESSAGE, $lang['None_selected'], $lang['Error']);
+ message_die(GENERAL_MESSAGE, $lang['None_selected']);
}
$hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '"><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">';
- $hidden_fields .= $lang['New_forum'] . ': ' . make_forum_box('new_forum'). '</select><br><br>';
if( isset($HTTP_POST_VARS['topic_id_list']) )
{
@@ -478,17 +477,22 @@ switch($mode)
// Set template files
//
$template->set_filenames(array(
- "confirm" => "confirm_body.tpl")
+ "movetopic" => "modcp_move.tpl")
);
$template->assign_vars(array(
"MESSAGE_TITLE" => $lang['Confirm'],
"MESSAGE_TEXT" => $lang['Confirm_move_topic'],
+
+ "L_MOVE_TO_FORUM" => $lang['Move_to_forum'],
"L_YES" => $lang['Yes'],
"L_NO" => $lang['No'],
- "S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"),
- "S_HIDDEN_FIELDS" => $hidden_fields));
- $template->pparse("confirm");
+
+ "S_FORUM_BOX" => make_forum_select("new_forum"),
+ "S_MODCP_ACTION" => append_sid("modcp.$phpEx"),
+ "S_HIDDEN_FIELDS" => $hidden_fields)
+ );
+ $template->pparse("movetopic");
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
@@ -691,7 +695,7 @@ switch($mode)
$topic_time = time();
$sql = "INSERT INTO " . TOPICS_TABLE . "
- (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote)
+ (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type)
VALUES ('$post_subject', $first_poster, " . $topic_time . ", $new_forum_id, " . TOPIC_UNLOCKED . ", " . POST_NORMAL . ")";
if(!$result = $db->sql_query($sql, BEGIN_TRANSACTION))
{
@@ -779,7 +783,7 @@ switch($mode)
"S_SPLIT_ACTION" => append_sid("modcp.$phpEx"),
"S_HIDDEN_FIELDS" => $s_hidden_fields,
- "FORUM_INPUT" => make_forum_box("new_forum_id", $forum_id))
+ "FORUM_INPUT" => make_forum_select("new_forum_id", $forum_id))
);
for($i = 0; $i < $total_posts; $i++)
@@ -968,6 +972,9 @@ switch($mode)
break;
+ case 'auth':
+ break;
+
default:
$template->assign_vars(array(
"L_MOD_CP" => $lang['Mod_CP'],
diff --git a/phpBB/templates/PSO/modcp_move.tpl b/phpBB/templates/PSO/modcp_move.tpl
new file mode 100644
index 0000000000..9527fc5df8
--- /dev/null
+++ b/phpBB/templates/PSO/modcp_move.tpl
@@ -0,0 +1,13 @@
+
+<form action="{S_MODCP_ACTION}" method="post"><table width="80%" cellpadding="1" cellspacing="0" border="0" align="center">
+ <tr>
+ <td class="tablebg"><table width="100%" cellpadding="4" cellspacing="1" border="0">
+ <tr>
+ <th class="secondary"><b>{MESSAGE_TITLE}</b></th>
+ </tr>
+ <tr>
+ <td class="row2" align="center"><br /><span class="gen">{L_MOVE_TO_FORUM} &nbsp; {S_FORUM_BOX}<br /><br />{MESSAGE_TEXT}</span><br /><br />{S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{L_YES}" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" /><br /><br /></td>
+ </tr>
+ </table></td>
+ </tr>
+</table></form>