mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Some changes to forum admin to better reflect subforum 'post/non-post' changes ... no guarantees I've not broken something ... note the schema changes
git-svn-id: file:///svn/phpbb/trunk@3094 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
efad1f2491
commit
734c286f9f
5 changed files with 272 additions and 308 deletions
|
@ -67,7 +67,7 @@ switch ($mode)
|
||||||
case 'move_up':
|
case 'move_up':
|
||||||
case 'move_down':
|
case 'move_down':
|
||||||
$show_index = TRUE;
|
$show_index = TRUE;
|
||||||
$forum_id = intval($_GET['f']);
|
$forum_id = intval($_GET['this_f']);
|
||||||
|
|
||||||
$result = $db->sql_query('SELECT parent_id, left_id, right_id FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id");
|
$result = $db->sql_query('SELECT parent_id, left_id, right_id FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id");
|
||||||
if (!$row = $db->sql_fetchrow($result))
|
if (!$row = $db->sql_fetchrow($result))
|
||||||
|
@ -83,16 +83,16 @@ switch ($mode)
|
||||||
if ($mode == 'move_up')
|
if ($mode == 'move_up')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT forum_id, left_id, right_id
|
$sql = 'SELECT forum_id, left_id, right_id
|
||||||
FROM ' . FORUMS_TABLE . "
|
FROM ' . FORUMS_TABLE . "
|
||||||
WHERE parent_id = $parent_id AND right_id < $right_id
|
WHERE parent_id = $parent_id AND right_id < $right_id
|
||||||
ORDER BY right_id DESC";
|
ORDER BY right_id DESC";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql = 'SELECT forum_id, left_id, right_id
|
$sql = 'SELECT forum_id, left_id, right_id
|
||||||
FROM ' . FORUMS_TABLE . "
|
FROM ' . FORUMS_TABLE . "
|
||||||
WHERE parent_id = $parent_id AND left_id > $left_id
|
WHERE parent_id = $parent_id AND left_id > $left_id
|
||||||
ORDER BY left_id ASC";
|
ORDER BY left_id ASC";
|
||||||
}
|
}
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
|
||||||
|
@ -124,8 +124,8 @@ switch ($mode)
|
||||||
//
|
//
|
||||||
$forum_ids = array();
|
$forum_ids = array();
|
||||||
$sql = 'SELECT forum_id
|
$sql = 'SELECT forum_id
|
||||||
FROM ' . FORUMS_TABLE . '
|
FROM ' . FORUMS_TABLE . '
|
||||||
WHERE left_id > ' . $forum_info[$up_id]['left_id'] . ' AND right_id < ' . $forum_info[$up_id]['right_id'];
|
WHERE left_id > ' . $forum_info[$up_id]['left_id'] . ' AND right_id < ' . $forum_info[$up_id]['right_id'];
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -134,57 +134,43 @@ switch ($mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
||||||
SET left_id = left_id + ' . ($diff_up + 1) . ', right_id = right_id + ' . ($diff_up + 1) . '
|
SET left_id = left_id + ' . ($diff_up + 1) . ', right_id = right_id + ' . ($diff_up + 1) . '
|
||||||
WHERE left_id > ' . $forum_info[$down_id]['left_id'] . ' AND right_id < ' . $forum_info[$down_id]['right_id'];
|
WHERE left_id > ' . $forum_info[$down_id]['left_id'] . ' AND right_id < ' . $forum_info[$down_id]['right_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
if (count($forum_ids))
|
if (count($forum_ids))
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
||||||
SET left_id = left_id - ' . ($diff_down + 1) . ', right_id = right_id - ' . ($diff_down + 1) . '
|
SET left_id = left_id - ' . ($diff_down + 1) . ', right_id = right_id - ' . ($diff_down + 1) . '
|
||||||
WHERE forum_id IN (' . implode(', ', $forum_ids) . ')';
|
WHERE forum_id IN (' . implode(', ', $forum_ids) . ')';
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
||||||
SET left_id = ' . $forum_info[$down_id]['left_id'] . ', right_id = ' . ($forum_info[$down_id]['left_id'] + $diff_up) . '
|
SET left_id = ' . $forum_info[$down_id]['left_id'] . ', right_id = ' . ($forum_info[$down_id]['left_id'] + $diff_up) . '
|
||||||
WHERE forum_id = ' . $up_id;
|
WHERE forum_id = ' . $up_id;
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
||||||
SET left_id = ' . ($forum_info[$up_id]['right_id'] - $diff_down) . ', right_id = ' . $forum_info[$up_id]['right_id'] . '
|
SET left_id = ' . ($forum_info[$up_id]['right_id'] - $diff_down) . ', right_id = ' . $forum_info[$up_id]['right_id'] . '
|
||||||
WHERE forum_id = ' . $down_id;
|
WHERE forum_id = ' . $down_id;
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'create':
|
case 'create':
|
||||||
if (!trim($_POST['forum_name']))
|
if (!trim($_POST['forum_name']))
|
||||||
{
|
{
|
||||||
message_die(ERROR, 'Cannot create a forum without a name');
|
trigger_error('Cannot create a forum without a name');
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent_id = (!empty($_POST['parent_id'])) ? $_POST['parent_id'] : 0;
|
$parent_id = (!empty($_POST['parent_id'])) ? intval($_POST['parent_id']) : 0;
|
||||||
$forum_status = (!empty($_POST['is_category'])) ? ITEM_CATEGORY : $_POST['forum_status'];
|
|
||||||
$forum_name = str_replace("\'", "''", $_POST['forum_name']);
|
|
||||||
$forum_desc = str_replace("\'", "''", $_POST['forum_desc']);
|
|
||||||
|
|
||||||
$forum_style = (!empty($_POST['forum_style'])) ? intval($_POST['forum_style']) : 'NULL';
|
|
||||||
$post_count_inc = (!empty($_POST['disable_post_count'])) ? 0 : 1;
|
|
||||||
$moderated = (!empty($_POST['moderated'])) ? 1 : 0;
|
|
||||||
|
|
||||||
$prune_enable = (!empty($_POST['prune_enable'])) ? 1 : 0;
|
|
||||||
$prune_days = intval($_POST['prune_days']);
|
|
||||||
$prune_freq = intval($_POST['prune_freq']);
|
|
||||||
|
|
||||||
$result = $db->sql_query('SELECT MAX(forum_id) AS max_id FROM ' . FORUMS_TABLE);
|
|
||||||
$forum_id = $db->sql_fetchfield('max_id', 0, $result) + 1;
|
|
||||||
|
|
||||||
if ($parent_id)
|
if ($parent_id)
|
||||||
{
|
{
|
||||||
$result = $db->sql_query('SELECT left_id, right_id FROM ' . FORUMS_TABLE . " WHERE forum_id = $parent_id");
|
$result = $db->sql_query('SELECT left_id, right_id FROM ' . FORUMS_TABLE . " WHERE forum_id = $parent_id");
|
||||||
if (!$row = $db->sql_fetchrow($result))
|
if (!$row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
message_die(ERROR, 'Parent does not exist');
|
trigger_error('Parent does not exist', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
extract($row);
|
extract($row);
|
||||||
|
|
||||||
|
@ -197,21 +183,39 @@ switch ($mode)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $db->sql_query('SELECT MAX(right_id) AS right_id FROM ' . FORUMS_TABLE);
|
$result = $db->sql_query('SELECT MAX(right_id) AS right_id FROM ' . FORUMS_TABLE);
|
||||||
|
|
||||||
$left_id = $db->sql_fetchfield('right_id', 0, $result) + 1;
|
$left_id = $db->sql_fetchfield('right_id', 0, $result) + 1;
|
||||||
$right_id = $left_id + 1;
|
$right_id = $left_id + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . FORUMS_TABLE . " (forum_id, forum_name, forum_desc, parent_id, left_id, right_id, forum_status, forum_style, post_count_inc, moderated, prune_enable, prune_days, prune_freq)
|
$sql = array(
|
||||||
VALUES ($forum_id, '$forum_name', '$forum_desc', $parent_id, $left_id, $right_id, $forum_status, $forum_style, $post_count_inc, $moderated, $prune_enable, $prune_days, $prune_freq)";
|
'parent_id' => $parent_id,
|
||||||
$db->sql_query($sql);
|
'left_id' => $left_id,
|
||||||
|
'right_id' => $right_id,
|
||||||
|
'forum_status' => (!empty($_POST['is_category'])) ? ITEM_CATEGORY : intval($_POST['forum_status']),
|
||||||
|
'forum_postable' => (!empty($_POST['is_category'])) ? 0 : 1,
|
||||||
|
'forum_name' => sql_quote($_POST['forum_name']),
|
||||||
|
'forum_desc' => sql_quote($_POST['forum_desc']),
|
||||||
|
'forum_style' => (!empty($_POST['forum_style'])) ? intval($_POST['forum_style']) : 'NULL',
|
||||||
|
'enable_post_count' => (!empty($_POST['disable_post_count'])) ? 0 : 1,
|
||||||
|
'enable_icons' => (!empty($_POST['enable_icons'])) ? 1 : 0,
|
||||||
|
'enable_moderate' => (!empty($_POST['moderated'])) ? 1 : 0,
|
||||||
|
'enable_prune' => (!empty($_POST['prune_enable'])) ? 1 : 0,
|
||||||
|
'prune_days' => intval($_POST['prune_days']),
|
||||||
|
'prune_freq' => intval($_POST['prune_freq'])
|
||||||
|
);
|
||||||
|
|
||||||
$message = $user->lang['Forums_updated'] . "<br /><br />" . sprintf($user->lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $parent_id . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="index.' . $phpEx . $SID . '?pane=right' . '">', '</a>');
|
$db->sql_query('INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql));
|
||||||
message_die(MESSAGE, $message);
|
|
||||||
|
$forum_id = $db->sql_nextid();
|
||||||
|
|
||||||
|
// Redirect to permissions
|
||||||
|
redirect('admin_permissions.' . $phpEx . $SID . '&mode=forums&f=' . $forum_id);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'modify':
|
case 'modify':
|
||||||
if (!$forum_id = intval($_POST['forum_id']))
|
if (!$forum_id = intval($_POST['f']))
|
||||||
{
|
{
|
||||||
message_die(ERROR, 'No forum specified');
|
message_die(ERROR, 'No forum specified');
|
||||||
}
|
}
|
||||||
|
@ -233,20 +237,23 @@ switch ($mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = array(
|
$sql = array(
|
||||||
|
'parent_id' => $parent_id,
|
||||||
'forum_name' => (!empty($_POST['forum_name'])) ? $_POST['forum_name'] : $row['forum_name'],
|
'forum_name' => (!empty($_POST['forum_name'])) ? $_POST['forum_name'] : $row['forum_name'],
|
||||||
'forum_desc' => (!empty($_POST['forum_desc'])) ? $_POST['forum_desc'] : $row['forum_desc'],
|
'forum_desc' => (!empty($_POST['forum_desc'])) ? $_POST['forum_desc'] : $row['forum_desc'],
|
||||||
'forum_status' => (!empty($_POST['set_category']) && $action) ? ITEM_CATEGORY : intval($_POST['forum_status']),
|
'forum_status' => intval($_POST['forum_status']),
|
||||||
|
'forum_postable' => (!empty($_POST['is_postable'])) ? 1 : 0,
|
||||||
'forum_style' => (!empty($_POST['forum_style'])) ? $_POST['forum_style'] : NULL,
|
'forum_style' => (!empty($_POST['forum_style'])) ? $_POST['forum_style'] : NULL,
|
||||||
'parent_id' => $parent_id,
|
'forum_image' => (!empty($_POST['forum_image'])) ? $_POST['forum_image'] : '',
|
||||||
'prune_enable' => (!empty($_POST['prune_enable'])) ? 1 : 0,
|
'display_on_index' => (!empty($_POST['display_on_index'])) ? 1 : 0,
|
||||||
|
'enable_post_count' => (!empty($_POST['disable_post_count'])) ? 0 : 1,
|
||||||
|
'enable_icons' => (!empty($_POST['topic_icons'])) ? 1 : 0,
|
||||||
|
'enable_moderate' => (!empty($_POST['moderated'])) ? 1 : 0,
|
||||||
|
'enable_prune' => (!empty($_POST['prune_enable'])) ? 1 : 0,
|
||||||
'prune_days' => intval($_POST['prune_days']),
|
'prune_days' => intval($_POST['prune_days']),
|
||||||
'prune_freq' => intval($_POST['prune_freq']),
|
'prune_freq' => intval($_POST['prune_freq']),
|
||||||
'display_on_index' => (!empty($_POST['display_on_index'])) ? 1 : 0,
|
|
||||||
'post_count_inc' => (!empty($_POST['disable_post_count'])) ? 0 : 1,
|
|
||||||
'moderated' => (!empty($_POST['moderated'])) ? 1 : 0,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!empty($_POST['set_category']) && $action)
|
if (!empty($_POST['set_nonpostable']) && $action)
|
||||||
{
|
{
|
||||||
if ($action == 'move' && $_POST['to_forum_id'])
|
if ($action == 'move' && $_POST['to_forum_id'])
|
||||||
{
|
{
|
||||||
|
@ -274,7 +281,7 @@ switch ($mode)
|
||||||
//
|
//
|
||||||
// wasn't this form submitted? is anyone trying to remotely delete forums
|
// wasn't this form submitted? is anyone trying to remotely delete forums
|
||||||
//
|
//
|
||||||
message_die(ERROR, 'Did not submit');
|
trigger_error('Did not submit', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$action_subforums = (!empty($_POST['action_subforums'])) ? $_POST['action_subforums'] : '';
|
$action_subforums = (!empty($_POST['action_subforums'])) ? $_POST['action_subforums'] : '';
|
||||||
|
@ -356,9 +363,8 @@ switch ($mode)
|
||||||
message_die(MESSAGE, $message);
|
message_die(MESSAGE, $message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'forum_sync':
|
case 'sync':
|
||||||
sync('forum', intval($_GET['f']));
|
sync('forum', intval($_GET['this_f']));
|
||||||
$show_index = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'add':
|
case 'add':
|
||||||
|
@ -366,7 +372,7 @@ switch ($mode)
|
||||||
// Show form to create/modify a forum
|
// Show form to create/modify a forum
|
||||||
if ($mode == 'edit')
|
if ($mode == 'edit')
|
||||||
{
|
{
|
||||||
$forum_id = intval($_GET['f']);
|
$forum_id = intval($_GET['this_f']);
|
||||||
|
|
||||||
$row = get_forum_info($forum_id);
|
$row = get_forum_info($forum_id);
|
||||||
extract($row);
|
extract($row);
|
||||||
|
@ -403,6 +409,7 @@ switch ($mode)
|
||||||
$newmode = 'create';
|
$newmode = 'create';
|
||||||
$buttonvalue = $user->lang['Create_forum'];
|
$buttonvalue = $user->lang['Create_forum'];
|
||||||
|
|
||||||
|
$forum_id = $parent_id;
|
||||||
$forum_desc = '';
|
$forum_desc = '';
|
||||||
$forum_style = '';
|
$forum_style = '';
|
||||||
$forum_status = ITEM_UNLOCKED;
|
$forum_status = ITEM_UNLOCKED;
|
||||||
|
@ -410,6 +417,7 @@ switch ($mode)
|
||||||
|
|
||||||
$post_count_inc = TRUE;
|
$post_count_inc = TRUE;
|
||||||
$moderated = FALSE;
|
$moderated = FALSE;
|
||||||
|
$enable_icons = TRUE;
|
||||||
|
|
||||||
$prune_enabled = '';
|
$prune_enabled = '';
|
||||||
$prune_days = 7;
|
$prune_days = 7;
|
||||||
|
@ -419,10 +427,10 @@ switch ($mode)
|
||||||
$styles_list = make_styles_list($forum_style);
|
$styles_list = make_styles_list($forum_style);
|
||||||
|
|
||||||
$forumlocked = ($forum_status == ITEM_LOCKED) ? ' selected="selected"' : '';
|
$forumlocked = ($forum_status == ITEM_LOCKED) ? ' selected="selected"' : '';
|
||||||
$forumunlocked = ($forum_status == ITEM_UNLOCKED || $forum_status == ITEM_CATEGORY) ? ' selected="selected"' : '';
|
$forumunlocked = ($forum_status == ITEM_UNLOCKED) ? ' selected="selected"' : '';
|
||||||
|
|
||||||
$forum_checked = ($forum_status != ITEM_CATEGORY) ? 'checked="checked" ' : '';
|
$postable_checked = ($forum_postable) ? 'checked="checked" ' : '';
|
||||||
$category_checked = ($forum_status == ITEM_CATEGORY) ? 'checked="checked" ' : '';
|
$nonpostable_checked = (!$forum_postable) ? 'checked="checked" ' : '';
|
||||||
|
|
||||||
$statuslist = '<option value="' . ITEM_UNLOCKED . '"' . $forumunlocked . '>' . $user->lang['Unlocked'] . "</option>\n";
|
$statuslist = '<option value="' . ITEM_UNLOCKED . '"' . $forumunlocked . '>' . $user->lang['Unlocked'] . "</option>\n";
|
||||||
$statuslist .= '<option value="' . ITEM_LOCKED . '"' . $forumlocked . '>' . $user->lang['Locked'] . "</option>\n";
|
$statuslist .= '<option value="' . ITEM_LOCKED . '"' . $forumlocked . '>' . $user->lang['Locked'] . "</option>\n";
|
||||||
|
@ -438,81 +446,35 @@ switch ($mode)
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2"><?php echo $user->lang['General_settings'] ?></th>
|
<th colspan="2"><?php echo $user->lang['General_settings'] ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td class="row1"><?php echo ($forum_status != ITEM_CATEGORY) ? $user->lang['Forum_name'] : $user->lang['Category_name'] ?></td>
|
|
||||||
<td class="row2"><input type="text" size="25" name="forum_name" value="<?php echo $forum_name ?>" class="post" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1"><?php echo $user->lang['Forum_desc'] ?></td>
|
|
||||||
<td class="row2"><textarea rows="5" cols="45" wrap="virtual" name="forum_desc" class="post"><?php echo $forum_desc ?></textarea></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if ($mode == 'add' || $forum_status == ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="row1"><?php echo $user->lang['Forum_type'] ?></td>
|
|
||||||
<td class="row2"><input type="radio" name="is_category" value="0" <?php echo $forum_checked ?>/><?php echo $user->lang['Forum'] ?> <input type="radio" name="is_category" value="1" <?php echo $category_checked ?>/><?php echo $user->lang['Category'] ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><?php echo $user->lang['Parent'] ?></td>
|
<td class="row1"><?php echo $user->lang['Parent'] ?></td>
|
||||||
<td class="row2"><select name="parent_id"><option value="0"><?php echo $user->lang['No_parent'] ?></option><?php echo $parents_list ?></select></td>
|
<td class="row2"><select name="parent_id"><option value="0"><?php echo $user->lang['No_parent'] ?></option><?php echo $parents_list ?></select></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><?php echo $user->lang['Style'] ?></td>
|
<td class="row1"><?php echo $user->lang['Forum_name']; ?></td>
|
||||||
<td class="row2"><select name="forum_style"><option value="0"><?php echo $user->lang['Default_style'] ?></option><?php echo $styles_list ?></select></td>
|
<td class="row2"><input class="post" type="text" size="25" name="forum_name" value="<?php echo $forum_name ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><?php echo $user->lang['Forum_desc'] ?></td>
|
||||||
|
<td class="row2"><textarea class="post" rows="5" cols="45" wrap="virtual" name="forum_desc"><?php echo $forum_desc ?></textarea></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><?php echo $user->lang['FORUM_TYPE'] ?></td>
|
||||||
|
<td class="row2"><input type="radio" name="is_postable" value="1" <?php echo $postable_checked ?>/><?php echo $user->lang['IS_POSTABLE'] ?> <input type="radio" name="is_postable" value="0" <?php echo $nonpostable_checked ?>/><?php echo $user->lang['NOT_POSTABLE'] ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2"><?php echo $user->lang['Forum_settings'] ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($forum_status != ITEM_CATEGORY)
|
if ($forum_postable || $mode == 'add')
|
||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2"><?php echo $user->lang['Forum_settings'] ?></th>
|
<td class="row1"><?php echo $user->lang['FORUM_STATUS'] ?></td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1"><?php echo $user->lang['Forum_status'] ?></td>
|
|
||||||
<td class="row2"><select name="forum_status"><?php echo $statuslist ?></select></td>
|
<td class="row2"><select name="forum_status"><?php echo $statuslist ?></select></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td class="row1"><?php echo $user->lang['Options'] ?></td>
|
|
||||||
<td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
|
||||||
<tr>
|
|
||||||
<td><input type="checkbox" name="disable_post_count"<?php echo ((!empty($post_count_inc)) ? ' ' : 'checked="checked" ') ?>/> <?php echo $user->lang['Disable_post_count'] ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><input type="checkbox" name="moderated"<?php echo ((!empty($moderated)) ? 'checked="checked" ' : ' ') ?>/> <?php echo $user->lang['Forum_is_moderated']; ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if ($mode == 'edit' && $parent_id > 0)
|
|
||||||
{
|
|
||||||
// if this forum is a subforum put the "display on index" checkbox
|
|
||||||
if ($parent_info = get_forum_info($parent_id))
|
|
||||||
{
|
|
||||||
if ($parent_info['parent_id'] > 0 || $parent_info['forum_status'] != ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td><input type="checkbox" name="display_on_index"<?php echo ((!empty($display_on_index)) ? 'checked="checked" ' : ' ') ?>/> <?php echo $user->lang['Display_on_index'] ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></table>
|
|
||||||
</tr>
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($mode == 'edit')
|
if ($mode == 'edit')
|
||||||
|
@ -520,10 +482,10 @@ switch ($mode)
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><?php echo $user->lang['Forum_type'] ?></td>
|
<td class="row1"><?php echo $user->lang['FORUM_TYPE'] ?></td>
|
||||||
<td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" name="set_category" /> <?php echo $user->lang['Set_as_category'] ?></td>
|
<td><input type="checkbox" name="set_nonpostable" /> <?php echo $user->lang['SET_NON_POSTABLE'] ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> <input type="radio" name="action" value="delete" checked="checked" /> <?php echo $user->lang['Delete_all_posts'] ?></td>
|
<td> <input type="radio" name="action" value="delete" checked="checked" /> <?php echo $user->lang['Delete_all_posts'] ?></td>
|
||||||
|
@ -538,6 +500,45 @@ switch ($mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><?php echo $user->lang['FORUM_STYLE'] ?></td>
|
||||||
|
<td class="row2"><select name="forum_style"><option value="0"><?php echo $user->lang['Default_style'] ?></option><?php echo $styles_list ?></select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><?php echo $user->lang['OPTIONS'] ?></td>
|
||||||
|
<td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" name="disable_post_count"<?php echo ((!empty($post_count_inc)) ? ' ' : 'checked="checked" ') ?>/> <?php echo $user->lang['DISABLE_POST_COUNT'] ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" name="topic_icons"<?php echo ((!empty($enable_icons)) ? 'checked="checked" ' : ' ') ?>/> <?php echo $user->lang['ENABLE_TOPIC_ICONS']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" name="moderated"<?php echo ((!empty($enable_moderate)) ? 'checked="checked" ' : ' ') ?>/> <?php echo $user->lang['FORUM_MODERATED']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if ($mode == 'edit' && $parent_id > 0)
|
||||||
|
{
|
||||||
|
// if this forum is a subforum put the "display on index" checkbox
|
||||||
|
if ($parent_info = get_forum_info($parent_id))
|
||||||
|
{
|
||||||
|
if ($parent_info['parent_id'] > 0 || !$parent_info['forum_postable'])
|
||||||
|
{
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" name="display_on_index"<?php echo ((!empty($display_on_index)) ? 'checked="checked" ' : ' ') ?>/> <?php echo $user->lang['Display_on_index'] ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</td></table>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><?php echo $user->lang['Forum_pruning'] ?></td>
|
<td class="row1"><?php echo $user->lang['Forum_pruning'] ?></td>
|
||||||
<td class="row2"><table cellspacing="0" cellpadding="1" border="0">
|
<td class="row2"><table cellspacing="0" cellpadding="1" border="0">
|
||||||
|
@ -558,21 +559,34 @@ switch ($mode)
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="2" align="center"><input type="hidden" name="mode" value="<?php echo $newmode ?>" /><input type="hidden" name="forum_id" value="<?php echo $forum_id ?>" /><input class="mainoption" type="submit" name="submit" value="<?php echo $buttonvalue ?>" /></td>
|
<td class="row1"><?php echo $user->lang['FORUM_IMAGE']; ?></td>
|
||||||
|
<td class="row2"><input class="post" type="text" size="25" name="forum_image" value="<?php echo $forum_image ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2" align="center"><input type="hidden" name="mode" value="<?php echo $newmode ?>" /><input type="hidden" name="f" value="<?php echo $forum_id ?>" /><input class="mainoption" type="submit" name="submit" value="<?php echo $buttonvalue ?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form>
|
</table></form>
|
||||||
|
|
||||||
<br clear="all" />
|
<br clear="all" />
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
page_footer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'delete':
|
case 'delete':
|
||||||
page_header($user->lang['Forum_delete']);
|
page_header($user->lang['Forum_delete']);
|
||||||
extract(get_forum_info($_GET['f']));
|
extract(get_forum_info(intval($_GET['this_f'])));
|
||||||
|
|
||||||
$subforums_id = array();
|
$subforums_id = array();
|
||||||
$subforums = get_forum_branch($forum_id, 'children');
|
$subforums = get_forum_branch($forum_id, 'children');
|
||||||
|
@ -589,18 +603,19 @@ switch ($mode)
|
||||||
|
|
||||||
<p><?php echo $user->lang['Forum_delete_explain'] ?></p>
|
<p><?php echo $user->lang['Forum_delete_explain'] ?></p>
|
||||||
|
|
||||||
<form action="admin_forums.<?php echo $phpEx . $SID ?>&mode=remove&f=<?php echo $forum_id ?>" method="post">
|
<form action="admin_forums.<?php echo $phpEx . $SID ?>&mode=remove&f=<?php echo $forum_id ?>" method="post"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||||
<table cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
|
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2" class="thHead"><?php echo $user->lang['Forum_delete'] ?></th>
|
<th colspan="2"><?php echo $user->lang['Forum_delete'] ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><?php echo ($forum_status == ITEM_CATEGORY) ? $user->lang['Category_name'] : $user->lang['Forum_name'] ?></td>
|
<td class="row1"><?php echo $user->lang['Forum_name']; ?></td>
|
||||||
<td class="row1"><span class="row1"><?php echo $forum_name ?></span></td>
|
<td class="row1"><span class="row1"><?php echo $forum_name ?></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
if ($forum_status != ITEM_CATEGORY)
|
|
||||||
|
if ($forum_postable)
|
||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><?php echo $user->lang['Action'] ?></td>
|
<td class="row1"><?php echo $user->lang['Action'] ?></td>
|
||||||
|
@ -611,9 +626,12 @@ switch ($mode)
|
||||||
<td class="row1"><input type="radio" name="action_posts" value="move" /> <?php echo $user->lang['Move_posts_to'] ?> <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 $user->lang['Move_posts_to'] ?> <select name="posts_to_id" ?><option value="0"></option><?php echo $move_posts_list ?></select></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($right_id - $left_id > 1)
|
if ($right_id - $left_id > 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><?php echo $user->lang['Action'] ?></td>
|
<td class="row1"><?php echo $user->lang['Action'] ?></td>
|
||||||
|
@ -624,7 +642,9 @@ switch ($mode)
|
||||||
<td class="row1"><input type="radio" name="action_subforums" value="move" /> <?php echo $user->lang['Move_subforums_to'] ?> <select name="subforums_to_id" ?><option value="0"></option><?php echo $forums_list ?></select></td>
|
<td class="row1"><input type="radio" name="action_subforums" value="move" /> <?php echo $user->lang['Move_subforums_to'] ?> <select name="subforums_to_id" ?><option value="0"></option><?php echo $forums_list ?></select></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['Move_and_Delete'] ?>" class="mainoption" /></td>
|
<td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['Move_and_Delete'] ?>" class="mainoption" /></td>
|
||||||
|
@ -633,22 +653,17 @@ switch ($mode)
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
page_footer();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
$show_index = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($show_index))
|
|
||||||
{
|
|
||||||
page_footer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Front end
|
||||||
page_header($user->lang['Manage']);
|
page_header($user->lang['Manage']);
|
||||||
|
|
||||||
$parent_id = (!empty($_GET['parent_id'])) ? $_GET['parent_id'] : 0;
|
$forum_id = (!empty($_GET['f'])) ? intval($_GET['f']) : 0;
|
||||||
|
|
||||||
if (!$parent_id)
|
if (!$forum_id)
|
||||||
{
|
{
|
||||||
$navigation = 'Forum Index';
|
$navigation = 'Forum Index';
|
||||||
}
|
}
|
||||||
|
@ -656,149 +671,94 @@ else
|
||||||
{
|
{
|
||||||
$navigation = '<a href="admin_forums.' . $phpEx . $SID . '">Forum Index</a>';
|
$navigation = '<a href="admin_forums.' . $phpEx . $SID . '">Forum Index</a>';
|
||||||
|
|
||||||
$forums_nav = get_forum_branch($parent_id, 'parents', 'descending');
|
$forums_nav = get_forum_branch($forum_id, 'parents', 'descending');
|
||||||
foreach ($forums_nav as $row)
|
foreach ($forums_nav as $row)
|
||||||
{
|
{
|
||||||
if ($row['forum_id'] == $parent_id)
|
if ($row['forum_id'] == $forum_id)
|
||||||
{
|
{
|
||||||
$navigation .= ' -> ' . htmlspecialchars($row['forum_name']);
|
$navigation .= ' -> ' . htmlspecialchars($row['forum_name']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$navigation .= ' -> <a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $row['forum_id'] . '">' . htmlspecialchars($row['forum_name']) . '</a>';
|
$navigation .= ' -> <a href="admin_forums.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '">' . htmlspecialchars($row['forum_name']) . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h1>Manage</h1>
|
|
||||||
|
|
||||||
<p>Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. In phpBB 2.2 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category).</p>
|
<h1><?php echo $user->lang['Manage']; ?></h1>
|
||||||
|
|
||||||
<?php echo $navigation ?><br />
|
<p><?php echo $user->lang['Forum_admin_explain']; ?></p>
|
||||||
<form method="post" action="<?php echo "admin_forums.$phpEx$SID&mode=add" ?>"><table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
|
|
||||||
|
<form method="post" action="<?php echo "admin_forums.$phpEx$SID&mode=add" ?>">
|
||||||
|
|
||||||
|
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="thHead" colspan="9"><?php echo $user->lang['Forum_admin'] ?></th>
|
<td><?php echo $navigation ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<th colspan="6"><?php echo $user->lang['Forum_admin'] ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$result = $db->sql_query('SELECT * FROM ' . FORUMS_TABLE . " WHERE parent_id = $parent_id ORDER BY left_id");
|
$result = $db->sql_query('SELECT * FROM ' . FORUMS_TABLE . " WHERE parent_id = $forum_id ORDER BY left_id");
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
//
|
$forum_id = $row['forum_id'];
|
||||||
|
$parent_id = $row['parent_id'];
|
||||||
$forum_title = htmlspecialchars($row['forum_name']);
|
$forum_title = htmlspecialchars($row['forum_name']);
|
||||||
$forum_desc = htmlspecialchars($row['forum_desc']);
|
$forum_desc = htmlspecialchars($row['forum_desc']);
|
||||||
$url = $phpEx . $SID . '&f=' . $row['forum_id'];
|
|
||||||
$subforums = ($row['right_id'] - $row['left_id'] - 1) / 2;
|
|
||||||
|
|
||||||
if ($row['forum_status'] != ITEM_CATEGORY)
|
if ($forum_status != ITEM_LOCKED)
|
||||||
{
|
{
|
||||||
$colspan = ' colspan="2"';
|
if ($row['left_id'] + 1 != $row['right_id'])
|
||||||
$forum_stats = '
|
|
||||||
<td class="row1" align="center" valign="middle"><span class="gen">' . $row['forum_topics'] . '</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle"><span class="gen">' . $row['forum_posts'] . '</span></td>
|
|
||||||
<td class="row3" align="center" valign="middle"><span class="gen">' . $subforums . '</span></td>
|
|
||||||
';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$colspan = ' colspan="4"';
|
|
||||||
$forum_stats = '
|
|
||||||
<td class="row3" align="center" valign="middle"><span class="gen">' . $subforums . '</span></td>
|
|
||||||
';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($row['left_id'] + 1 != $row['right_id'])
|
|
||||||
{
|
|
||||||
$forum_title = '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $row['forum_id'] . '">' . $forum_title . '</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($row['forum_status'] == ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="cat" colspan="5"><span class="cattitle"><b><?php echo $forum_title ?></b></span></td>
|
|
||||||
<td class="cat" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $user->lang['Edit'] ?></a></span></td>
|
|
||||||
<td class="cat" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['Delete'] ?></a></span></td>
|
|
||||||
<td class="cat" align="center" valign="middle" nowrap="nowrap"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_up'] ?></a> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_down'] ?></a></span></td>
|
|
||||||
<td class="cat" align="center" valign="middle"><span class="gen"> </span></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$sub_result = $db->sql_query('SELECT * FROM ' . FORUMS_TABLE . ' WHERE parent_id = ' . $row['forum_id'] . ' ORDER BY left_id');
|
|
||||||
while ($sub_row = $db->sql_fetchrow($sub_result))
|
|
||||||
{
|
{
|
||||||
$url = $phpEx . $SID . '&f=' . $sub_row['forum_id'];
|
$folder_image = '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['SUBFORUM'] . '" alt="' . $user->lang['SUBFORUM'] . '" />';
|
||||||
$forum_title = htmlspecialchars($sub_row['forum_name']);
|
}
|
||||||
$forum_desc = htmlspecialchars($sub_row['forum_desc']);
|
else
|
||||||
$subforums = ($sub_row['right_id'] - $sub_row['left_id'] - 1) / 2;
|
{
|
||||||
|
$folder_image = '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['SUBFORUM'] . '" alt="' . $user->lang['FOLDER'] . '" />';
|
||||||
if ($sub_row['forum_status'] != ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
$colspan = '';
|
|
||||||
$forum_stats = '
|
|
||||||
<td class="row1" align="center" valign="middle"><span class="gen">' . $sub_row['forum_topics'] . '</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle"><span class="gen">' . $sub_row['forum_posts'] . '</span></td>
|
|
||||||
<td class="row3" align="center" valign="middle"><span class="gen">' . $subforums . '</span></td>
|
|
||||||
';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$colspan = ' colspan="3"';
|
|
||||||
$forum_stats = '
|
|
||||||
<td class="row3" align="center" valign="middle"><span class="gen">' . $subforums . '</span></td>
|
|
||||||
';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sub_row['left_id'] + 1 != $sub_row['right_id'])
|
|
||||||
{
|
|
||||||
$forum_title = '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $sub_row['forum_id'] . '">' . $forum_title . '</a>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<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 $user->lang['Edit'] ?></a></span></td>
|
|
||||||
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['Delete'] ?></a></span></td>
|
|
||||||
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_up'] ?></a> <br /> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_down'] ?></a></span></td>
|
|
||||||
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=resync&parent_id=<?php echo $parent_id ?>"><?php echo ($sub_row['forum_status'] != ITEM_CATEGORY) ? $user->lang['Resync'] : ' ' ?></a></span></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<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 $user->lang['Create_forum'] ?>" /></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$folder_image = '<img src="images/icon_folder_lock.gif" width=""46 height="25" alt="' . $user->lang['SUBFORUM'] . '" alt="' . $user->lang['LOCKED'] . '" />';
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = $phpEx . $SID . '&this_f=' . $row['forum_id'];
|
||||||
|
|
||||||
|
$forum_title = '<a href="admin_forums.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '">' . $forum_title . '</a>';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<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>
|
<td class="row1" width="5%"><?php echo $folder_image; ?></td>
|
||||||
<?php echo $forum_stats ?>
|
<td class="row2" width="50%"><span class="gen"><?php echo $forum_title ?></span><br /><span class="gensmall"><?php echo $forum_desc ?></span></td>
|
||||||
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $user->lang['Edit'] ?></a></span></td>
|
|
||||||
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['Delete'] ?></a></span></td>
|
<td class="row1" width="5%" align="center" valign="middle" title="<?php echo $user->lang['TOPICS']; ?>"><span class="gen"><?php echo $row['forum_topics'] ?></span></td>
|
||||||
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_up'] ?></a> <br /> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_down'] ?></a></span></td>
|
<td class="row2" width="5%" align="center" valign="middle" title="<?php echo $user->lang['POSTS']; ?>"><span class="gen"><?php echo $row['forum_posts'] ?></span></td>
|
||||||
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=resync&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Resync'] ?></a></span></td>
|
|
||||||
|
<td class="row2" width="15%" align="center" valign="middle" nowrap="nowrap"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up"><?php echo $user->lang['Move_up'] ?></a> <br /> <a href="admin_forums.<?php echo $url ?>&mode=move_down"><?php echo $user->lang['Move_down'] ?></a></span></td>
|
||||||
|
|
||||||
|
<td class="row2" width="20%" align="center" valign="middle" nowrap="nowrap"> <span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $user->lang['Edit'] ?></a> | <a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['Delete'] ?></a> | <a href="admin_forums.<?php echo $url ?>&mode=sync"><?php echo $user->lang['Resync'] ?></a></span> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="100%" colspan="9" class="cat"><input type="text" name="forum_name[<? echo $parent_id ?>]" /> <input type="submit" class="liteoption" name="parent_id[<? echo $parent_id ?>]" value="<?php echo $user->lang['Create_forum'] ?>" /></td>
|
<td width="100%" colspan="6" class="cat"><input type="text" name="forum_name[<? echo $forum_id ?>]" /> <input type="submit" class="liteoption" name="parent_id[<? echo $forum_id ?>]" value="<?php echo $user->lang['Create_forum'] ?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form>
|
</table></form>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
page_footer();
|
page_footer();
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -812,31 +772,34 @@ page_footer();
|
||||||
function get_forum_info($forum_id)
|
function get_forum_info($forum_id)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . FORUMS_TABLE . "
|
FROM ' . FORUMS_TABLE . "
|
||||||
WHERE forum_id = $forum_id";
|
WHERE forum_id = $forum_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if (!$row = $db->sql_fetchrow($result))
|
if (!$row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
message_die(ERROR, "Forum #$forum_id does not exist");
|
trigger_error("Forum #$forum_id does not exist", E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_forums_list($mode='all', $selected_id=0, $exclude_id=array())
|
function make_forums_list($mode = 'all', $selected_id = 0, $exclude_id = array())
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
if (!is_array($exclude_id))
|
if (!is_array($exclude_id))
|
||||||
{
|
{
|
||||||
$exclude_id = array($exclude_id);
|
$exclude_id = array($exclude_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT f2.*
|
$sql = 'SELECT f2.*
|
||||||
FROM ' . FORUMS_TABLE . ' f1, ' . FORUMS_TABLE . ' f2
|
FROM ' . FORUMS_TABLE . ' f1, ' . FORUMS_TABLE . ' f2
|
||||||
WHERE f1.parent_id = 0
|
WHERE f1.parent_id = 0
|
||||||
AND f2.left_id BETWEEN f1.left_id AND f1.right_id
|
AND f2.left_id BETWEEN f1.left_id AND f1.right_id
|
||||||
ORDER BY f2.left_id';
|
ORDER BY f2.left_id';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$list = '';
|
$list = '';
|
||||||
|
@ -859,9 +822,9 @@ function make_forums_list($mode='all', $selected_id=0, $exclude_id=array())
|
||||||
$current_indent = $indent[$row['parent_id']];
|
$current_indent = $indent[$row['parent_id']];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($mode == 'forums' && $row['forum_status'] == ITEM_CATEGORY)
|
if (($mode == 'forums' && !$row['forum_postable'])
|
||||||
|| ($mode == 'categories' && $row['forum_status'] != ITEM_CATEGORY)
|
|| ($mode == 'categories' && $row['forum_postable'])
|
||||||
|| (in_array($row['forum_id'], $exclude_id)))
|
|| (in_array($row['forum_id'], $exclude_id)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -879,7 +842,7 @@ function make_forums_list($mode='all', $selected_id=0, $exclude_id=array())
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_styles_list($selected_id=0)
|
function make_styles_list($selected_id = 0)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -907,17 +870,13 @@ function move_forum($from_id, $to_id)
|
||||||
$moved_ids[] = $moved_forums[$i]['forum_id'];
|
$moved_ids[] = $moved_forums[$i]['forum_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Resync parents
|
// Resync parents
|
||||||
//
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||||
SET right_id = right_id - $diff, forum_parents = ''
|
SET right_id = right_id - $diff, forum_parents = ''
|
||||||
WHERE left_id < " . $from_data['right_id'] . " AND right_id > " . $from_data['right_id'];
|
WHERE left_id < " . $from_data['right_id'] . " AND right_id > " . $from_data['right_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
//
|
|
||||||
// Resync righthand side of tree
|
// Resync righthand side of tree
|
||||||
//
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||||
SET left_id = left_id - $diff, right_id = right_id - $diff, forum_parents = ''
|
SET left_id = left_id - $diff, right_id = right_id - $diff, forum_parents = ''
|
||||||
WHERE left_id > " . $from_data['right_id'];
|
WHERE left_id > " . $from_data['right_id'];
|
||||||
|
@ -927,27 +886,21 @@ function move_forum($from_id, $to_id)
|
||||||
{
|
{
|
||||||
$to_data = get_forum_info($to_id);
|
$to_data = get_forum_info($to_id);
|
||||||
|
|
||||||
//
|
|
||||||
// Resync new parents
|
// Resync new parents
|
||||||
//
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||||
SET right_id = right_id + $diff, forum_parents = ''
|
SET right_id = right_id + $diff, forum_parents = ''
|
||||||
WHERE " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
|
WHERE " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
|
||||||
AND forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
|
AND forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
//
|
|
||||||
// Resync the righthand side of the tree
|
// Resync the righthand side of the tree
|
||||||
//
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||||
SET left_id = left_id + $diff, right_id = right_id + $diff, forum_parents = ''
|
SET left_id = left_id + $diff, right_id = right_id + $diff, forum_parents = ''
|
||||||
WHERE left_id > " . $to_data['right_id'] . '
|
WHERE left_id > " . $to_data['right_id'] . '
|
||||||
AND forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
|
AND forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
//
|
|
||||||
// Resync moved branch
|
// Resync moved branch
|
||||||
//
|
|
||||||
$to_data['right_id'] += $diff;
|
$to_data['right_id'] += $diff;
|
||||||
if ($to_data['right_id'] > $from_data['right_id'])
|
if ($to_data['right_id'] > $from_data['right_id'])
|
||||||
{
|
{
|
||||||
|
@ -977,7 +930,7 @@ function move_forum_content($from_id, $to_id)
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$db->sql_query('UPDATE ' . ACL_GROUPS_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
$db->sql_query('UPDATE ' . ACL_GROUPS_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
||||||
$db->sql_query('UPDATE ' . ACL_PREFETCH_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
$db->sql_query('UPDATE ' . MODERATOR_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
||||||
$db->sql_query('UPDATE ' . LOG_MOD_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
$db->sql_query('UPDATE ' . LOG_MOD_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
||||||
$db->sql_query('UPDATE ' . POSTS_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
$db->sql_query('UPDATE ' . POSTS_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
||||||
$db->sql_query('UPDATE ' . TOPICS_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
$db->sql_query('UPDATE ' . TOPICS_TABLE . " SET forum_id = $to_id WHERE forum_id = $from_id");
|
||||||
|
@ -986,9 +939,9 @@ function move_forum_content($from_id, $to_id)
|
||||||
// TODO: untested yet
|
// TODO: untested yet
|
||||||
//
|
//
|
||||||
$sql = 'SELECT t1.topic_id
|
$sql = 'SELECT t1.topic_id
|
||||||
FROM ' .TOPICS_TABLE . ' t1
|
FROM ' .TOPICS_TABLE . ' t1
|
||||||
LEFT JOIN ' . TOPICS_TABLE . " t2 ON t1.topic_moved_id = t2.topic_id AND t1.forum_id = t2.forum_id
|
LEFT JOIN ' . TOPICS_TABLE . " t2 ON t1.topic_moved_id = t2.topic_id AND t1.forum_id = t2.forum_id
|
||||||
WHERE t1.forum_id = $to_id";
|
WHERE t1.forum_id = $to_id";
|
||||||
$result = $db->sql_query($result);
|
$result = $db->sql_query($result);
|
||||||
|
|
||||||
$topic_ids = array();
|
$topic_ids = array();
|
||||||
|
@ -1013,12 +966,13 @@ function delete_forum_content($forum_id)
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$db->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . " WHERE forum_id = $forum_id");
|
$db->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . " WHERE forum_id = $forum_id");
|
||||||
$db->sql_query('DELETE FROM ' . ACL_PREFETCH_TABLE . " WHERE forum_id = $forum_id");
|
$db->sql_query('DELETE FROM ' . MODERATOR_TABLE . " WHERE forum_id = $forum_id");
|
||||||
$db->sql_query('DELETE FROM ' . LOG_MOD_TABLE . " WHERE forum_id = $forum_id");
|
$db->sql_query('DELETE FROM ' . LOG_MOD_TABLE . " WHERE forum_id = $forum_id");
|
||||||
$db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . " WHERE forum_id = $forum_id");
|
$db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . " WHERE forum_id = $forum_id");
|
||||||
|
|
||||||
$ids = array();
|
$ids = array();
|
||||||
$result = $db->sql_query('SELECT post_id FROM ' . POSTS_TABLE . " WHERE forum_id = $forum_id");
|
$result = $db->sql_query('SELECT post_id FROM ' . POSTS_TABLE . " WHERE forum_id = $forum_id");
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$ids[] = $row['post_id'];
|
$ids[] = $row['post_id'];
|
||||||
|
@ -1035,6 +989,7 @@ function delete_forum_content($forum_id)
|
||||||
|
|
||||||
$ids = array();
|
$ids = array();
|
||||||
$result = $db->sql_query('SELECT topic_id FROM ' . TOPICS_TABLE . " WHERE forum_id = $forum_id");
|
$result = $db->sql_query('SELECT topic_id FROM ' . TOPICS_TABLE . " WHERE forum_id = $forum_id");
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$ids[] = $row['topic_id'];
|
$ids[] = $row['topic_id'];
|
||||||
|
@ -1044,7 +999,6 @@ function delete_forum_content($forum_id)
|
||||||
|
|
||||||
if ($ids)
|
if ($ids)
|
||||||
{
|
{
|
||||||
$db->sql_query('DELETE FROM ' . TOPICS_RATING_TABLE . " WHERE topic_id IN ($ids)");
|
|
||||||
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . " WHERE topic_id IN ($ids)");
|
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . " WHERE topic_id IN ($ids)");
|
||||||
$db->sql_query('DELETE FROM ' . TOPICS_TABLE . " WHERE forum_id = $forum_id");
|
$db->sql_query('DELETE FROM ' . TOPICS_TABLE . " WHERE forum_id = $forum_id");
|
||||||
$db->sql_query('DELETE FROM ' . TOPICS_TABLE . " WHERE topic_moved_id IN ($ids)");
|
$db->sql_query('DELETE FROM ' . TOPICS_TABLE . " WHERE topic_moved_id IN ($ids)");
|
||||||
|
|
|
@ -675,12 +675,12 @@ function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$website, &$loca
|
||||||
// contains at least one dot.
|
// contains at least one dot.
|
||||||
if ($website != '')
|
if ($website != '')
|
||||||
{
|
{
|
||||||
if (!preg_match('#^http:\/\/#i', $website))
|
if (!preg_match('#^http[s]?:\/\/#i', $website))
|
||||||
{
|
{
|
||||||
$website = 'http://' . $website;
|
$website = 'http://' . $website;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $website))
|
if (!preg_match('#^http[s]?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $website))
|
||||||
{
|
{
|
||||||
$website = '';
|
$website = '';
|
||||||
}
|
}
|
||||||
|
@ -801,7 +801,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||||
// This is a hack just to show something useful.
|
// This is a hack just to show something useful.
|
||||||
// $msg_text won't contain anything if $user isn't there yet.
|
// $msg_text won't contain anything if $user isn't there yet.
|
||||||
// I ran into this problem when installing without makeing config_cache.php writable
|
// I ran into this problem when installing without makeing config_cache.php writable
|
||||||
if ( !class_exists($user) )
|
if (!isset($user))
|
||||||
{
|
{
|
||||||
die("Unable to show notice, \$user class hasn't been instantiated yet.<br />Error triggered in: " . $errfile .":". $errline);
|
die("Unable to show notice, \$user class hasn't been instantiated yet.<br />Error triggered in: " . $errfile .":". $errline);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ CREATE TABLE phpbb_disallow (
|
||||||
# Table structure for table 'phpbb_forums'
|
# Table structure for table 'phpbb_forums'
|
||||||
#
|
#
|
||||||
CREATE TABLE phpbb_forums (
|
CREATE TABLE phpbb_forums (
|
||||||
forum_id smallint(5) UNSIGNED NOT NULL,
|
forum_id smallint(5) UNSIGNED NOT NULL auto_increment,
|
||||||
parent_id smallint(5) UNSIGNED NOT NULL,
|
parent_id smallint(5) UNSIGNED NOT NULL,
|
||||||
left_id smallint(5) UNSIGNED NOT NULL,
|
left_id smallint(5) UNSIGNED NOT NULL,
|
||||||
right_id smallint(5) UNSIGNED NOT NULL,
|
right_id smallint(5) UNSIGNED NOT NULL,
|
||||||
|
@ -127,9 +127,10 @@ CREATE TABLE phpbb_forums (
|
||||||
forum_last_post_time int(11) DEFAULT '0' NOT NULL,
|
forum_last_post_time int(11) DEFAULT '0' NOT NULL,
|
||||||
forum_last_poster_name varchar(30),
|
forum_last_poster_name varchar(30),
|
||||||
display_on_index tinyint(1) DEFAULT '1' NOT NULL,
|
display_on_index tinyint(1) DEFAULT '1' NOT NULL,
|
||||||
post_count_inc tinyint(1) DEFAULT '1' NOT NULL,
|
enable_post_count tinyint(1) DEFAULT '1' NOT NULL,
|
||||||
moderated tinyint(1) DEFAULT '0' NOT NULL,
|
enable_moderate tinyint(1) DEFAULT '0' NOT NULL,
|
||||||
prune_enable tinyint(1) DEFAULT '0' NOT NULL,
|
enable_icons tinyint(1) DEFAULT '1' NOT NULL,
|
||||||
|
enable_prune tinyint(1) DEFAULT '0' NOT NULL,
|
||||||
prune_next int(11) UNSIGNED,
|
prune_next int(11) UNSIGNED,
|
||||||
prune_days tinyint(4) UNSIGNED NOT NULL,
|
prune_days tinyint(4) UNSIGNED NOT NULL,
|
||||||
prune_freq tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
prune_freq tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||||
|
|
|
@ -426,8 +426,8 @@ $lang = array_merge($lang, array(
|
||||||
'Max_sig_length' => 'Maximum signature length',
|
'Max_sig_length' => 'Maximum signature length',
|
||||||
'Max_sig_length_explain' => 'Maximum number of characters in user signatures',
|
'Max_sig_length_explain' => 'Maximum number of characters in user signatures',
|
||||||
'Allow_name_change' => 'Allow Username changes',
|
'Allow_name_change' => 'Allow Username changes',
|
||||||
'Forum_admin' => 'Forum Administration',
|
|
||||||
'Forum_admin_explain' => 'From this panel you can add, delete, edit, re-order and re-synchronise categories and forums',
|
'Forum_admin_explain' => 'In phpBB 2.2 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum.',
|
||||||
'Edit_forum' => 'Edit forum',
|
'Edit_forum' => 'Edit forum',
|
||||||
'Edit_category' => 'Edit category',
|
'Edit_category' => 'Edit category',
|
||||||
'Create_forum' => 'Create new forum',
|
'Create_forum' => 'Create new forum',
|
||||||
|
@ -436,27 +436,32 @@ $lang = array_merge($lang, array(
|
||||||
'Edit' => 'Edit',
|
'Edit' => 'Edit',
|
||||||
'Move_up' => 'Move up',
|
'Move_up' => 'Move up',
|
||||||
'Move_down' => 'Move down',
|
'Move_down' => 'Move down',
|
||||||
'Resync' => 'Resync',
|
'Resync' => 'Sync',
|
||||||
'Category_name' => 'Category name',
|
'Category_name' => 'Category name',
|
||||||
'Forum_type' => 'Forum type',
|
'FORUM_TYPE' => 'Forum Type',
|
||||||
|
'FORUM_STATUS' => 'Forum Status',
|
||||||
|
'FORUM_STYLE' => 'Forum Style',
|
||||||
|
'FORUM_IMAGE' => 'Forum Image',
|
||||||
'Parent' => 'Parent',
|
'Parent' => 'Parent',
|
||||||
'No_parent' => 'No parent',
|
'No_parent' => 'No parent',
|
||||||
'Locked' => 'Locked',
|
'Locked' => 'Locked',
|
||||||
'Unlocked' => 'Unlocked',
|
'Unlocked' => 'Unlocked',
|
||||||
'General_settings' => 'General settings',
|
'General_settings' => 'General settings',
|
||||||
'Forum_settings' => 'Forum settings',
|
'Forum_settings' => 'Forum settings',
|
||||||
'Disable_post_count' => 'Disable post count',
|
'IS_POSTABLE' => 'Can Post',
|
||||||
'Forum_is_moderated' => 'Moderated forum',
|
'NOT_POSTABLE' => 'Cannot Post',
|
||||||
'Display_on_index' => 'Display a link to this forum on index',
|
'ENABLE_TOPIC_ICONS' => 'Enable topic icons',
|
||||||
|
'DISABLE_POST_COUNT' => 'Disable user post count incrementing',
|
||||||
|
'FORUM_MODERATED' => 'Enable moderation queue',
|
||||||
|
'Display_on_index' => 'Display link to forum on index',
|
||||||
'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',
|
'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',
|
||||||
'Forum_general' => 'General Forum Settings',
|
'Forum_general' => 'General Forum Settings',
|
||||||
'Forum_name' => 'Forum name',
|
'Forum_name' => 'Forum name',
|
||||||
'Forum_desc' => 'Description',
|
'Forum_desc' => 'Description',
|
||||||
'Forum_status' => 'Forum status',
|
|
||||||
'Forum_pruning' => 'Auto-pruning',
|
'Forum_pruning' => 'Auto-pruning',
|
||||||
'prune_freq' => 'Check for topic age every',
|
'prune_freq' => 'Check for topic age every',
|
||||||
'prune_days' => 'Remove topics that have not been posted to in',
|
'prune_days' => 'Remove topics that have not been posted to in',
|
||||||
'Set_as_category' => 'Set this forum as a category and',
|
'SET_NON_POSTABLE' => 'Set this forum as non-postable and',
|
||||||
'Forum_delete' => 'Delete Forum',
|
'Forum_delete' => 'Delete Forum',
|
||||||
'Update' => 'Update',
|
'Update' => 'Update',
|
||||||
'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.',
|
'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.',
|
||||||
|
@ -469,6 +474,7 @@ $lang = array_merge($lang, array(
|
||||||
'Forums_updated' => 'Forum and Category information updated successfully',
|
'Forums_updated' => 'Forum and Category information updated successfully',
|
||||||
'Forum_deleted' => 'Forum successfully deleted',
|
'Forum_deleted' => 'Forum successfully deleted',
|
||||||
'Click_return_forumadmin' => 'Click %sHere%s to return to Forum Administration',
|
'Click_return_forumadmin' => 'Click %sHere%s to return to Forum Administration',
|
||||||
|
|
||||||
'Emoticons_explain' => 'From this page you can add, remove and edit the emoticons or emoticons users can use in their posts and private messages.',
|
'Emoticons_explain' => 'From this page you can add, remove and edit the emoticons or emoticons users can use in their posts and private messages.',
|
||||||
'Import_smilies' => 'Import emoticons pak',
|
'Import_smilies' => 'Import emoticons pak',
|
||||||
'Import_smilies_explain' => 'Unzip the emoticons package to your emoticons directory then select the correct information in this form to import it.',
|
'Import_smilies_explain' => 'Unzip the emoticons package to your emoticons directory then select the correct information in this form to import it.',
|
||||||
|
|
|
@ -68,7 +68,7 @@ switch ($mode)
|
||||||
trigger_error($user->lang['No_forum_id']);
|
trigger_error($user->lang['No_forum_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT forum_id, forum_name, forum_parents, forum_status, forum_postable, post_count_inc
|
$sql = 'SELECT forum_id, forum_name, forum_parents, forum_status, forum_postable, enable_icons, enable_post_count, enable_moderate
|
||||||
FROM ' . FORUMS_TABLE . '
|
FROM ' . FORUMS_TABLE . '
|
||||||
WHERE forum_id = ' . intval($f);
|
WHERE forum_id = ' . intval($f);
|
||||||
break;
|
break;
|
||||||
|
@ -79,7 +79,7 @@ switch ($mode)
|
||||||
trigger_error($user->lang['No_topic_id']);
|
trigger_error($user->lang['No_topic_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT t.*, f.forum_name, f.forum_parents, f.forum_status, f.forum_postable, f.post_count_inc
|
$sql = 'SELECT t.*, f.forum_name, f.forum_parents, f.forum_status, f.forum_postable, f.enable_icons, f.enable_post_count, f.enable_moderate
|
||||||
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
|
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
|
||||||
WHERE t.topic_id = ' . intval($t) . '
|
WHERE t.topic_id = ' . intval($t) . '
|
||||||
AND f.forum_id = t.forum_id';
|
AND f.forum_id = t.forum_id';
|
||||||
|
@ -93,7 +93,7 @@ switch ($mode)
|
||||||
trigger_error($user->lang['No_post_id']);
|
trigger_error($user->lang['No_post_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT t.*, p.*, pt.*, f.forum_name, f.forum_parents, f.forum_status, f.forum_postable, f.post_count_inc
|
$sql = 'SELECT t.*, p.*, pt.*, f.forum_name, f.forum_parents, f.forum_status, f.forum_postable, f.enable_icons, f.enable_post_count, f.enable_moderate
|
||||||
FROM ' . POSTS_TABLE . ' p, ' . POSTS_TEXT_TABLE . ' pt, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
|
FROM ' . POSTS_TABLE . ' p, ' . POSTS_TEXT_TABLE . ' pt, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
|
||||||
WHERE p.post_id = ' . intval($p) . '
|
WHERE p.post_id = ' . intval($p) . '
|
||||||
AND t.topic_id = p.topic_id
|
AND t.topic_id = p.topic_id
|
||||||
|
@ -230,7 +230,7 @@ if (isset($post))
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
if (intval($row['last_post_time']) && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval']))
|
if (intval($row['last_post_time']) && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval']) && !$auth->acl_gets('f_ignoreflood', 'm_', 'a_', intval($forum_id)))
|
||||||
{
|
{
|
||||||
$err_msg .= ((!empty($err_msg)) ? '<br />' : '') . $user->lang['FLOOD_ERROR'];
|
$err_msg .= ((!empty($err_msg)) ? '<br />' : '') . $user->lang['FLOOD_ERROR'];
|
||||||
}
|
}
|
||||||
|
@ -315,9 +315,9 @@ if (isset($post))
|
||||||
'topic_title' => $subject,
|
'topic_title' => $subject,
|
||||||
'topic_poster' => intval($user->data['user_id']),
|
'topic_poster' => intval($user->data['user_id']),
|
||||||
'topic_time' => $current_time,
|
'topic_time' => $current_time,
|
||||||
'topic_type' => intval($topic_type),
|
'topic_type' => (!empty($enable_icons)) ? intval($topic_type) : 0,
|
||||||
'topic_icon' => intval($icon),
|
'topic_icon' => intval($icon),
|
||||||
'topic_approved'=> (!empty($forum_moderated) && !$auth->acl_gets('m_', 'a_', intval($forum_id))) ? 0 : 1,
|
'topic_approved'=> (!empty($enable_moderate) && !$auth->acl_gets('f_ignorequeue', 'm_', 'a_', intval($forum_id))) ? 0 : 1,
|
||||||
);
|
);
|
||||||
if (!empty($poll_options))
|
if (!empty($poll_options))
|
||||||
{
|
{
|
||||||
|
@ -341,7 +341,7 @@ if (isset($post))
|
||||||
'post_username' => ($username != '') ? $username : '',
|
'post_username' => ($username != '') ? $username : '',
|
||||||
'poster_ip' => $user->ip,
|
'poster_ip' => $user->ip,
|
||||||
'post_time' => $current_time,
|
'post_time' => $current_time,
|
||||||
'post_approved' => (!empty($forum_moderated) && !$auth->acl_gets('m_', 'a_', intval($forum_id))) ? 0 : 1,
|
'post_approved' => (!empty($enable_moderate) && !$auth->acl_gets('f_ignorequeue', 'm_', 'a_', intval($forum_id))) ? 0 : 1,
|
||||||
'post_edit_time' => ($mode == 'edit' && $poster_id == $user->data['user_id']) ? $current_time : 0,
|
'post_edit_time' => ($mode == 'edit' && $poster_id == $user->data['user_id']) ? $current_time : 0,
|
||||||
'enable_sig' => $enable_html,
|
'enable_sig' => $enable_html,
|
||||||
'enable_bbcode' => $enable_bbcode,
|
'enable_bbcode' => $enable_bbcode,
|
||||||
|
@ -457,7 +457,7 @@ if (isset($post))
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
// Update user post count ... if appropriate
|
// Update user post count ... if appropriate
|
||||||
if (!empty($post_count_inc) && $user->data['user_id'] != ANONYMOUS)
|
if (!empty($enable_post_count) && $user->data['user_id'] != ANONYMOUS)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
SET user_posts = user_posts + 1
|
SET user_posts = user_posts + 1
|
||||||
|
@ -501,7 +501,7 @@ if (isset($post))
|
||||||
'META' => '<meta http-equiv="refresh" content="5; url=' . "viewtopic.$phpEx$SID&f=$forum_id&p=$post_id#$post_id" . '">')
|
'META' => '<meta http-equiv="refresh" content="5; url=' . "viewtopic.$phpEx$SID&f=$forum_id&p=$post_id#$post_id" . '">')
|
||||||
);
|
);
|
||||||
|
|
||||||
$message = (!empty($forum_moderated)) ? 'POST_STORED_MOD' : 'POST_STORED';
|
$message = (!empty($enable_moderate)) ? 'POST_STORED_MOD' : 'POST_STORED';
|
||||||
trigger_error($user->lang[$message]);
|
trigger_error($user->lang[$message]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,28 +563,31 @@ get_moderators($moderators, intval($forum_id));
|
||||||
generate_smilies('inline');
|
generate_smilies('inline');
|
||||||
|
|
||||||
// Topic icons
|
// Topic icons
|
||||||
$sql = "SELECT *
|
|
||||||
FROM " . ICONS_TABLE . "
|
|
||||||
WHERE icons_id > 1";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$s_topic_icons = false;
|
$s_topic_icons = false;
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if (!empty($enable_icons))
|
||||||
{
|
{
|
||||||
$s_topic_icons = true;
|
$sql = "SELECT *
|
||||||
|
FROM " . ICONS_TABLE . "
|
||||||
|
WHERE icons_id > 1";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
do
|
if ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('topic_icon', array(
|
$s_topic_icons = true;
|
||||||
'ICON_ID' => $row['icons_id'],
|
|
||||||
'ICON_IMG' => $config['icons_path'] . '/' . $row['icons_url'],
|
|
||||||
'ICON_WIDTH' => $row['icons_width'],
|
|
||||||
'ICON_HEIGHT' => $row['icons_height'],
|
|
||||||
|
|
||||||
'S_ICON_CHECKED' => ($row['icons_id'] == $topic_icon) ? ' checked="checked"' : '')
|
do
|
||||||
);
|
{
|
||||||
|
$template->assign_block_vars('topic_icon', array(
|
||||||
|
'ICON_ID' => $row['icons_id'],
|
||||||
|
'ICON_IMG' => $config['icons_path'] . '/' . $row['icons_url'],
|
||||||
|
'ICON_WIDTH' => $row['icons_width'],
|
||||||
|
'ICON_HEIGHT' => $row['icons_height'],
|
||||||
|
|
||||||
|
'S_ICON_CHECKED' => ($row['icons_id'] == $topic_icon) ? ' checked="checked"' : '')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
while ($row = $db->sql_fetchrow($result));
|
||||||
}
|
}
|
||||||
while ($row = $db->sql_fetchrow($result));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Topic type selection ... only for first post in topic?
|
// Topic type selection ... only for first post in topic?
|
||||||
|
|
Loading…
Add table
Reference in a new issue