aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/admin/admin_forums.php89
-rw-r--r--phpBB/common.php1
-rw-r--r--phpBB/includes/functions.php36
-rw-r--r--phpBB/language/lang_english/lang_admin.php39
-rw-r--r--phpBB/language/lang_english/lang_main.php6
5 files changed, 74 insertions, 97 deletions
diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php
index 19b9b6fc00..2336bec824 100644
--- a/phpBB/admin/admin_forums.php
+++ b/phpBB/admin/admin_forums.php
@@ -41,28 +41,6 @@ require('pagestart.' . $phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
//
-// Additional lang strings and constants
-//
-$lang['Category_name'] = 'Category name';
-$lang['Type'] = 'Type';
-
-$lang['Parent'] = 'Parent';
-$lang['Locked'] = 'Locked';
-$lang['Unlocked'] = 'Unlocked';
-
-$lang['General_settings'] = 'General settings';
-$lang['Forum_settings'] = 'Forum settings';
-$lang['Disable_post_count'] = 'Disable post count';
-
-$lang['Default_style'] = 'Default style';
-
-$lang['Move_posts'] = 'Move posts to';
-$lang['Delete_subforums'] = 'Delete subforums and associated posts';
-$lang['Move_subforums'] = 'Move subforums to';
-
-define('ITEM_CATEGORY', 3);
-
-//
// Do we have forum admin permissions?
//
if (!$acl->get_acl_admin('forum'))
@@ -307,10 +285,7 @@ switch ($mode)
$parents_list = make_forums_list('all', $parent_id, $subforums_id);
- //
- // TODO: Make 'Edit_forum' and 'Edit_Category' use the same case
- //
- $l_title = ($forum_status != ITEM_CATEGORY) ? $lang['Edit_forum'] : $lang['Edit_Category'];
+ $l_title = ($forum_status != ITEM_CATEGORY) ? $lang['Edit_forum'] : $lang['Edit_category'];
$newmode = 'modify';
$buttonvalue = $lang['Update'];
$prune_enabled = ($prune_enable) ? 'checked="checked" ' : '';
@@ -382,7 +357,7 @@ switch ($mode)
{
?>
<tr>
- <td class="row1"><?php echo $lang['Type'] ?></td>
+ <td class="row1"><?php echo $lang['Forum_type'] ?></td>
<td class="row2"><input type="radio" name="is_category" value="0" <?php echo $forum_checked ?>/><?php echo $lang['Forum'] ?> &nbsp; <input type="radio" name="is_category" value="1" <?php echo $category_checked ?>/><?php echo $lang['Category'] ?></td>
</tr>
<?php
@@ -420,10 +395,10 @@ switch ($mode)
{
?>
<tr>
- <td class="row1"><?php echo $lang['Type'] ?></td>
- <td class="row2"><input type="checkbox" name="set_category" />Change this forum into a category and<br />
+ <td class="row1"><?php echo $lang['Forum_type'] ?></td>
+ <td class="row2"><input type="checkbox" name="set_category" /><?php echo $lang['Set_as_category'] ?><br />
&nbsp; &nbsp; &nbsp;<input type="radio" name="action" value="delete" checked="checked" /><?php echo $lang['Delete_all_posts'] ?><br />
- &nbsp; &nbsp; &nbsp;<input type="radio" name="action" value="move" />Move all posts to <select name="to_forum_id"><?php echo $forums_list ?></select>
+ &nbsp; &nbsp; &nbsp;<input type="radio" name="action" value="move" /><?php echo $lang['Move_posts_to'] ?> <select name="to_forum_id"><?php echo $forums_list ?></select>
</td>
</tr>
<?php
@@ -498,7 +473,7 @@ switch ($mode)
</tr>
<tr>
<td class="row1"></td>
- <td class="row1"><input type="radio" name="action_posts" value="move" /> <?php echo $lang['Move_posts'] ?> <select name="posts_to_id" ?><option value="0"></option><?php echo $move_posts_list ?></select></td>
+ <td class="row1"><input type="radio" name="action_posts" value="move" /> <?php echo $lang['Move_posts_to'] ?> <select name="posts_to_id" ?><option value="0"></option><?php echo $move_posts_list ?></select></td>
</tr>
<?php
}
@@ -511,7 +486,7 @@ switch ($mode)
</tr>
<tr>
<td class="row1"></td>
- <td class="row1"><input type="radio" name="action_forums" value="move" /> <?php echo $lang['Move_subforums'] ?> <select name="subforums_to_id" ?><option value="0"></option><?php echo $forums_list ?></select></td>
+ <td class="row1"><input type="radio" name="action_forums" value="move" /> <?php echo $lang['Move_subforums_to'] ?> <select name="subforums_to_id" ?><option value="0"></option><?php echo $forums_list ?></select></td>
</tr>
<?php
}
@@ -546,14 +521,8 @@ else
{
$navigation = '<a href="admin_forums.' . $phpEx . $SID . '">Forum Index</a>';
- $sql = 'SELECT f2.forum_id, f2.forum_name
- FROM ' . FORUMS_TABLE . ' f1
- LEFT JOIN ' . FORUMS_TABLE . " f2 ON f1.left_id BETWEEN f2.left_id AND f2.right_id
- WHERE f1.forum_id = $parent_id
- ORDER BY f2.left_id";
-
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ $forums_nav = get_forum_branch($parent_id, 'parents', 'descending');
+ foreach ($forums_nav as $row)
{
if ($row['forum_id'] == $parent_id)
{
@@ -654,7 +623,7 @@ while ($row = $db->sql_fetchrow($result))
}
?>
<tr>
- <td width="1" class="spaceRow"></td>
+ <td width="1" class="row3"></td>
<td width="40%" class="row2"<?php echo $colspan ?>><span class="gen"><?php echo $forum_title ?></span><br /><span class="gensmall"><?php echo $forum_desc ?></span></td>
<?php echo $forum_stats ?>
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $lang['Edit'] ?></a></span></td>
@@ -666,7 +635,7 @@ while ($row = $db->sql_fetchrow($result))
}
?>
<tr>
- <td width="1" class="spaceRow"></td>
+ <td width="1" class="row3"></td>
<td width="100%" colspan="8" class="row2"><input type="text" name="forum_name[<? echo $row['forum_id'] ?>]" /> <input type="submit" class="liteoption" name="parent_id[<? echo $row['forum_id'] ?>]" value="<?php echo $lang['Create_forum'] ?>" /></td>
</tr>
<?php
@@ -705,42 +674,6 @@ page_footer();
// Begin function block
//
-function get_forum_branch($forum_id, $type='all', $order='descending', $include_forum=TRUE)
-{
- global $db;
-
- switch ($type)
- {
- case 'parents':
- $condition = 'f1.left_id BETWEEN f2.left_id AND f2.right_id';
- break;
-
- case 'children':
- $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id';
- break;
-
- default:
- $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id OR f1.left_id BETWEEN f2.left_id AND f2.right_id';
- }
- $sql = 'SELECT f2.*
- FROM ' . FORUMS_TABLE . ' f1
- LEFT JOIN ' . FORUMS_TABLE . " f2 ON $condition
- WHERE f1.forum_id = $forum_id
- ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
-
- $rows = array();
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- if (!$include_forum && $row['forum_id'] == $forum_id)
- {
- continue;
- }
- $rows[] = $row;
- }
- return $rows;
-}
-
function get_forum_info($forum_id)
{
global $db;
diff --git a/phpBB/common.php b/phpBB/common.php
index 704037be13..3d7a1c7734 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -66,6 +66,7 @@ define('GROUP_HIDDEN', 2);
define('ITEM_UNLOCKED', 0);
define('ITEM_LOCKED', 1);
define('ITEM_MOVED', 2);
+define('ITEM_CATEGORY', 3);
// Topic types
define('POST_NORMAL', 0);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ffcb49dc1b..aa7feba656 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -81,6 +81,42 @@ function get_userdata($user)
return ( $row = $db->sql_fetchrow($result) ) ? $row : false;
}
+function get_forum_branch($forum_id, $type='all', $order='descending', $include_forum=TRUE)
+{
+ global $db;
+
+ switch ($type)
+ {
+ case 'parents':
+ $condition = 'f1.left_id BETWEEN f2.left_id AND f2.right_id';
+ break;
+
+ case 'children':
+ $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id';
+ break;
+
+ default:
+ $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id OR f1.left_id BETWEEN f2.left_id AND f2.right_id';
+ }
+ $sql = 'SELECT f2.*
+ FROM ' . FORUMS_TABLE . ' f1
+ LEFT JOIN ' . FORUMS_TABLE . " f2 ON $condition
+ WHERE f1.forum_id = $forum_id
+ ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
+
+ $rows = array();
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (!$include_forum && $row['forum_id'] == $forum_id)
+ {
+ continue;
+ }
+ $rows[] = $row;
+ }
+ return $rows;
+}
+
//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
diff --git a/phpBB/language/lang_english/lang_admin.php b/phpBB/language/lang_english/lang_admin.php
index aab70579e4..a7e4582cc1 100644
--- a/phpBB/language/lang_english/lang_admin.php
+++ b/phpBB/language/lang_english/lang_admin.php
@@ -522,23 +522,29 @@ $lang['Allow_name_change'] = 'Allow Username changes';
$lang['Forum_admin'] = 'Forum Administration';
$lang['Forum_admin_explain'] = 'From this panel you can add, delete, edit, re-order and re-synchronise categories and forums';
$lang['Edit_forum'] = 'Edit forum';
+$lang['Edit_category'] = 'Edit category';
$lang['Create_forum'] = 'Create new forum';
-$lang['Create_category'] = 'Create new category';
$lang['Remove'] = 'Remove';
$lang['Action'] = 'Action';
-$lang['Update_order'] = 'Update Order';
-$lang['Config_updated'] = 'Forum Configuration Updated Successfully';
+$lang['Config_updated'] = 'Forum configuration updated successfully';
$lang['Edit'] = 'Edit';
$lang['Delete'] = 'Delete';
$lang['Move_up'] = 'Move up';
$lang['Move_down'] = 'Move down';
$lang['Resync'] = 'Resync';
-$lang['No_mode'] = 'No mode was set';
-$lang['Forum_edit_delete_explain'] = 'The form below will allow you to customize all the general board options. For User and Forum configurations use the related links on the left hand side';
-$lang['Move_contents'] = 'Move all contents';
-$lang['Forum_delete'] = 'Delete Forum';
-$lang['Forum_delete_explain'] = 'The form below will allow you to delete a forum (or category) and decide where you want to put all topics (or forums) it contained.';
+$lang['Category_name'] = 'Category name';
+$lang['Forum_type'] = 'Forum type';
+
+$lang['Parent'] = 'Parent';
+$lang['Locked'] = 'Locked';
+$lang['Unlocked'] = 'Unlocked';
+
+$lang['General_settings'] = 'General settings';
+$lang['Forum_settings'] = 'Forum settings';
+$lang['Disable_post_count'] = 'Disable post count';
+
+$lang['Forum_edit_delete_explain'] = 'The form below will allow you to customize all the general board options. For User and Forum configurations use the related links on the left hand side';
$lang['Forum_general'] = 'General Forum Settings';
$lang['Forum_name'] = 'Forum name';
@@ -548,20 +554,19 @@ $lang['Forum_pruning'] = 'Auto-pruning';
$lang['prune_freq'] = 'Check for topic age every';
$lang['prune_days'] = 'Remove topics that have not been posted to in';
-$lang['Set_prune_data'] = 'You have turned on auto-prune for this forum but did not set a frequency or number of days to prune. Please go back and do so';
-$lang['Move_and_Delete'] = 'Move and Delete';
+$lang['Set_as_category'] = 'Set this forum as a category and'; // followed by a list of actions
-$lang['Delete_all_posts'] = 'Delete all posts';
-$lang['Nowhere_to_move'] = 'Nowhere to move too';
+$lang['Forum_delete'] = 'Delete Forum';
+$lang['Forum_delete_explain'] = 'The form below will allow you to delete a forum (or category) and decide where you want to put all topics (or forums) it contained.';
-$lang['Edit_Category'] = 'Edit Category';
-$lang['Edit_Category_explain'] = 'Use this form to modify a categories name.';
+$lang['Move_and_Delete'] = 'Move and Delete';
+$lang['Move_posts_to'] = 'Move posts to';
+$lang['Move_subforums_to'] = 'Move subforums to';
+$lang['Delete_all_posts'] = 'Delete all posts';
+$lang['Delete_subforums'] = 'Delete subforums and associated posts';
$lang['Forums_updated'] = 'Forum and Category information updated successfully';
-
-$lang['Must_delete_forums'] = 'You need to delete all forums before you can delete this category';
-
$lang['Click_return_forumadmin'] = 'Click %sHere%s to return to Forum Administration';
diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php
index 35e922890c..3e8fed672b 100644
--- a/phpBB/language/lang_english/lang_main.php
+++ b/phpBB/language/lang_english/lang_main.php
@@ -576,11 +576,13 @@ $lang['Always_notify'] = 'Always notify me of replies';
$lang['Always_notify_explain'] = 'Sends an email when someone replies to a topic you have posted in. This can be changed whenever you post';
$lang['Board_style'] = 'Board Style';
-$lang['Board_lang'] = 'Board Language';
+$lang['Default_style'] = 'Default style';
$lang['No_themes'] = 'No Themes In database';
+
+$lang['Board_lang'] = 'Board Language';
$lang['Timezone'] = 'Timezone';
$lang['Date_format'] = 'Date format';
-$lang['Date_format_explain'] = 'The syntax used is identical to the PHP <a href=\'http://www.php.net/date\' target=\'_other\'>date()</a> function';
+$lang['Date_format_explain'] = 'The syntax used is identical to the PHP <a href="http://www.php.net/date" target="_other">date()</a> function';
$lang['Signature'] = 'Signature';
$lang['Signature_explain'] = 'This is a block of text that can be added to posts you make. There is a %d character limit';
$lang['Public_view_email'] = 'Always show my Email Address';