mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Merge remote-tracking branch 'upstream/3.1.x' into ticket/14638-3.1.x
This commit is contained in:
@@ -449,7 +449,7 @@ class acp_board
|
||||
|
||||
'legend2' => 'SMTP_SETTINGS',
|
||||
'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false),
|
||||
'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true),
|
||||
'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true),
|
||||
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
|
||||
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
|
||||
|
@@ -453,6 +453,12 @@ class acp_main
|
||||
$template->assign_var('S_VERSION_UP_TO_DATE', true);
|
||||
}
|
||||
|
||||
// Incomplete update?
|
||||
if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
|
||||
{
|
||||
$template->assign_var('S_UPDATE_INCOMPLETE', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notice admin
|
||||
*
|
||||
|
@@ -62,5 +62,17 @@ class acp_update
|
||||
|
||||
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link),
|
||||
));
|
||||
|
||||
// Incomplete update?
|
||||
if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
|
||||
{
|
||||
$database_update_link = append_sid($phpbb_root_path . 'install/database_update.' . $phpEx);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_UPDATE_INCOMPLETE' => true,
|
||||
'FILES_VERSION' => PHPBB_VERSION,
|
||||
'INCOMPLETE_INSTRUCTIONS' => $user->lang('UPDATE_INCOMPLETE_EXPLAIN', $database_update_link),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4334,6 +4334,30 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify online userlist data
|
||||
*
|
||||
* @event core.obtain_users_online_string_before_modify
|
||||
* @var array online_users Array with online users data
|
||||
* from obtain_users_online()
|
||||
* @var int item_id Restrict online users to item id
|
||||
* @var string item Restrict online users to a certain
|
||||
* session item, e.g. forum for
|
||||
* session_forum_id
|
||||
* @var array rowset Array with online users data
|
||||
* @var array user_online_link Array with online users items (usernames)
|
||||
* @since 3.1.10-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'online_users',
|
||||
'item_id',
|
||||
'item',
|
||||
'rowset',
|
||||
'user_online_link',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_before_modify', compact($vars)));
|
||||
|
||||
$online_userlist = implode(', ', $user_online_link);
|
||||
|
||||
if (!$online_userlist)
|
||||
|
@@ -201,7 +201,7 @@ function group_select_options($group_id, $exclude_ids = false, $manage_founder =
|
||||
*/
|
||||
function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = false, $no_cache = false)
|
||||
{
|
||||
global $db, $auth;
|
||||
global $db, $auth, $phpbb_dispatcher;
|
||||
static $forum_rows;
|
||||
|
||||
if (!isset($forum_rows))
|
||||
@@ -256,6 +256,16 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only =
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify the forum list data
|
||||
*
|
||||
* @event core.get_forum_list_modify_data
|
||||
* @var array rowset Array with the forum list data
|
||||
* @since 3.1.10-RC1
|
||||
*/
|
||||
$vars = array('rowset');
|
||||
extract($phpbb_dispatcher->trigger_event('core.get_forum_list_modify_data', compact($vars)));
|
||||
|
||||
return $rowset;
|
||||
}
|
||||
|
||||
@@ -2531,7 +2541,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
||||
/**
|
||||
* Prune function
|
||||
*/
|
||||
function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true)
|
||||
function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true, $prune_limit = 0)
|
||||
{
|
||||
global $db, $phpbb_dispatcher;
|
||||
|
||||
@@ -2583,9 +2593,19 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
|
||||
* @var int prune_flags The prune flags
|
||||
* @var bool auto_sync Whether or not to perform auto sync
|
||||
* @var string sql_and SQL text appended to where clause
|
||||
* @var int prune_limit The prune limit
|
||||
* @since 3.1.3-RC1
|
||||
* @changed 3.1.10-RC1 Added prune_limit
|
||||
*/
|
||||
$vars = array('forum_id', 'prune_mode', 'prune_date', 'prune_flags', 'auto_sync', 'sql_and');
|
||||
$vars = array(
|
||||
'forum_id',
|
||||
'prune_mode',
|
||||
'prune_date',
|
||||
'prune_flags',
|
||||
'auto_sync',
|
||||
'sql_and',
|
||||
'prune_limit',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.prune_sql', compact($vars)));
|
||||
|
||||
$sql = 'SELECT topic_id
|
||||
@@ -2593,7 +2613,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
|
||||
WHERE ' . $db->sql_in_set('forum_id', $forum_id) . "
|
||||
AND poll_start = 0
|
||||
$sql_and";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query_limit($sql, $prune_limit);
|
||||
|
||||
$topic_list = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -2610,7 +2630,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
|
||||
AND poll_start > 0
|
||||
AND poll_last_vote < $prune_date
|
||||
$sql_and";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query_limit($sql, $prune_limit);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -2643,12 +2663,15 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
|
||||
$prune_date = time() - ($prune_days * 86400);
|
||||
$next_prune = time() + ($prune_freq * 86400);
|
||||
|
||||
prune($forum_id, $prune_mode, $prune_date, $prune_flags, true);
|
||||
$result = prune($forum_id, $prune_mode, $prune_date, $prune_flags, true, 300);
|
||||
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET prune_next = $next_prune
|
||||
WHERE forum_id = $forum_id";
|
||||
$db->sql_query($sql);
|
||||
if ($result['topics'] == 0 && $result['posts'] == 0)
|
||||
{
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET prune_next = $next_prune
|
||||
WHERE forum_id = $forum_id";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_AUTO_PRUNE', $row['forum_name']);
|
||||
}
|
||||
|
@@ -150,7 +150,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
|
||||
*/
|
||||
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false)
|
||||
{
|
||||
global $config, $auth, $template, $user, $db, $phpbb_path_helper;
|
||||
global $config, $auth, $template, $user, $db, $phpbb_path_helper, $phpbb_dispatcher;
|
||||
|
||||
// We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality)
|
||||
if (!$config['load_jumpbox'] && $force_display === false)
|
||||
@@ -205,20 +205,21 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
|
||||
continue;
|
||||
}
|
||||
|
||||
$tpl_ary = array();
|
||||
if (!$display_jumpbox)
|
||||
{
|
||||
$template->assign_block_vars('jumpbox_forums', array(
|
||||
$tpl_ary[] = array(
|
||||
'FORUM_ID' => ($select_all) ? 0 : -1,
|
||||
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
|
||||
'S_FORUM_COUNT' => $iteration,
|
||||
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),
|
||||
));
|
||||
);
|
||||
|
||||
$iteration++;
|
||||
$display_jumpbox = true;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('jumpbox_forums', array(
|
||||
$tpl_ary[] = array(
|
||||
'FORUM_ID' => $row['forum_id'],
|
||||
'FORUM_NAME' => $row['forum_name'],
|
||||
'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '',
|
||||
@@ -227,7 +228,25 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
|
||||
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
|
||||
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
|
||||
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),
|
||||
));
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify the jumpbox before it is assigned to the template
|
||||
*
|
||||
* @event core.make_jumpbox_modify_tpl_ary
|
||||
* @var array row The data of the forum
|
||||
* @var array tpl_ary Template data of the forum
|
||||
* @since 3.1.10-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'row',
|
||||
'tpl_ary',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.make_jumpbox_modify_tpl_ary', compact($vars)));
|
||||
|
||||
$template->assign_block_vars_array('jumpbox_forums', $tpl_ary);
|
||||
|
||||
unset($tpl_ary);
|
||||
|
||||
for ($i = 0; $i < $padding; $i++)
|
||||
{
|
||||
|
@@ -166,7 +166,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
}
|
||||
|
||||
// Make sure the database record for the filesize is correct
|
||||
if ($size > 0 && $size != $attachment['filesize'])
|
||||
if ($size > 0 && $size != $attachment['filesize'] && strpos($attachment['physical_filename'], 'thumb_') === false)
|
||||
{
|
||||
// Update database record
|
||||
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
|
||||
|
@@ -702,7 +702,7 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||
|
||||
$used_imagick = false;
|
||||
|
||||
// Only use imagemagick if defined and the passthru function not disabled
|
||||
// Only use ImageMagick if defined and the passthru function not disabled
|
||||
if ($config['img_imagick'] && function_exists('passthru'))
|
||||
{
|
||||
if (substr($config['img_imagick'], -1) !== '/')
|
||||
|
@@ -119,19 +119,29 @@ function user_update_name($old_name, $new_name)
|
||||
global $config, $db, $cache, $phpbb_dispatcher;
|
||||
|
||||
$update_ary = array(
|
||||
FORUMS_TABLE => array('forum_last_poster_name'),
|
||||
MODERATOR_CACHE_TABLE => array('username'),
|
||||
POSTS_TABLE => array('post_username'),
|
||||
TOPICS_TABLE => array('topic_first_poster_name', 'topic_last_poster_name'),
|
||||
FORUMS_TABLE => array(
|
||||
'forum_last_poster_id' => 'forum_last_poster_name',
|
||||
),
|
||||
MODERATOR_CACHE_TABLE => array(
|
||||
'user_id' => 'username',
|
||||
),
|
||||
POSTS_TABLE => array(
|
||||
'poster_id' => 'post_username',
|
||||
),
|
||||
TOPICS_TABLE => array(
|
||||
'topic_poster' => 'topic_first_poster_name',
|
||||
'topic_last_poster_id' => 'topic_last_poster_name',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($update_ary as $table => $field_ary)
|
||||
{
|
||||
foreach ($field_ary as $field)
|
||||
foreach ($field_ary as $id_field => $name_field)
|
||||
{
|
||||
$sql = "UPDATE $table
|
||||
SET $field = '" . $db->sql_escape($new_name) . "'
|
||||
WHERE $field = '" . $db->sql_escape($old_name) . "'";
|
||||
SET $name_field = '" . $db->sql_escape($new_name) . "'
|
||||
WHERE $name_field = '" . $db->sql_escape($old_name) . "'
|
||||
AND $id_field <> " . ANONYMOUS;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
@@ -751,6 +751,34 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
$enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1;
|
||||
$enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false);
|
||||
|
||||
/**
|
||||
* Modify private message
|
||||
*
|
||||
* @event core.ucp_pm_compose_modify_parse_before
|
||||
* @var bool enable_bbcode Whether or not bbcode is enabled
|
||||
* @var bool enable_smilies Whether or not smilies are enabled
|
||||
* @var bool enable_urls Whether or not urls are enabled
|
||||
* @var bool enable_sig Whether or not signature is enabled
|
||||
* @var string subject PM subject text
|
||||
* @var object message_parser The message parser object
|
||||
* @var bool submit Whether or not the form has been sumitted
|
||||
* @var bool preview Whether or not the signature is being previewed
|
||||
* @var array error Any error strings
|
||||
* @since 3.1.10-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'enable_bbcode',
|
||||
'enable_smilies',
|
||||
'enable_urls',
|
||||
'enable_sig',
|
||||
'subject',
|
||||
'message_parser',
|
||||
'submit',
|
||||
'preview',
|
||||
'error',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_parse_before', compact($vars)));
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1);
|
||||
|
@@ -479,6 +479,32 @@ class ucp_profile
|
||||
{
|
||||
$message_parser = new parse_message($signature);
|
||||
|
||||
/**
|
||||
* Modify user signature on editing profile in UCP
|
||||
*
|
||||
* @event core.ucp_profile_modify_signature
|
||||
* @var bool enable_bbcode Whether or not bbcode is enabled
|
||||
* @var bool enable_smilies Whether or not smilies are enabled
|
||||
* @var bool enable_urls Whether or not urls are enabled
|
||||
* @var string signature Users signature text
|
||||
* @var object message_parser The message parser object
|
||||
* @var array error Any error strings
|
||||
* @var bool submit Whether or not the form has been sumitted
|
||||
* @var bool preview Whether or not the signature is being previewed
|
||||
* @since 3.1.10-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'enable_bbcode',
|
||||
'enable_smilies',
|
||||
'enable_urls',
|
||||
'signature',
|
||||
'message_parser',
|
||||
'error',
|
||||
'submit',
|
||||
'preview',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature', compact($vars)));
|
||||
|
||||
// Allowing Quote BBCode
|
||||
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');
|
||||
|
||||
@@ -505,6 +531,16 @@ class ucp_profile
|
||||
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify user registration data before submitting it to the database
|
||||
*
|
||||
* @event core.ucp_profile_modify_signature_sql_ary
|
||||
* @var array sql_ary Array with user signature data to submit to the database
|
||||
* @since 3.1.10-RC1
|
||||
*/
|
||||
$vars = array('sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature_sql_ary', compact($vars)));
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
|
Reference in New Issue
Block a user