- some bugfixes

- set ip_check to A.B.C. by default
- display postings in other encodings by default and present link to force the encoding as usual.


git-svn-id: file:///svn/phpbb/trunk@6198 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-07-20 21:45:24 +00:00
parent 3f3db8cdaa
commit 73ac6b1423
19 changed files with 56 additions and 42 deletions

View file

@ -101,6 +101,10 @@
<dt><label>{L_LAST_ACTIVE}:</label></dt>
<dd><strong>{USER_LASTACTIVE}</strong></dd>
</dl>
<dl>
<dt><label>{L_POSTS}:</label></dt>
<dd><strong>{USER_POSTS}</strong></dd>
</dl>
<dl>
<dt><label for="user_founder">{L_FOUNDER}:</label><br /><span>{L_FOUNDER_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="user_founder" value="1"<!-- IF S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp; <input type="radio" class="radio" name="user_founder" value="0"<!-- IF not S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> />&nbsp;{L_NO}&nbsp;</dd>

View file

@ -342,7 +342,20 @@ class acp_forums
$forum_data = $row;
}
$parents_list = make_forum_select($forum_data['parent_id'], $forum_id, false, false, false);
// Make sure there is no forum displayed for parents_list having the current forum id as a parent...
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE parent_id = ' . $forum_id;
$result = $db->sql_query($sql);
$exclude_forums = array($forum_id);
while ($row = $db->sql_fetchrow($result))
{
$exclude_forums[] = $row['forum_id'];
}
$db->sql_freeresult($result);
$parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false);
$forum_data['forum_password_confirm'] = $forum_data['forum_password'];
}

View file

@ -242,6 +242,7 @@ class acp_main
}
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
break;
case 'date':

View file

@ -809,6 +809,7 @@ class acp_users
'USER_LASTACTIVE' => ($user_row['user_lastvisit']) ? $user->format_date($user_row['user_lastvisit']) : ' - ',
'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],
)
);
@ -1159,7 +1160,7 @@ class acp_users
$var_ary = array(
'dateformat' => array('string', false, 3, 30),
'lang' => array('match', false, '#^[a-z_]{2,}$#i'),
'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'),
'tz' => array('num', false, -14, 14),
'topic_sk' => array('string', false, 1, 1),

View file

