mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge most changes from 3.0.x branch since the 25th december.
(Captcha changes for refreshing captcha image not included) git-svn-id: file:///svn/phpbb/trunk@9404 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -615,7 +615,7 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||
phpbb::$config['img_imagick'] .= '/';
|
||||
}
|
||||
|
||||
@passthru(escapeshellcmd(phpbb::$config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"');
|
||||
@passthru(escapeshellcmd(phpbb::$config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -geometry ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" "' . str_replace('\\', '/', $destination) . '"');
|
||||
|
||||
if (file_exists($destination))
|
||||
{
|
||||
@@ -940,13 +940,20 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||
}
|
||||
|
||||
$sql = phpbb::$db->sql_build_query('SELECT', array(
|
||||
'SELECT' => 'u.username, u.user_id, u.user_colour, p.*',
|
||||
'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe',
|
||||
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
POSTS_TABLE => 'p',
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(ZEBRA_TABLE => 'z'),
|
||||
'ON' => 'z.user_id = ' . phpbb::$user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
|
||||
)
|
||||
),
|
||||
|
||||
'WHERE' => phpbb::$db->sql_in_set('p.post_id', $post_list) . '
|
||||
AND u.user_id = p.poster_id'
|
||||
));
|
||||
@@ -1037,6 +1044,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||
|
||||
$post_subject = censor_text($post_subject);
|
||||
|
||||
$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
|
||||
$u_show_post = append_sid('viewtopic', "f=$forum_id&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}");
|
||||
|
||||
phpbb::$template->assign_block_vars($mode . '_row', array(
|
||||
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||
@@ -1044,6 +1054,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||
'U_POST_AUTHOR' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||
|
||||
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
|
||||
'S_FRIEND' => ($row['friend']) ? true : false,
|
||||
'S_IGNORE_POST' => ($row['foe']) ? true : false,
|
||||
'L_IGNORE_POST' => ($row['foe']) ? phpbb::$user->lang('POST_BY_FOE', get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"dE('{$post_anchor}', 1); return false;\">", '</a>') : '',
|
||||
|
||||
'POST_SUBJECT' => $post_subject,
|
||||
'MINI_POST_IMG' => phpbb::$user->img('icon_post_target', 'POST'),
|
||||
@@ -1708,11 +1721,23 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
|
||||
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
|
||||
{
|
||||
$poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
|
||||
$poll_length = $poll['poll_length'] * 86400;
|
||||
if ($poll_length < 0)
|
||||
{
|
||||
$poll_start = $poll_start + $poll_length;
|
||||
if ($poll_start < 0)
|
||||
{
|
||||
$poll_start = 0;
|
||||
}
|
||||
$poll_length = 1;
|
||||
}
|
||||
|
||||
$sql_data[TOPICS_TABLE]['sql'] = array_merge($sql_data[TOPICS_TABLE]['sql'], array(
|
||||
'poll_title' => $poll['poll_title'],
|
||||
'poll_start' => ($poll['poll_start']) ? $poll['poll_start'] : $current_time,
|
||||
'poll_start' => $poll_start,
|
||||
'poll_max_options' => $poll['poll_max_options'],
|
||||
'poll_length' => ($poll['poll_length'] * 86400),
|
||||
'poll_length' => $poll_length,
|
||||
'poll_vote_change' => $poll['poll_vote_change'])
|
||||
);
|
||||
}
|
||||
@@ -1741,6 +1766,20 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
|
||||
case 'edit_topic':
|
||||
case 'edit_first_post':
|
||||
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
|
||||
{
|
||||
$poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
|
||||
$poll_length = $poll['poll_length'] * 86400;
|
||||
if ($poll_length < 0)
|
||||
{
|
||||
$poll_start = $poll_start + $poll_length;
|
||||
if ($poll_start < 0)
|
||||
{
|
||||
$poll_start = 0;
|
||||
}
|
||||
$poll_length = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$sql_data[TOPICS_TABLE]['sql'] = array(
|
||||
'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
|
||||
@@ -1751,9 +1790,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
'topic_type' => $topic_type,
|
||||
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
|
||||
'poll_title' => (isset($poll['poll_options'])) ? $poll['poll_title'] : '',
|
||||
'poll_start' => (isset($poll['poll_options'])) ? (($poll['poll_start']) ? $poll['poll_start'] : $current_time) : 0,
|
||||
'poll_start' => (isset($poll['poll_options'])) ? $poll_start : 0,
|
||||
'poll_max_options' => (isset($poll['poll_options'])) ? $poll['poll_max_options'] : 1,
|
||||
'poll_length' => (isset($poll['poll_options'])) ? ($poll['poll_length'] * 86400) : 0,
|
||||
'poll_length' => (isset($poll['poll_options'])) ? $poll_length : 0,
|
||||
'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0,
|
||||
|
||||
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0),
|
||||
@@ -1780,8 +1819,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics = forum_topics - 1';
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($topic_row['topic_replies'] + 1);
|
||||
|
||||
set_config('num_topics', phpbb::$config['num_topics'] - 1, true);
|
||||
set_config('num_posts', phpbb::$config['num_posts'] - ($topic_row['topic_replies'] + 1), true);
|
||||
set_config_count('num_topics', -1, true);
|
||||
set_config_count('num_posts', ($topic_row['topic_replies'] + 1) * (-1), true);
|
||||
|
||||
// Only decrement this post, since this is the one non-approved now
|
||||
if (phpbb::$acl->acl_get('f_postcount', $data['forum_id']))
|
||||
@@ -1801,7 +1840,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
$sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1';
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - 1';
|
||||
|
||||
set_config('num_posts', phpbb::$config['num_posts'] - 1, true);
|
||||
set_config_count('num_posts', -1, true);
|
||||
|
||||
if (phpbb::$acl->acl_get('f_postcount', $data['forum_id']))
|
||||
{
|
||||
@@ -2068,8 +2107,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
|
||||
if ($space_taken && $files_added)
|
||||
{
|
||||
set_config('upload_dir_size', phpbb::$config['upload_dir_size'] + $space_taken, true);
|
||||
set_config('num_files', phpbb::$config['num_files'] + $files_added, true);
|
||||
set_config_count('upload_dir_size', $space_taken, true);
|
||||
set_config_count('num_files', $files_added, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2302,13 +2341,13 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
{
|
||||
if ($post_mode == 'post')
|
||||
{
|
||||
set_config('num_topics', phpbb::$config['num_topics'] + 1, true);
|
||||
set_config('num_posts', phpbb::$config['num_posts'] + 1, true);
|
||||
set_config_count('num_topics', 1, true);
|
||||
set_config_count('num_posts', 1, true);
|
||||
}
|
||||
|
||||
if ($post_mode == 'reply')
|
||||
{
|
||||
set_config('num_posts', phpbb::$config['num_posts'] + 1, true);
|
||||
set_config_count('num_posts', 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user