mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
- forum rules + link to forum rules
- three new (tiny) functions added to functions_posting responsible for handling text with bbcode/smilies/urls, use them at items all over across phpbb... - some bugfixes within admin_forums and other files - new admin_board layout (much safer, security wise) git-svn-id: file:///svn/phpbb/trunk@4903 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ae93b82e19
commit
6aa42b69ab
27 changed files with 807 additions and 866 deletions
|
@ -904,27 +904,27 @@ if ($mode == 'ext_groups')
|
|||
<th colspan="2"><?php echo $user->lang[strtoupper($action) . '_EXTENSION_GROUP']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['GROUP_NAME']; ?></b>:</td>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['GROUP_NAME']; ?>: </b></td>
|
||||
<td class="row2"><input type="text" size="20" maxlength="100" name="group_name" class="post" value="<?php echo $group_name; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['SPECIAL_CATEGORY']; ?></b>:</td>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['SPECIAL_CATEGORY']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SPECIAL_CATEGORY_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><?php echo category_select('special_category', $group_id); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['ALLOWED']; ?></b>:</td>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['ALLOWED']; ?>: </b></td>
|
||||
<td class="row2"><input type="checkbox" name="allow_group" value="<?php echo $group_id; ?>"<?php echo $s_allowed; ?> /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['ALLOW_IN_PM']; ?></b>:</td>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['ALLOW_IN_PM']; ?>: </b></td>
|
||||
<td class="row2"><input type="checkbox" name="allow_in_pm" value="1"<?php echo $s_in_pm_allowed; ?> /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['DOWNLOAD_MODE']; ?></b>:</td>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['DOWNLOAD_MODE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DOWNLOAD_MODE_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><?php echo download_select('download_mode', $group_id); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['UPLOAD_ICON']; ?></b>:</td>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['UPLOAD_ICON']; ?>: </b></td>
|
||||
<td class="row2" align="left">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
|
@ -935,11 +935,11 @@ if ($mode == 'ext_groups')
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['MAX_EXTGROUP_FILESIZE']; ?></b>:</td>
|
||||
<td class="row1" width="35%"><b><?php echo $user->lang['MAX_EXTGROUP_FILESIZE']; ?>: </b></td>
|
||||
<td class="row2"><input type="text" size="3" maxlength="15" name="max_filesize" class="post" value="<?php echo $max_filesize; ?>" /> <?php echo size_select('size_select', $size_format); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="35%" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td colspan="2"><b><?php echo $user->lang['ASSIGNED_EXTENSIONS']; ?></b>:</td></tr>
|
||||
<td class="row1" width="35%" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td colspan="2"><b><?php echo $user->lang['ASSIGNED_EXTENSIONS']; ?>: </b></td></tr>
|
||||
<tr><td class="row1" width="20"> » </td>
|
||||
<td class="row1"><div id="ext" style="margin:0px; width:200px"> <?php
|
||||
$i = 0;
|
||||
|
@ -951,7 +951,8 @@ if ($mode == 'ext_groups')
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
?></div></td></tr></table>
|
||||
?></div></td></tr>
|
||||
<tr><td class="row1"> </td><td class="row1"><br />[ <a href="admin_attachments.<?php echo $phpEx.$SID . '&mode=extensions'; ?>"><?php echo $user->lang['GO_TO_EXTENSIONS']; ?></a> ]</td></tr></table>
|
||||
</td>
|
||||
<td class="row2"><select name="extensions[]" onChange="show_extensions(this);" multiple="true" size="8" style="width:100px">
|
||||
<?php
|
||||
|
@ -963,7 +964,7 @@ if ($mode == 'ext_groups')
|
|||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" valign="top"><b><?php echo $user->lang['ALLOWED_FORUMS']; ?></b>:<br /><span class="gensmall"><?php echo $user->lang['ALLOWED_FORUMS_EXPLAIN']; ?></span></td>
|
||||
<td class="row1" valign="top"><b><?php echo $user->lang['ALLOWED_FORUMS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ALLOWED_FORUMS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="forum_select" value="0"<?php echo (!sizeof($forum_ids)) ? ' checked="checked"' : ''; ?> /> <?php echo $user->lang['ALLOW_ALL_FORUMS']; ?> <input type="radio" name="forum_select" value="1"<?php echo (sizeof($forum_ids)) ? ' checked="checked"' : ''; ?> /> <?php echo $user->lang['ALLOW_SELECTED_FORUMS']; ?><br /><br />
|
||||
<select name="allowed_forums[]" multiple="true" size="8">
|
||||
<?php
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -78,6 +78,7 @@ if ($update)
|
|||
//
|
||||
$auth->acl_clear_prefetch();
|
||||
|
||||
$show_prev_info = false;
|
||||
trigger_error($user->lang['FORUM_DELETED']);
|
||||
break;
|
||||
|
||||
|
@ -97,6 +98,11 @@ if ($update)
|
|||
'forum_link' => request_var('forum_link', ''),
|
||||
'forum_link_track' => request_var('forum_link_track', FALSE),
|
||||
'forum_desc' => str_replace("\n", '<br />', request_var('forum_desc', '')),
|
||||
'forum_rules' => request_var('forum_rules', ''),
|
||||
'forum_rules_link' => request_var('forum_rules_link', ''),
|
||||
'rules_allow_bbcode' => request_var('parse_bbcode', false),
|
||||
'rules_allow_smilies' => request_var('parse_smilies', false),
|
||||
'rules_allow_urls' => request_var('parse_urls', false),
|
||||
'forum_image' => request_var('forum_image', ''),
|
||||
'forum_style' => request_var('forum_style', 0),
|
||||
'display_on_index' => request_var('display_on_index', FALSE),
|
||||
|
@ -127,6 +133,7 @@ if ($update)
|
|||
// Redirect to permissions
|
||||
$message = ($mode == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];
|
||||
$message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], "<a href=\"admin_permissions.$phpEx$SID&mode=forum&submit_usergroups=true&ug_type=forum&action=usergroups&f[forum][]=" . $forum_data['forum_id'] . '">', '</a>');
|
||||
$show_prev_info = ($mode == 'edit') ? true : false;
|
||||
|
||||
trigger_error($message);
|
||||
break;
|
||||
|
@ -150,10 +157,17 @@ switch ($mode)
|
|||
$forum_status = request_var('forum_status', ITEM_UNLOCKED);
|
||||
$forum_desc = request_var('forum_desc', '');
|
||||
$forum_name = request_var('forum_name', '');
|
||||
$forum_rules_link = request_var('forum_rules_link', '');
|
||||
$forum_rules = request_var('forum_rules', '');
|
||||
$forum_password = request_var('forum_password', '');
|
||||
$forum_password_confirm = request_var('forum_password_confirm', '');
|
||||
}
|
||||
|
||||
$forum_rules_flags = 0;
|
||||
$forum_rules_flags += (request_var('parse_bbcode', false)) ? 1 : 0;
|
||||
$forum_rules_flags += (request_var('parse_smilies', false)) ? 2 : 0;
|
||||
$forum_rules_flags += (request_var('parse_urls', false)) ? 4 : 0;
|
||||
}
|
||||
|
||||
// Show form to create/modify a forum
|
||||
if ($mode == 'edit')
|
||||
{
|
||||
|
@ -174,6 +188,13 @@ switch ($mode)
|
|||
$forums_list = make_forum_select($parent_id, $forum_id, false, true, false);
|
||||
|
||||
$forum_password_confirm = $forum_password;
|
||||
|
||||
$flags = explode(':', $forum_rules_flags);
|
||||
|
||||
$bbcode_checked = ((int) $flags[0] & 1) ? ' checked="checked"' : '';
|
||||
$smilies_checked = ((int) $flags[0] & 2) ? ' checked="checked"' : '';
|
||||
$urls_checked = ((int) $flags[0] & 4) ? ' checked="checked"' : '';
|
||||
unset($flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -186,16 +207,36 @@ switch ($mode)
|
|||
{
|
||||
$temp_forum_desc = $forum_desc;
|
||||
$temp_forum_name = $forum_name;
|
||||
$temp_forum_rules = $forum_rules;
|
||||
$temp_forum_rules_link = $forum_rules_link;
|
||||
$temp_forum_type = $forum_type;
|
||||
|
||||
extract(get_forum_info($parent_id));
|
||||
$forum_type = $temp_forum_type;
|
||||
$forum_name = $temp_forum_name;
|
||||
$forum_desc = $temp_forum_desc;
|
||||
$forum_rules = $temp_forum_rules;
|
||||
$forum_rules_link = $temp_forum_rules_link;
|
||||
$forum_password_confirm = $forum_password;
|
||||
}
|
||||
}
|
||||
|
||||
// Forum Rules
|
||||
if ($forum_rules)
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
|
||||
// Split text rules (we saved the status and bbcode codes here)
|
||||
if (!strstr($forum_rules_flags, ':') && is_numeric($forum_rules_flags))
|
||||
{
|
||||
// text not parsed yet... a hard time for us...
|
||||
$forum_rules_flags = 0;
|
||||
$forum_rules = parse_text_insert($forum_rules, request_var('parse_bbcode', false), request_var('parse_smilies', false), request_var('parse_urls', false), $forum_rules_flags);
|
||||
}
|
||||
|
||||
$forum_rules_preview = parse_text_display($forum_rules, $forum_rules_flags);
|
||||
}
|
||||
|
||||
$forum_type_options = '';
|
||||
$forum_type_ary = array(FORUM_CAT => 'CAT', FORUM_POST => 'FORUM', FORUM_LINK => 'LINK');
|
||||
foreach ($forum_type_ary as $value => $lang)
|
||||
|
@ -231,7 +272,7 @@ switch ($mode)
|
|||
$forums_nav = get_forum_branch($forum_id, 'parents', 'descending');
|
||||
foreach ($forums_nav as $row)
|
||||
{
|
||||
$navigation .= ($row['forum_id'] == $forum_id) ? ' -> ' . $row['forum_name'] : ' -> <a href="admin_forums.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '">' . $row['forum_name'] . '</a>';
|
||||
$navigation .= ($row['forum_id'] == $forum_id) ? ' -> ' . $row['forum_name'] : ' -> <a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $row['forum_id'] . '">' . $row['forum_name'] . '</a>';
|
||||
}
|
||||
|
||||
adm_page_header($l_title);
|
||||
|
@ -269,7 +310,7 @@ switch ($mode)
|
|||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" width="33%"><?php echo $user->lang['FORUM_TYPE'] ?>: </td>
|
||||
<td class="row1" width="33%"><b><?php echo $user->lang['FORUM_TYPE'] ?>: </b></td>
|
||||
<td class="row2"><select name="forum_type" onchange="this.form.submit();"><?php echo $forum_type_options; ?></select><?php
|
||||
|
||||
if ($old_forum_type == FORUM_POST && $forum_type != FORUM_POST)
|
||||
|
@ -321,7 +362,7 @@ switch ($mode)
|
|||
?>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_LINK'] ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FORUM_LINK_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input class="post" type="text" size="25" name="forum_link" value="<?php echo $forum_link; ?>" /></td>
|
||||
<td class="row2"><input class="post" type="text" size="40" name="forum_link" value="<?php echo $forum_link; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_LINK_TRACK'] ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FORUM_LINK_TRACK_EXPLAIN']; ?></span></td>
|
||||
|
@ -334,19 +375,47 @@ switch ($mode)
|
|||
?>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_NAME']; ?>: </b></td>
|
||||
<td class="row2"><input class="post" type="text" size="25" name="forum_name" value="<?php echo $forum_name ?>" /></td>
|
||||
<td class="row2"><input class="post" type="text" size="40" name="forum_name" value="<?php echo $forum_name ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_DESC'] ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FORUM_DESC_EXPLAIN']; ?></span> </td>
|
||||
<td class="row2"><textarea class="post" rows="5" cols="45" wrap="virtual" name="forum_desc"><?php echo htmlspecialchars(str_replace('<br />', "\n", $forum_desc)); ?></textarea></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($forum_type != FORUM_LINK)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_RULES_LINK']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FORUM_RULES_LINK_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input class="post" type="text" size="40" name="forum_rules_link" value="<?php echo $forum_rules_link ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($forum_rules_preview)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_RULES_PREVIEW'] ?>: </b></td>
|
||||
<td class="row2"><?php echo $forum_rules_preview; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_RULES'] ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FORUM_RULES_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><table cellspacing="2" cellpadding="0" border="0"><tr><td colspan="6"><textarea class="post" rows="4" cols="70" name="forum_rules"><?php echo ($forum_rules) ? parse_text_form_display($forum_rules, $forum_rules_flags) : ''; ?></textarea></td></tr><tr>
|
||||
<td width="10"><input type="checkbox" name="parse_bbcode"<?php echo $bbcode_checked; ?> /></td><td><?php echo $user->lang['PARSE_BBCODE']; ?></td><td width="10"><input type="checkbox" name="parse_smilies"<?php echo $smilies_checked; ?> /></td><td><?php echo $user->lang['PARSE_SMILIES']; ?></td><td width="10"><input type="checkbox" name="parse_urls"<?php echo $urls_checked; ?> /></td><td><?php echo $user->lang['PARSE_URLS']; ?></td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['FORUM_IMAGE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FORUM_IMAGE_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input class="post" type="text" size="25" name="forum_image" value="<?php echo $forum_image ?>" /><br /><?php
|
||||
<td class="row2"><input class="post" type="text" size="40" name="forum_image" value="<?php echo $forum_image ?>" /><br /><?php
|
||||
|
||||
if ($forum_image != '')
|
||||
{
|
||||
echo '<img src="../' . $forum_image . '" alt="" />';
|
||||
echo '<img src="' . $phpbb_root_path . $forum_image . '" alt="" />';
|
||||
}
|
||||
|
||||
?></td>
|
||||
|
@ -740,18 +809,18 @@ while ($row = $db->sql_fetchrow($result))
|
|||
|
||||
if ($row['forum_status'] == ITEM_LOCKED)
|
||||
{
|
||||
$folder_image = '<img src="images/icon_folder_lock.gif" width="46" height="25" alt="' . $user->lang['LOCKED'] . '" alt="' . $user->lang['LOCKED'] . '" />';
|
||||
$folder_image = '<img src="images/icon_folder_lock.gif" width="46" height="25" alt="' . $user->lang['LOCKED'] . '" />';
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ($forum_type)
|
||||
{
|
||||
case FORUM_LINK:
|
||||
$folder_image = '<img src="images/icon_folder_link.gif" width="46" height="25" alt="' . $user->lang['LINK'] . '" alt="' . $user->lang['LINK'] . '" />';
|
||||
$folder_image = '<img src="images/icon_folder_link.gif" width="46" height="25" alt="' . $user->lang['LINK'] . '" />';
|
||||
break;
|
||||
|
||||
default:
|
||||
$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['SUBFORUM'] . '" alt="' . $user->lang['SUBFORUM'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['FOLDER'] . '" alt="' . $user->lang['FOLDER'] . '" />';
|
||||
$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['SUBFORUM'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['FOLDER'] . '" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -812,9 +881,9 @@ while ($row = $db->sql_fetchrow($result))
|
|||
</tr>
|
||||
</table></form>
|
||||
|
||||
<form method="get" action="admin_forums.<?php echo $phpEx,$SID ?>"><table width="100%" cellpadding="1" cellspacing="1" border="0">
|
||||
<form method="get" action="admin_forums.<?php echo $phpEx.$SID ?>"><table width="100%" cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="right"><?php echo $user->lang['SELECT_FORUM']; ?>: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }"><?php echo $forum_box; ?></select> <input class="btnlite" type="submit" value="<?php echo $user->lang['GO']; ?>" /><input type="hidden" name="sid" value="<?php echo $user->session_id; ?>" /></td>
|
||||
<td align="right"><?php echo $user->lang['SELECT_FORUM']; ?>: <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }"><?php echo $forum_box; ?></select> <input class="btnlite" type="submit" value="<?php echo $user->lang['GO']; ?>" /><input type="hidden" name="sid" value="<?php echo $user->session_id; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
<?php
|
||||
|
@ -901,6 +970,21 @@ function update_forum_data(&$forum_data)
|
|||
unset($forum_data['prune_sticky']);
|
||||
unset($forum_data['forum_password_confirm']);
|
||||
|
||||
// Parse Forum Rules
|
||||
$forum_data['forum_rules_flags'] = 0;
|
||||
|
||||
if ($forum_data['forum_rules'])
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
|
||||
$forum_data['forum_rules'] = parse_text_insert($forum_data['forum_rules'], $forum_data['rules_allow_bbcode'], $forum_data['rules_allow_smilies'], $forum_data['rules_allow_urls'], $forum_data['forum_rules_flags']);
|
||||
}
|
||||
|
||||
unset($forum_data['rules_allow_smilies']);
|
||||
unset($forum_data['rules_allow_urls']);
|
||||
unset($forum_data['rules_allow_bbcode']);
|
||||
|
||||
// What are we going to do tonight Brain? The same thing we do everynight,
|
||||
// try to take over the world ... or decide whether to continue update
|
||||
// and if so, whether it's a new forum/cat/link or an existing one
|
||||
|
@ -1108,7 +1192,7 @@ function move_forum_content($from_id, $to_id, $sync = TRUE)
|
|||
global $db;
|
||||
|
||||
$table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE);
|
||||
foreach ($sql_ary as $table)
|
||||
foreach ($table_ary as $table)
|
||||
{
|
||||
$sql = "UPDATE $table
|
||||
SET forum_id = $to_id
|
||||
|
@ -1129,7 +1213,7 @@ function move_forum_content($from_id, $to_id, $sync = TRUE)
|
|||
|
||||
function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = 'delete', $posts_to_id = 0, $subforums_to_id = 0)
|
||||
{
|
||||
global $db, $user;
|
||||
global $db, $user, $cache;
|
||||
|
||||
$row = get_forum_info($forum_id);
|
||||
extract($row);
|
||||
|
@ -1291,6 +1375,7 @@ function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = '
|
|||
WHERE group_id = {$row['group_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$cache->destroy('extensions');
|
||||
|
||||
$log_action = implode('_', array($log_action_posts, $log_action_forums));
|
||||
|
||||
|
@ -1335,8 +1420,6 @@ function delete_forum_content($forum_id)
|
|||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'mysql4':
|
||||
// Use delete_attachments('topic', $ids, false) here...
|
||||
|
||||
// Select then delete all attachments
|
||||
$sql = 'SELECT a.topic_id
|
||||
FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a
|
||||
|
|
|
@ -54,6 +54,11 @@ $sort_dir = request_var('sd', 'd');
|
|||
// Define some vars depending on which logs we're looking at
|
||||
$log_type = ($mode == 'admin') ? LOG_ADMIN : (($mode == 'mod') ? LOG_MOD : LOG_CRITICAL);
|
||||
|
||||
if ($log_type == LOG_MOD)
|
||||
{
|
||||
$user->add_lang('mcp');
|
||||
}
|
||||
|
||||
// Delete entries if requested and able
|
||||
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
|
||||
{
|
||||
|
@ -74,7 +79,7 @@ if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
|
|||
$where_sql";
|
||||
$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'log_' . $mode . '_clear');
|
||||
add_log('admin', 'LOG_' . strtoupper($mode) . '_CLEAR');
|
||||
}
|
||||
|
||||
// Sorting
|
||||
|
|
|
@ -74,11 +74,11 @@ switch ($mode)
|
|||
<th colspan="2"><?php echo $user->lang['EDIT_WORD']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['WORD']; ?></b>:</td>
|
||||
<td class="row1"><b><?php echo $user->lang['WORD']; ?>: </b></td>
|
||||
<td class="row2"><input class="post" type="text" name="word" value="<?php echo $word_info['word']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['REPLACEMENT']; ?></b>:</td>
|
||||
<td class="row1"><b><?php echo $user->lang['REPLACEMENT']; ?>: </b></td>
|
||||
<td class="row2"><input class="post" type="text" name="replacement" value="<?php echo $word_info['replacement']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -106,8 +106,8 @@ switch ($mode)
|
|||
|
||||
$cache->destroy('word_censors');
|
||||
|
||||
$log_action = ($word_id) ? 'log_edit_word' : 'log_add_word';
|
||||
add_log('admin', $log_action, stripslashes($word));
|
||||
$log_action = ($word_id) ? 'LOG_EDIT_WORD' : 'LOG_ADD_WORD';
|
||||
add_log('admin', $log_action, $word);
|
||||
|
||||
$message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED'];
|
||||
trigger_error($message);
|
||||
|
@ -122,13 +122,20 @@ switch ($mode)
|
|||
trigger_error($user->lang['NO_WORD']);
|
||||
}
|
||||
|
||||
$sql = 'SELECT word
|
||||
FROM ' . WORDS_TABLE . "
|
||||
WHERE word_id = $word_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$deleted_word = $db->sql_fetchfield('word', 0, $result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'DELETE FROM ' . WORDS_TABLE . "
|
||||
WHERE word_id = $word_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$cache->destroy('word_censors');
|
||||
|
||||
add_log('admin', 'log_delete_word');
|
||||
add_log('admin', 'LOG_DELETE_WORD', $deleted_word);
|
||||
|
||||
$message = $user->lang['WORD_REMOVE'];
|
||||
trigger_error($message);
|
||||
|
@ -158,6 +165,7 @@ switch ($mode)
|
|||
ORDER BY word';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row_class = '';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
if (!defined('IN_PHPBB') || !isset($phpbb_root_path))
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ $user->setup('admin');
|
|||
// Did user forget to login? Give 'em a chance to here ...
|
||||
if ($user->data['user_id'] == ANONYMOUS)
|
||||
{
|
||||
login_box("adm/index.$phpEx$SID", '', $user->lang['LOGIN_ADMIN']);
|
||||
login_box("{$phpbb_root_path}adm/index.$phpEx$SID", '', $user->lang['LOGIN_ADMIN']);
|
||||
}
|
||||
|
||||
$auth->acl($user->data);
|
||||
|
|
|
@ -40,15 +40,15 @@ class bbcode
|
|||
if ($bbcode_bitfield !== FALSE)
|
||||
{
|
||||
$this->bbcode_bitfield = $bbcode_bitfield;
|
||||
// Init those added with a new bbcode_bitfield (already stored codes will not get parsed again)
|
||||
$this->bbcode_cache_init();
|
||||
}
|
||||
|
||||
if (!$this->bbcode_bitfield)
|
||||
{
|
||||
return $message;
|
||||
}
|
||||
|
||||
// Init those added with a new bbcode_bitfield (already stored codes will not get parsed again)
|
||||
$this->bbcode_cache_init();
|
||||
|
||||
$str = array('search' => array(), 'replace' => array());
|
||||
$preg = array('search' => array(), 'replace' => array());
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ class sql_db
|
|||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
{
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
@mysql_free_result($this->query_result);
|
||||
// mysql_free_result happened within sql_save()
|
||||
}
|
||||
elseif (preg_match('/^SELECT/', $query))
|
||||
{
|
||||
|
|
|
@ -117,6 +117,29 @@ function get_userdata($user)
|
|||
return ($row = $db->sql_fetchrow($result)) ? $row : false;
|
||||
}
|
||||
|
||||
// Create forum rules for given forum
|
||||
function generate_forum_rules($forum_data)
|
||||
{
|
||||
if (!$forum_data['forum_rules'] && !$forum_data['forum_rules_link'])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
global $template, $phpbb_root_path, $phpEx;
|
||||
|
||||
if ($forum_data['forum_rules'])
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
$text_flags = explode(':', $forum_data['forum_rules_flags']);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_FORUM_RULES' => true,
|
||||
'U_FORUM_RULES' => $forum_data['forum_rules_link'],
|
||||
'FORUM_RULES' => (!$forum_data['forum_rules_link']) ? parse_text_display($forum_data['forum_rules'], $forum_data['forum_rules_flags']) : '')
|
||||
);
|
||||
}
|
||||
|
||||
// Create forum navigation links for given forum, create parent
|
||||
// list if currently null, assign basic forum info to template
|
||||
function generate_forum_nav(&$forum_data)
|
||||
|
@ -235,7 +258,7 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
|||
}
|
||||
|
||||
// User authorisation levels output
|
||||
function gen_forum_rules($mode, &$forum_id)
|
||||
function gen_forum_auth_level($mode, &$forum_id)
|
||||
{
|
||||
global $SID, $template, $auth, $user;
|
||||
|
||||
|
@ -1098,6 +1121,7 @@ function login_box($s_action, $s_hidden_fields = '', $login_explain = '', $ucp_l
|
|||
}
|
||||
|
||||
$s_hidden_fields .= ($ucp_login && !empty($_SERVER['HTTP_REFERER'])) ? '<input type="hidden" name="redirect" value="' . htmlspecialchars($_SERVER['HTTP_REFERER']) . '" />' : '<input type="hidden" name="redirect" value="' . $s_action . '" />';
|
||||
$s_hidden_fields .= '<input type="hidden" name="sid" value="' . $SID . '" />';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'LOGIN_ERROR' => $err,
|
||||
|
@ -1285,7 +1309,7 @@ function extension_allowed($forum_id, $extension)
|
|||
function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
{
|
||||
global $cache, $db, $auth, $template, $config, $user;
|
||||
global $phpEx, $phpbb_root_path, $starttime, $display_header;
|
||||
global $phpEx, $phpbb_root_path, $starttime, $display_header, $show_prev_info;
|
||||
|
||||
switch ($errno)
|
||||
{
|
||||
|
@ -1349,10 +1373,11 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
|||
$msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text;
|
||||
$msg_title = (!isset($msg_title)) ? $user->lang['INFORMATION'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title);
|
||||
$display_header = (!isset($display_header)) ? false : (bool) $display_header;
|
||||
$show_prev_info = (!isset($show_prev_info)) ? true : (bool) $show_prev_info;
|
||||
|
||||
if (defined('IN_ADMIN'))
|
||||
{
|
||||
adm_page_message($msg_title, $msg_text, $display_header);
|
||||
adm_page_message($msg_title, $msg_text, $display_header, $show_prev_info);
|
||||
adm_page_footer();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -779,12 +779,20 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!sizeof($where_ids))
|
||||
{
|
||||
return;
|
||||
}
|
||||
$where_sql = 'WHERE ' . $mode{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')';
|
||||
$where_sql_and = $where_sql . "\n\tAND";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sizeof($where_ids))
|
||||
{
|
||||
return;
|
||||
}
|
||||
$where_sql = 'WHERE ' . $mode{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')';
|
||||
$where_sql_and = $where_sql . "\n\tAND";
|
||||
}
|
||||
|
@ -807,7 +815,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE,
|
|||
FROM ' .TOPICS_TABLE . ' t1, ' . TOPICS_TABLE . " t2
|
||||
WHERE t1.topic_moved_id = t2.topic_id
|
||||
AND t1.forum_id = t2.forum_id";
|
||||
$result = $db->sql_query($result);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
function display_forums($root_data = '', $display_moderators = TRUE)
|
||||
{
|
||||
global $config, $db, $template, $auth, $user, $phpEx, $SID, $forum_moderators;
|
||||
global $config, $db, $template, $auth, $user, $phpEx, $SID, $forum_moderators, $phpbb_root_path;
|
||||
|
||||
// Get posted/get info
|
||||
$mark_read = request_var('mark', '');
|
||||
|
@ -300,11 +300,10 @@ function display_forums($root_data = '', $display_moderators = TRUE)
|
|||
'S_IS_CAT' => false,
|
||||
'S_IS_LINK' => ($row['forum_type'] != FORUM_LINK) ? false : true,
|
||||
|
||||
'FORUM_IMG' => $row['forum_image'],
|
||||
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
||||
|
||||
'FORUM_ID' => $row['forum_id'],
|
||||
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
||||
'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $folder_alt . '" border="0" />' : $user->img($folder_image, $folder_alt),
|
||||
'FORUM_NAME' => $row['forum_name'],
|
||||
'FORUM_DESC' => $row['forum_desc'],
|
||||
$l_post_click_count => $post_click_count,
|
||||
|
|
|
@ -101,7 +101,10 @@ function format_display(&$message, &$signature, $uid, $siguid, $enable_html, $en
|
|||
}
|
||||
|
||||
// Second parse bbcode here
|
||||
$bbcode->bbcode_second_pass($message, $uid);
|
||||
if ($enable_bbcode)
|
||||
{
|
||||
$bbcode->bbcode_second_pass($message, $uid);
|
||||
}
|
||||
|
||||
// If we allow users to disable display of emoticons we'll need an appropriate
|
||||
// check and preg_replace here
|
||||
|
@ -128,6 +131,101 @@ function format_display(&$message, &$signature, $uid, $siguid, $enable_html, $en
|
|||
return $message;
|
||||
}
|
||||
|
||||
// Three simple functions we use for bbcode/smilie/url capable text
|
||||
|
||||
// prepare text to be inserted into db...
|
||||
function parse_text_insert($text, $allow_bbcode, $allow_smilies, $allow_magic_url, &$text_flags)
|
||||
{
|
||||
global $message_parser;
|
||||
|
||||
$text_flags += ($allow_bbcode) ? 1 : 0;
|
||||
$text_flags += ($allow_smilies) ? 2 : 0;
|
||||
$text_flags += ($allow_magic_url) ? 4 : 0;
|
||||
|
||||
$match = array('#\r\n?#', '#sid=[a-z0-9]*?&?#', "#([\n][\s]+){3,}#", '#&(\#[0-9]+;)#');
|
||||
$replace = array("\n", '', "\n\n", '&\1');
|
||||
$text = preg_replace($match, $replace, $text);
|
||||
|
||||
// Parse BBCode
|
||||
if (!method_exists('parse_message', 'parse_message') || !isset($message_parser))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
|
||||
$message_parser = new parse_message();
|
||||
}
|
||||
|
||||
$message_parser->message = $text;
|
||||
|
||||
if ($allow_bbcode && strpos($text, '[') !== false)
|
||||
{
|
||||
$message_parser->bbcode_init();
|
||||
$message_parser->bbcode();
|
||||
}
|
||||
|
||||
// Parse Emoticons
|
||||
$message_parser->emoticons($allow_smilies);
|
||||
|
||||
// Parse URL's
|
||||
$message_parser->magic_url($allow_magic_url);
|
||||
|
||||
$text_flags = $text_flags . ':' . $message_parser->bbcode_uid . ':' . $message_parser->bbcode_bitfield;
|
||||
|
||||
return $message_parser->message;
|
||||
}
|
||||
|
||||
// prepare text to be displayed/previewed...
|
||||
function parse_text_display($text, $text_rules)
|
||||
{
|
||||
global $bbcode, $user;
|
||||
|
||||
$text_flags = explode(':', $text_rules);
|
||||
|
||||
$allow_bbcode = (int) $text_flags[0] & 1;
|
||||
$allow_smilies = (int) $text_flags[0] & 2;
|
||||
$allow_magic_url = (int) $text_flags[0] & 4;
|
||||
|
||||
$bbcode_uid = trim($text_flags[1]);
|
||||
$bbcode_bitfield = (int) $text_flags[2];
|
||||
|
||||
if (!$bbcode && $allow_bbcode)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
||||
$bbcode = new bbcode();
|
||||
}
|
||||
|
||||
// Second parse bbcode here
|
||||
if ($allow_bbcode)
|
||||
{
|
||||
$bbcode->bbcode_second_pass($text, $bbcode_uid, $bbcode_bitfield);
|
||||
}
|
||||
|
||||
// If we allow users to disable display of emoticons we'll need an appropriate
|
||||
// check and preg_replace here
|
||||
if ($allow_smilies)
|
||||
{
|
||||
$text = smilie_text($text, !$allow_smilies);
|
||||
}
|
||||
|
||||
// Replace naughty words such as farty pants
|
||||
$text = str_replace("\n", '<br />', censor_text($text));
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
// prepare text to be displayed within a form (fetched from db)
|
||||
function parse_text_form_display($text, $text_rules)
|
||||
{
|
||||
// We use decode_text here...
|
||||
$text_rules = explode(':', $text_rules);
|
||||
$bbcode_uid = trim($text_rules[1]);
|
||||
|
||||
decode_text($text, $bbcode_uid);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
// Update Last Post Informations
|
||||
function update_last_post_information($type, $id)
|
||||
{
|
||||
|
|
|
@ -190,6 +190,9 @@ CREATE TABLE phpbb_forums (
|
|||
forum_password varchar(32) DEFAULT '' NOT NULL,
|
||||
forum_style tinyint(4) UNSIGNED,
|
||||
forum_image varchar(50) DEFAULT '' NOT NULL,
|
||||
forum_rules text DEFAULT '' NOT NULL,
|
||||
forum_rules_link varchar(200) DEFAULT '' NOT NULL,
|
||||
forum_rules_flags varchar(50) DEFAULT '' NOT NULL,
|
||||
forum_topics_per_page tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
forum_status tinyint(4) DEFAULT '0' NOT NULL,
|
||||
|
|
|
@ -150,7 +150,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_bbcode_pm', '
|
|||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_smilies_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_download_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_karma_pm', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_report_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_quote_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1');
|
||||
|
|
|
@ -123,11 +123,10 @@ $lang += array(
|
|||
'LOG_USER_ACTIVE' => '<b>User activated</b><br />» %s',
|
||||
|
||||
'LOG_MASS_EMAIL' => '<b>Sent mass email</b><br />» %s',
|
||||
'LOG_MAIL_SESSION' => '<b>Logged Mail Session</b><br />» %s',
|
||||
|
||||
'log_delete_word' => '<b>Deleted word censor</b>',
|
||||
'log_edit_word' => '<b>Edited word censor</b><br />» %s',
|
||||
'log_add_word' => '<b>Added word censor</b><br />» %s',
|
||||
'LOG_DELETE_WORD' => '<b>Deleted word censor</b><br />» %s',
|
||||
'LOG_EDIT_WORD' => '<b>Edited word censor</b><br />» %s',
|
||||
'LOG_ADD_WORD' => '<b>Added word censor</b><br />» %s',
|
||||
|
||||
'log_db_backup' => '<b>Database backup</b>',
|
||||
'log_db_restore' => '<b>Database restore</b>',
|
||||
|
@ -136,7 +135,9 @@ $lang += array(
|
|||
'log_disallow_add' => '<b>Added disallowed username</b><br />» %s',
|
||||
'log_disallow_delete' => '<b>Deleted disallowed username</b>',
|
||||
|
||||
'log_admin_clear' => '<b>Cleared admin log</b>',
|
||||
'LOG_ADMIN_CLEAR' => '<b>Cleared admin log</b>',
|
||||
'LOG_MOD_CLEAR' => '<b>Cleared moderator log</b>',
|
||||
'LOG_CRITICAL_CLEAR' => '<b>Cleared error log</b>',
|
||||
|
||||
'LOG_PRUNE' => '<b>Pruned forums</b><br />» %s',
|
||||
'LOG_AUTO_PRUNE' => '<b>Auto-pruned forums</b><br />» %s',
|
||||
|
@ -163,6 +164,7 @@ $lang += array(
|
|||
'LOG_AVATAR_CONFIG' => '<b>Altered avatar settings</b>',
|
||||
'LOG_AUTH_CONFIG' => '<b>Altered authentication settings</b>',
|
||||
'LOG_LOAD_CONFIG' => '<b>Altered load settings</b>',
|
||||
'LOG_MESSAGE_CONFIG' => '<b>Altered private message settings</b>',
|
||||
|
||||
'LOG_ATTACH_CONFIG' => '<b>Altered attachment settings</b>',
|
||||
'LOG_ATTACH_EXT_ADD' => '<b>Added or edited attachment extension</b><br />» %s',
|
||||
|
@ -880,7 +882,7 @@ $lang += array(
|
|||
'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.',
|
||||
'FORUM_EDIT_EXPLAIN' => 'The form below will allow you to customise this forum. Please note that moderation and post count controls are set via forum permissions for each user or usergroup.',
|
||||
'FORUM_DELETE' => 'Delete Forum',
|
||||
'FORUM_DELETE_EXPLAIN' => 'The form below will allow you to delete a forum 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 and decide where you want to put all topics (or forums) it contained.',
|
||||
|
||||
'EDIT_FORUM' => 'Edit forum',
|
||||
'CREATE_FORUM' => 'Create new forum',
|
||||
|
@ -909,7 +911,18 @@ $lang += array(
|
|||
'FORUM_IMAGE' => 'Forum Image',
|
||||
'FORUM_IMAGE_EXPLAIN'=> 'Location, relative to the phpBB root directory, of an image to associate with this forum.',
|
||||
'FORUM_PARENT' => 'Parent Forum',
|
||||
|
||||
'FORUM_RULES' => 'Forum Rules',
|
||||
'FORUM_RULES_EXPLAIN' => 'Forum Rules are displayed at any page within the given forum.',
|
||||
'FORUM_RULES_LINK' => 'Link to Forum Rules',
|
||||
'FORUM_RULES_LINK_EXPLAIN'=> 'You are able to enter the URL of the page/post containing your forum rules here. This setting will override the Forum Rules text you specified.',
|
||||
'FORUM_RULES_PREVIEW' => 'Forum Rules preview',
|
||||
'PARSE_BBCODE' => 'Parse BBCode',
|
||||
'PARSE_SMILIES' => 'Parse Smilies',
|
||||
'PARSE_URLS' => 'Parse Links',
|
||||
|
||||
'NO_PARENT' => 'No Parent',
|
||||
'LINK' => 'Link',
|
||||
'LOCKED' => 'Locked',
|
||||
'UNLOCKED' => 'Unlocked',
|
||||
'ENABLE_NEWS' => 'Set as news forum',
|
||||
|
@ -951,13 +964,15 @@ $lang += array(
|
|||
'DELETE_ALL_POSTS' => 'Delete posts',
|
||||
'DELETE_SUBFORUMS' => 'Delete subforums and posts',
|
||||
|
||||
'NO_DESTINATION_FORUM' => 'You have not specified a forum to move content to',
|
||||
'NO_DESTINATION_FORUM' => 'You have not specified a forum to move content to',
|
||||
'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.',
|
||||
'FORUM_NAME_EMPTY' => 'You must enter a name for this forum.',
|
||||
'FORUM_DATA_NEGATIVE' => 'Pruning parameters cannot be negative.',
|
||||
'FORUM_CREATED' => 'Forum created successfully.',
|
||||
'FORUM_UPDATED' => 'Forum informations updated successfully.',
|
||||
'REDIRECT_ACL' => 'To set permissions for this forum click %sHERE%s.',
|
||||
'FORUM_DELETED' => 'Forum successfully deleted',
|
||||
'FORUM_RESYNCED' => 'Forum successfully resynced',
|
||||
);
|
||||
|
||||
// Smiley and topic icons
|
||||
|
@ -1768,7 +1783,9 @@ $lang += array(
|
|||
'EXTENSION_GROUPS' => 'Extension Groups',
|
||||
'EXTENSION_GROUP' => 'Extension Group',
|
||||
'SPECIAL_CATEGORY' => 'Special Category',
|
||||
'SPECIAL_CATEGORY_EXPLAIN' => 'Special Categories differ between the way presented within posts.',
|
||||
'DOWNLOAD_MODE' => 'Download Mode',
|
||||
'DOWNLOAD_MODE_EXPLAIN' => 'If you experience problems downloading files, set this to "physical", the user will be directed to the file directly. Do not set it to physical if not really needed, it discloses the filename.',
|
||||
'UPLOAD_ICON' => 'Upload Icon',
|
||||
'MAX_EXTGROUP_FILESIZE' => 'Maximum Filesize',
|
||||
'ASSIGNED_EXTENSIONS' => 'Assigned Extensions',
|
||||
|
@ -1781,10 +1798,11 @@ $lang += array(
|
|||
'EXTENSION_GROUP_EXIST' => 'The Extension Group %s already exist',
|
||||
'EXTENSION_GROUP_DELETED' => 'Extension Group successfully deleted',
|
||||
'ALLOWED_FORUMS' => 'Allowed Forums',
|
||||
'ALLOWED_FORUMS_EXPLAIN' => 'Able to post the assigned extensions at the following forums',
|
||||
'ALLOWED_FORUMS_EXPLAIN' => 'Able to post the assigned extensions at the selected (or all if selected) forums',
|
||||
'ALLOW_IN_PM' => 'Allowed in private messaging',
|
||||
'ALLOW_ALL_FORUMS' => 'Allow All Forums',
|
||||
'ALLOW_SELECTED_FORUMS' => 'Only Forums selected below',
|
||||
'GO_TO_EXTENSIONS' => 'Go to Extension Management Screen',
|
||||
|
||||
'CAT_IMAGES' => 'Images',
|
||||
'CAT_WM_FILES' => 'Win Media Streams',
|
||||
|
|
|
@ -46,6 +46,7 @@ $lang += array(
|
|||
'ACP' => 'Administration Control Panel',
|
||||
'ACTIVE_ERROR' => 'You have specified an inactive username. Please activate your account and try again. If you continue to have problems please contact a board administrator.',
|
||||
'ALLOWED' => 'Allowed',
|
||||
'ALL_FORUMS' => 'All Forums',
|
||||
'ALL_MESSAGES' => 'All Messages',
|
||||
'ALL_POSTS' => 'All Posts',
|
||||
'ALL_TIMES' => 'All times are %s %s',
|
||||
|
@ -82,6 +83,7 @@ $lang += array(
|
|||
'DAY' => 'Day',
|
||||
'DAYS' => 'Days',
|
||||
'DELETE' => 'Delete',
|
||||
'DELETE_MARKED' => 'Delete Marked',
|
||||
'DESCENDING' => 'Descending',
|
||||
'DISABLED' => 'Disabled',
|
||||
'DISPLAY_MESSAGES' => 'Display messages from previous',
|
||||
|
@ -111,6 +113,7 @@ $lang += array(
|
|||
'FORUM_INDEX' => 'Board Index',
|
||||
'FORUM_LOCATION' => 'Forum Location',
|
||||
'FORUM_LOCKED' => 'Forum Locked',
|
||||
'FORUM_RULES' => 'Forum Rules',
|
||||
'FROM' => 'from',
|
||||
|
||||
'GO' => 'Go',
|
||||
|
|
|
@ -85,6 +85,7 @@ $lang += array(
|
|||
'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your email address or username.',
|
||||
'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.',
|
||||
|
||||
'DEFAULT_ACTION' => 'Default Action',
|
||||
'DEFAULT_ADD_SIG' => 'Attach my signature by default',
|
||||
'DEFAULT_BBCODE' => 'Enable BBCode by default',
|
||||
'DEFAULT_HTML' => 'Enable HTML by default',
|
||||
|
@ -97,7 +98,6 @@ $lang += array(
|
|||
'DELETE_ATTACHMENT_CONFIRM' => 'Are you sure you want to delete this attachment?',
|
||||
'DELETE_ATTACHMENTS_CONFIRM'=> 'Are you sure you want to delete these attachments?',
|
||||
'DELETE_AVATAR' => 'Delete Image',
|
||||
'DELETE_MARKED' => 'Delete Marked',
|
||||
'DELETE_MARKED_PM' => 'Delete Marked Messages',
|
||||
'DELETE_MARKED_PM_CONFIRM' => 'Are you sure you want to delete all marked messages?',
|
||||
'DELETE_PM' => 'Delete PM',
|
||||
|
@ -137,6 +137,7 @@ $lang += array(
|
|||
|
||||
'HIDE_ONLINE' => 'Hide my online status',
|
||||
|
||||
'IF_FOLDER_FULL' => 'If Folder Full',
|
||||
'IMPORTANT_NEWS' => 'Important announcements',
|
||||
|
||||
'LANGUAGE' => 'Language',
|
||||
|
@ -144,6 +145,7 @@ $lang += array(
|
|||
'LINK_REMOTE_AVATAR_EXPLAIN'=> 'Enter the URL of the location containing the Avatar image you wish to link to.',
|
||||
'LINK_REMOTE_SIZE' => 'Avatar dimensions',
|
||||
'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.',
|
||||
'LOGIN_EXPLAIN_UCP' => 'Please Login in order to access the User Control Panel',
|
||||
'LOGIN_REDIRECT' => 'You have been successfully logged in.',
|
||||
'LOGOUT_REDIRECT' => 'You have been successfully logged out.',
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ switch ($mode)
|
|||
trigger_error($user->lang['NO_VIEW_USERS']);
|
||||
}
|
||||
|
||||
login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', htmlspecialchars($_SERVER['REQUEST_URI'])));
|
||||
login_box($user->cur_page, '', $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -266,7 +266,7 @@ if (!$auth->acl_get('f_' . $mode, $forum_id) && $forum_type == FORUM_POST)
|
|||
trigger_error('USER_CANNOT_' . strtoupper($mode));
|
||||
}
|
||||
|
||||
login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', htmlspecialchars($_SERVER['REQUEST_URI'])), '', $user->lang['USER_CANNOT_' . strtoupper($mode)]);
|
||||
login_box($user->cur_page, '', $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -917,10 +917,18 @@ $forum_data = array(
|
|||
'forum_name' => $forum_name,
|
||||
'forum_id' => $forum_id,
|
||||
'forum_type' => $forum_type,
|
||||
'forum_desc' => $forum_desc
|
||||
'forum_desc' => $forum_desc,
|
||||
'forum_rules' => $forum_rules,
|
||||
'forum_rules_flags' => $forum_rules_flags,
|
||||
'forum_rules_link' => $forum_rules_link
|
||||
);
|
||||
|
||||
// Generate Navigation Links
|
||||
generate_forum_nav($forum_data);
|
||||
|
||||
// Generate Forum Rules
|
||||
generate_forum_rules($forum_data);
|
||||
|
||||
$s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $topic_last_post_id . '" />' : '';
|
||||
$s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_time . '" />';
|
||||
$s_hidden_fields .= (isset($check_value)) ? '<input type="hidden" name="status_switch" value="' . $check_value . '" />' : '';
|
||||
|
|
|
@ -48,15 +48,16 @@ function checkForm()
|
|||
<script language="javascript" type="text/javascript" src="styles/subSilver/template/editor.js"></script>
|
||||
|
||||
<!-- IF S_FORUM_RULES -->
|
||||
<p class="forumrules">
|
||||
<div class="forumrules">
|
||||
<!-- IF U_FORUM_RULES -->
|
||||
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
|
||||
<!-- ELSE -->
|
||||
{L_FORUM_RULES}
|
||||
<span style="color:red">{L_FORUM_RULES}</span><br />
|
||||
{FORUM_RULES}
|
||||
<!-- ENDIF -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br clear="all" />
|
||||
<br clear="all" />
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF not S_PRIVMSGS -->
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
<tr>
|
||||
<td align="center"><b class="postauthor">{post_review_row.POSTER_NAME}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">{post_review_row.KARMA_IMG}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="100%">
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
<tr>
|
||||
<td align="center"><b class="postauthor">{topic_review_row.POSTER_NAME}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">{topic_review_row.KARMA_IMG}</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="100%"><table width="100%" cellspacing="0">
|
||||
<tr>
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
<!-- $Id$ -->
|
||||
|
||||
<!-- IF S_FORUM_RULES -->
|
||||
<p class="forumrules">
|
||||
<div class="forumrules">
|
||||
<!-- IF U_FORUM_RULES -->
|
||||
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
|
||||
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
|
||||
<!-- ELSE -->
|
||||
{L_FORUM_RULES}
|
||||
<span style="color:red">{L_FORUM_RULES}</span><br />
|
||||
{FORUM_RULES}
|
||||
<!-- ENDIF -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br clear="all" />
|
||||
<!-- ENDIF -->
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
<!-- $Id$ -->
|
||||
|
||||
<!-- IF S_FORUM_RULES -->
|
||||
<p class="forumrules">
|
||||
<div class="forumrules">
|
||||
<!-- IF U_FORUM_RULES -->
|
||||
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
|
||||
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
|
||||
<!-- ELSE -->
|
||||
{L_FORUM_RULES}
|
||||
<span style="color:red">{L_FORUM_RULES}</span><br />
|
||||
{FORUM_RULES}
|
||||
<!-- ENDIF -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br clear="all" />
|
||||
<!-- ENDIF -->
|
||||
|
@ -134,9 +135,6 @@
|
|||
<div align="center">
|
||||
|
||||
<table cellspacing="4" align="center">
|
||||
<tr>
|
||||
<td>{postrow.KARMA_IMG}</td>
|
||||
</tr>
|
||||
<!-- IF postrow.ONLINE_IMG -->
|
||||
<tr>
|
||||
<td>{postrow.ONLINE_IMG}</td>
|
||||
|
|
|
@ -301,7 +301,12 @@ switch ($mode)
|
|||
// Only registered users can go beyond this point
|
||||
if ($user->data['user_id'] == ANONYMOUS || $user->data['user_type'] == USER_INACTIVE || $user->data['user_type'] == USER_IGNORE)
|
||||
{
|
||||
redirect("index.$phpEx");
|
||||
if ($user->data['user_id'] != ANONYMOUS)
|
||||
{
|
||||
redirect("index.$phpEx");
|
||||
}
|
||||
|
||||
login_box($user->cur_page, '', $user->lang['LOGIN_EXPLAIN_UCP']);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ if ($forum_data['forum_password'])
|
|||
// Redirect to login upon emailed notification links
|
||||
if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS)
|
||||
{
|
||||
login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', htmlspecialchars($_SERVER['REQUEST_URI'])), '', $user->lang['LOGIN_NOTIFY_FORUM']);
|
||||
login_box($user->cur_page, '', $user->lang['LOGIN_NOTIFY_FORUM']);
|
||||
}
|
||||
|
||||
// Permissions check
|
||||
|
@ -130,12 +130,15 @@ if (!$auth->acl_get('f_read', $forum_id))
|
|||
trigger_error($user->lang['SORRY_AUTH_READ']);
|
||||
}
|
||||
|
||||
login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', htmlspecialchars($_SERVER['REQUEST_URI'])), '', $user->lang['LOGIN_VIEWFORUM']);
|
||||
login_box($user->cur_page, '', $user->lang['LOGIN_VIEWFORUM']);
|
||||
}
|
||||
|
||||
// Build navigation links
|
||||
generate_forum_nav($forum_data);
|
||||
|
||||
// Forum Rules
|
||||
generate_forum_rules($forum_data);
|
||||
|
||||
// Do we have subforums?
|
||||
$active_forum_ary = $moderators = array();
|
||||
|
||||
|
@ -198,7 +201,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
|
|||
}
|
||||
|
||||
$s_forum_rules = '';
|
||||
gen_forum_rules('forum', $forum_id);
|
||||
gen_forum_auth_level('forum', $forum_id);
|
||||
|
||||
// Topic ordering options
|
||||
$limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']);
|
||||
|
@ -280,7 +283,6 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
|
|||
'S_FORUM_ACTION' => "viewforum.$phpEx$SID&f=$forum_id&start=$start",
|
||||
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false,
|
||||
'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f[]=$forum_id",
|
||||
'S_FORUM_RULES' => false,
|
||||
|
||||
'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? "mcp.$phpEx?sid=$user->session_id&f=$forum_id&mode=forum_view" : '',
|
||||
'U_POST_NEW_TOPIC' => "posting.$phpEx$SID&mode=post&f=$forum_id",
|
||||
|
@ -407,10 +409,10 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
|
|||
$topic_type = '';
|
||||
if ($row['topic_status'] == ITEM_MOVED)
|
||||
{
|
||||
$topic_type = $user->lang['VIEW_TOPIC_MOVED'] . ' ';
|
||||
$topic_type = $user->lang['VIEW_TOPIC_MOVED'];
|
||||
$topic_id = $row['topic_moved_id'];
|
||||
|
||||
$folder_image = 'folder';
|
||||
$folder_img = 'folder';
|
||||
$folder_alt = 'Topic_Moved';
|
||||
$newest_post_img = '';
|
||||
}
|
||||
|
@ -576,7 +578,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
|
|||
if ((isset($row['mark_time']) && $row['topic_last_post_time'] > $row['mark_time']) || (empty($row['mark_time']) && $row['topic_last_post_time'] > $forum_data['mark_time']))
|
||||
{
|
||||
// sync post/topic marking
|
||||
if (!$unread_topic && !empty($row['mark_time']) && $row['mark_time'])
|
||||
if (isset($unread_topc) && !$unread_topic && !empty($row['mark_time']) && $row['mark_time'])
|
||||
{
|
||||
markread('topic', $forum_id, $topic_id);
|
||||
}
|
||||
|
@ -609,7 +611,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
|
|||
// on all topics (as we do in 2.0.x). It looks for unread or new topics, if it doesn't find
|
||||
// any it updates the forum last read cookie. This requires that the user visit the forum
|
||||
// after reading a topic
|
||||
if ($forum_data['forum_type'] == FORUM_POST && $user->data['user_id'] != ANONYMOUS && $mark_forum_read)
|
||||
if ($forum_data['forum_type'] == FORUM_POST && $user->data['user_id'] != ANONYMOUS && count($topic_list) && $mark_forum_read)
|
||||
{
|
||||
markread('mark', $forum_id);
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ if ($user->data['user_id'] != ANONYMOUS)
|
|||
// whereupon we join on the forum_id passed as a parameter ... this
|
||||
// is done so navigation, forum name, etc. remain consistent with where
|
||||
// user clicked to view a global topic
|
||||
$sql = 'SELECT t.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, ' . (($auth->acl_get('m_approve')) ? 't.topic_replies_real AS topic_replies' : 't.topic_replies') . ', t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password' . $extra_fields . '
|
||||
$sql = 'SELECT t.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, ' . (($auth->acl_get('m_approve')) ? 't.topic_replies_real AS topic_replies' : 't.topic_replies') . ', t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags' . $extra_fields . '
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f' . $join_sql_table . "
|
||||
WHERE $join_sql
|
||||
AND (f.forum_id = t.forum_id
|
||||
|
@ -236,7 +236,7 @@ if (!$auth->acl_get('f_read', $forum_id))
|
|||
trigger_error($user->lang['SORRY_AUTH_READ']);
|
||||
}
|
||||
|
||||
login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', htmlspecialchars($_SERVER['REQUEST_URI'])), '', $user->lang['LOGIN_VIEWFORUM']);
|
||||
login_box($user->cur_page, '', $user->lang['LOGIN_VIEWFORUM']);
|
||||
}
|
||||
|
||||
// Forum is passworded ... check whether access has been granted to this
|
||||
|
@ -334,7 +334,7 @@ if ($hilit_words)
|
|||
|
||||
// Forum rules listing
|
||||
$s_forum_rules = '';
|
||||
gen_forum_rules('topic', $forum_id);
|
||||
gen_forum_auth_level('topic', $forum_id);
|
||||
|
||||
// Quick mod tools
|
||||
$topic_mod = '';
|
||||
|
@ -357,6 +357,9 @@ $pagination = generate_pagination($pagination_url, $total_posts, $config['posts_
|
|||
// Navigation links
|
||||
generate_forum_nav($topic_data);
|
||||
|
||||
// Forum Rules
|
||||
generate_forum_rules($topic_data);
|
||||
|
||||
// Moderators
|
||||
$forum_moderators = array();
|
||||
get_moderators($forum_moderators, $forum_id);
|
||||
|
@ -663,7 +666,7 @@ while ($row = $db->sql_fetchrow($result))
|
|||
if ($row['foe'])
|
||||
{
|
||||
$rowset[$row['post_id']] = array(
|
||||
'foe' => TRUE,
|
||||
'foe' => true,
|
||||
'post_id' => $row['post_id'],
|
||||
'poster' => $poster,
|
||||
);
|
||||
|
@ -728,8 +731,6 @@ while ($row = $db->sql_fetchrow($result))
|
|||
'joined' => '',
|
||||
'posts' => '',
|
||||
'from' => '',
|
||||
'karma' => 0,
|
||||
'karma_img' => '',
|
||||
|
||||
'sig' => '',
|
||||
'sig_bbcode_uid' => '',
|
||||
|
@ -971,7 +972,7 @@ for ($i = 0; $i < count($post_list); ++$i)
|
|||
// i) The posters karma is below the minimum of the user ... not in 2.2.x
|
||||
// ii) The poster is on the users ignore list
|
||||
// iii) The post was made in a codepage different from the users
|
||||
if ($row['foe'])
|
||||
if (isset($row['foe']) && $row['foe'])
|
||||
{
|
||||
$template->assign_block_vars('postrow', array(
|
||||
'S_IGNORE_POST' => true,
|
||||
|
|
Loading…
Add table
Reference in a new issue