@ -10,16 +10,10 @@
/**
* Recalculate Binary Tree
*/
function recalc_btree($sql_id, $sql_table, $module_class = '')
{
global $db;
/* Init table, id's, etc...
$sql_id = 'module_id'; // 'forum_id'
$sql_table = MODULES_TABLE; // FORUMS_TABLE
*/
if (!$sql_id || !$sql_table)
{
return;
@ -103,6 +97,7 @@ function recalc_btree($sql_id, $sql_table, $module_class = '')
}
$db->sql_freeresult($f_result);
}
*/
/**
* Simple version of jumpbox, just lists authed forums
@ -498,7 +493,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
}
$return = array(
'posts' => delete_posts($where_type, $where_ids, false, false)
'posts' => delete_posts($where_type, $where_ids, false, true)
);
$sql = 'SELECT topic_id, forum_id

View file

@ -1134,10 +1134,10 @@ function display_user_activity(&$userdata)
$template->assign_vars(array(
'ACTIVE_FORUM' => $active_f_name,
'ACTIVE_FORUM_POSTS' => ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count),
'ACTIVE_FORUM_PCT' => sprintf($user->lang['POST_PCT'], $active_f_pct),
'ACTIVE_FORUM_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_f_pct),
'ACTIVE_TOPIC' => censor_text($active_t_name),
'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT'], $active_t_pct),
'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_t_pct),
'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id),
'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id))
);

View file

@ -1175,7 +1175,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
{
case 'delete_topic':
delete_topics('topic_id', array($topic_id), false);
set_config('num_topics', $config['num_topics'] - 1, true);
if ($data['topic_type'] != POST_GLOBAL)
{
@ -1269,7 +1268,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
}
$sql_data[USERS_TABLE] = ($auth->acl_get('f_postcount', $forum_id)) ? 'user_posts = user_posts - 1' : '';
set_config('num_posts', $config['num_posts'] - 1, true);
$db->sql_transaction('begin');

View file

@ -583,7 +583,7 @@ function mcp_delete_topic($topic_ids)
add_log('mod', $forum_id, 0, 'LOG_TOPIC_DELETED', $row['topic_title']);
}
$return = delete_topics('topic_id', $topic_ids, true);
$return = delete_topics('topic_id', $topic_ids);
}
else
{

View file

@ -61,7 +61,7 @@ class ucp_prefs
$var_ary = array(
'dateformat' => array('string', false, 3, 30),
'lang' => array('match', false, '#^[a-z_]{2,}$#i'),
'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'),
'tz' => array('num', false, -14, 14),
);

View file

@ -125,7 +125,7 @@ class ucp_register
'email_confirm' => array('string', false, 6, 60),
'confirm_code' => array('string', !$config['enable_confirm'], 5, 8),
'tz' => array('num', false, -14, 14),
'lang' => array('match', false, '#^[a-z_]{2,}$#i'),
'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'),
);
$error = validate_data($data, $var_ary);

View file

@ -97,7 +97,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_width', '
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_height', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_width', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_min_thumb_filesize', '12000');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '4');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '3');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', '');

View file

@ -245,7 +245,7 @@ $lang = array_merge($lang, array(
'PARSE_BBCODE' => 'Parse BBCode',
'PARSE_SMILIES' => 'Parse Smilies',
'PARSE_URLS' => 'Parse Links',
'PROCEED_TO_ACP' => 'Click %sHere%s to proceed to the ACP',
'PROCEED_TO_ACP' => '%sProceed to the ACP%s',
'REMIND' => 'Remind',
'REORDER' => 'Reorder',
'RESYNC' => 'Sync',

View file

@ -352,11 +352,12 @@ $lang = array_merge($lang, array(
'POSTED' => 'Posted',
'POSTS' => 'Posts',
'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved',
'POST_BY_FOE' => 'This post was made by <strong>%1$s</strong> who is currently on your ignore list. To display this post click %2$sHERE%3$s.',
'POST_BY_FOE' => 'This post was made by <strong>%1$s</strong> who is currently on your ignore list. %2$sDisplay this post%3$s.',
'POST_DAY' => '%.2f posts per day',
'POST_DETAILS' => 'Post details',
'POST_NEW_TOPIC' => 'Post new topic',
'POST_PCT' => '%.2f%% of all posts',
'POST_PCT_ACTIVE' => '%.2f%% of your posts',
'POST_REPORTED' => 'Click to view report',
'POST_SUBJECT' => 'Post subject',
'POST_TIME' => 'Post time',

View file

@ -73,7 +73,7 @@ $lang = array_merge($lang, array(
'POLL_RUN_TILL' => 'Poll runs till %s',
'POLL_VOTED_OPTION' => 'You voted for this option',
'POST_ENCODING' => 'This post by <strong>%1$s</strong> was made in a character set different to yours. To view this post in its proper encoding click %2$sHERE%3$s.',
'POST_ENCODING' => 'This post by <strong>%1$s</strong> was made in a character set different to yours. %2$sView this post in its proper encoding%3$s.',
'PRINT_TOPIC' => 'Print view',
'QUICK_MOD' => 'Quick-mod tools',

View file

@ -648,10 +648,12 @@ switch ($mode)
'email_lang' => $email_lang,
'email' => $email,
'name' => $name,
'username' => $row['username'],
'username' => ($user_id) ? $row['username'] : '',
'to_name' => $name,
'user_jabber' => $row['user_jabber'],
'user_notify_type' => $row['user_notify_type'],
'user_jabber' => ($user_id) ? $row['user_jabber'] : '',
'user_notify_type' => ($user_id) ? $row['user_notify_type'] : NOTIFY_EMAIL,
'topic_title' => (!$user_id) ? $row['topic_title'] : '',
'forum_id' => (!$user_id) ? $row['forum_id'] : 0,
);
// Ok, now the same email if CC specified, but without exposing the users email address
@ -665,6 +667,8 @@ switch ($mode)
'to_name' => $name,
'user_jabber' => $user->data['user_jabber'],
'user_notify_type' => ($user_id) ? $user->data['user_notify_type'] : NOTIFY_EMAIL,
'topic_title' => (!$user_id) ? $row['topic_title'] : '',
'forum_id' => (!$user_id) ? $row['forum_id'] : 0,
);
}

View file

@ -63,7 +63,7 @@
<td class="row2">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td><textarea class="post" name="comment_list[{attach_row.ASSOC_INDEX}]" rows="3" cols="35" wrap="virtual" size=40>{attach_row.FILE_COMMENT}</textarea>&nbsp;</td>
<td><textarea class="post" name="comment_list[{attach_row.ASSOC_INDEX}]" rows="3" cols="35" wrap="virtual" size="40">{attach_row.FILE_COMMENT}</textarea>&nbsp;</td>
<td valign="top">
<table border="0" cellspacing="4" cellpadding="0">
<tr>

View file

@ -132,6 +132,13 @@
<!-- IF postrow.S_IGNORE_POST -->
<td class="gensmall" colspan="2" height="25" align="center">{postrow.L_IGNORE_POST}</td>
<!-- ELSE -->
<!-- IF postrow.FORCE_ENCODING -->
<td class="gensmall" colspan="2" height="25" align="center">{postrow.FORCE_ENCODING}</td>
</tr>
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<!-- ENDIF -->
<td align="center" valign="middle"><!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a><b class="postauthor">{postrow.POSTER_NAME}</b></td>
<td width="100%" height="25">
<table width="100%" cellspacing="0">

View file

@ -60,13 +60,13 @@ hr.sep {
<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
<tr>
<td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall">{U_FORUM}</a></span></td>
<td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall"><a href="{U_FORUM}">{U_FORUM}</a></span></td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td><span class="topic">{TOPIC_TITLE}</span><br /><span class="gensmall">{U_TOPIC}</a></span></td>
<td><span class="topic">{TOPIC_TITLE}</span><br /><span class="gensmall"><a href="{U_TOPIC}">{U_TOPIC}</a></span></td>
<td align="right" valign="bottom"><span class="gensmall">{PAGE_NUMBER}</span></td>
</tr>
</table>

View file

@ -1204,7 +1204,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
// Two situations can prevent a post being display:
// i) The poster is on the users ignore list
// ii) The post was made in a codepage different from the users
if (isset($row['foe']) && $row['foe'])
if (!empty($row['foe']))
{
$template->assign_block_vars('postrow', array(
'S_IGNORE_POST' => true,
@ -1213,22 +1213,10 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
continue;
}
else if ($row['post_encoding'] != $user->lang['ENCODING'])
{
if ($view == 'encoding' && $post_id == $row['post_id'])
else if ($row['post_encoding'] != $user->lang['ENCODING'] && $view == 'encoding' && $post_id == $row['post_id'])
{
$force_encoding = $row['post_encoding'];
}
else
{
$template->assign_block_vars('postrow', array(
'S_IGNORE_POST' => true,
'L_IGNORE_POST' => sprintf($user->lang['POST_ENCODING'], $row['poster'], '<a href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=encoding#p{$row['post_id']}" . '">', '</a>'))
);
continue;
}
}
// End signature parsing, only if needed
if ($user_cache[$poster_id]['sig'] && empty($user_cache[$poster_id]['sig_parsed']))
@ -1383,6 +1371,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('btn_online', 'ONLINE') : $user->img('btn_offline', 'OFFLINE')),
'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
'FORCE_ENCODING' => ($row['post_encoding'] != $user->lang['ENCODING']) ? sprintf($user->lang['POST_ENCODING'], $row['poster'], '<a href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=encoding#p{$row['post_id']}" . '">', '</a>') : '',
'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',