1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-20 23:51:28 +01:00

[ticket/14804] Merge remote-tracking branch 'upstream/3.1.x' into ticket/14804

PHPBB3-14804
This commit is contained in:
Daniel Sinn 2016-10-03 10:24:30 -04:00
commit 59b52d6312
10 changed files with 111 additions and 18 deletions

View File

@ -49,7 +49,7 @@
-->
<target name="composer">
<exec dir="phpBB"
command="php ../composer.phar install"
command="php ../composer.phar install --ignore-platform-reqs"
checkreturn="true"
passthru="true" />
</target>
@ -270,7 +270,7 @@
command="git archive ${revision} composer.phar | tar -xf - -C ${dir}"
checkreturn="true" />
<exec dir="${dir}"
command="php composer.phar install --no-dev --optimize-autoloader"
command="php composer.phar install --no-dev --optimize-autoloader --ignore-platform-reqs"
checkreturn="true"
passthru="true" />
<delete file="${dir}/composer.phar" />

View File

@ -794,6 +794,22 @@ mcp_ban_unban_before
* Since: 3.1.0-RC3
* Purpose: Add additional fields to the unban form in MCP
mcp_forum_actions_after
===
* Locations:
+ styles/prosilver/template/mcp_forum.html
+ styles/subsilver2/template/mcp_forum.html
* Since: 3.1.11-RC1
* Purpose: Add some information after actions fieldset
mcp_forum_actions_before
===
* Locations:
+ styles/prosilver/template/mcp_forum.html
+ styles/subsilver2/template/mcp_forum.html
* Since: 3.1.11-RC1
* Purpose: Add some information before actions fieldset
mcp_forum_topic_title_before
===
* Locations:

View File

@ -42,11 +42,6 @@ class acp_database
$form_key = 'acp_database';
add_form_key($form_key);
if ($submit && !check_form_key($form_key))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$template->assign_vars(array(
'MODE' => $mode
));
@ -70,6 +65,11 @@ class acp_database
trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!check_form_key($form_key))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$store = $download = $structure = $schema_data = false;
if ($where == 'store_and_download' || $where == 'store')

View File

@ -45,11 +45,6 @@ class acp_icons
$form_key = 'acp_icons';
add_form_key($form_key);
if ($submit && !check_form_key($form_key))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$mode = ($mode == 'smilies') ? 'smilies' : 'icons';
$this->tpl_name = 'acp_icons';
@ -334,6 +329,11 @@ class acp_icons
case 'create':
case 'modify':
if (!check_form_key($form_key))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Get items to create/modify
$images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
@ -522,6 +522,11 @@ class acp_icons
{
$order = 0;
if (!check_form_key($form_key))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
{
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
@ -707,7 +712,7 @@ class acp_icons
$template->assign_vars(array(
'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang],
'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&amp;action=send">', '</a>'),
'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&amp;action=send&amp;hash=' . generate_link_hash('acp_icons') . '">', '</a>'),
'S_USER_NOTICE' => true,
)
@ -719,6 +724,11 @@ class acp_icons
case 'send':
if (!check_link_hash($request->variable('hash', ''), 'acp_icons'))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = "SELECT *
FROM $table
ORDER BY {$fields}_order";

View File

@ -2274,6 +2274,12 @@ class acp_users
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if (!check_link_hash($request->variable('hash', ''), 'acp_users'))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
group_user_attributes($action, $group_id, $user_id);
if ($action == 'default')
@ -2431,8 +2437,8 @@ class acp_users
{
$template->assign_block_vars('group', array(
'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&amp;action=approve&amp;u=$user_id&amp;g=" . $data['group_id'] : '',

View File

@ -420,9 +420,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
}
$sync_forums = array();
$topic_views = 0;
foreach ($all_topic_data as $data)
{
$sync_forums[$data['forum_id']] = $data['forum_id'];
$topic_views += $data['topic_views'];
}
$to_topic_data = $all_topic_data[$to_topic_id];
@ -478,6 +480,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
move_posts($post_id_list, $to_topic_id, false);
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $to_topic_data['topic_title']);
// Update topic views count
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_views = ' . $topic_views . '
WHERE topic_id = ' . $to_topic_id;
$db->sql_query($sql);
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';

View File

@ -0,0 +1,46 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v31x;
class add_log_time_index extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\v319',
);
}
public function update_schema()
{
return array(
'add_index' => array(
$this->table_prefix . 'log' => array(
'log_time' => array('log_time'),
),
),
);
}
public function revert_schema()
{
return array(
'drop_keys' => array(
$this->table_prefix . 'log' => array(
'log_time',
),
),
);
}
}

View File

@ -690,8 +690,10 @@ if ($keywords || $author || $author_id || $search_id || $submit)
* @var string show_results String indicating the show results mode
* @var string sql_where The SQL WHERE string used by search to get topic data
* @var int total_match_count The total number of search matches
* @var array ex_fid_ary Array of excluded forum ids
* @since 3.1.7-RC1
* @changed 3.1.10-RC1 Added show_results, sql_where, total_match_count
* @changed 3.1.11-RC1 Added ex_fid_ary
*/
$vars = array(
'u_search',
@ -699,6 +701,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'show_results',
'sql_where',
'total_match_count',
'ex_fid_ary',
);
extract($phpbb_dispatcher->trigger_event('core.search_modify_url_parameters', compact($vars)));
@ -1060,7 +1063,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id", true, $user->session_id) : '';
$u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;mode=deleted_topics&amp;t=$result_topic_id", true, $user->session_id) : $u_mcp_queue;
$row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['topic_title']);
$row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $row['topic_title']);
$tpl_ary = array(
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@ -1143,8 +1146,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($hilit)
{
// post highlighting
$row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['post_text']);
$row['post_subject'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['post_subject']);
$row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $row['post_text']);
$row['post_subject'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $row['post_subject']);
}
$tpl_ary = array(

View File

@ -120,6 +120,7 @@
</div>
</div>
<!-- EVENT mcp_forum_actions_before -->
<fieldset class="display-actions">
<!-- IF not S_MERGE_SELECT -->
<select name="action">
@ -143,6 +144,7 @@
<!-- ENDIF -->
{S_FORM_TOKEN}
</fieldset>
<!-- EVENT mcp_forum_actions_after -->
</form>
<!-- INCLUDE mcp_footer.html -->

View File

@ -58,6 +58,7 @@
<td class="row1" colspan="8" align="center"><p class="gen">{L_NO_TOPICS}</p></td>
</tr>
<!-- END topicrow -->
<!-- EVENT mcp_forum_actions_before -->
<!-- IF not S_MERGE_SELECT -->
<tr>
<td class="cat" colspan="6" align="{S_CONTENT_FLOW_END}">
@ -81,6 +82,7 @@
</td>
</tr>
<!-- ENDIF -->
<!-- EVENT mcp_forum_actions_after -->
</table>
{S_FORM_TOKEN}
</form>