mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 08:53:05 +02:00
Merge branch 'develop-ascraeus' into develop
This commit is contained in:
@ -914,6 +914,24 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mark_folder_read($user_id, $folder_id)
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
$sql = 'SELECT msg_id
|
||||||
|
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||||
|
WHERE folder_id = ' . ((int) $folder_id) . '
|
||||||
|
AND user_id = ' . ((int) $user_id) . '
|
||||||
|
AND pm_unread = 1';
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
update_unread_status(true, $row['msg_id'], $user_id, $folder_id);
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle all actions possible with marked messages
|
* Handle all actions possible with marked messages
|
||||||
*/
|
*/
|
||||||
|
@ -45,7 +45,7 @@ class ucp_pm
|
|||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config;
|
global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config, $request;
|
||||||
|
|
||||||
if (!$user->data['is_registered'])
|
if (!$user->data['is_registered'])
|
||||||
{
|
{
|
||||||
@ -246,6 +246,27 @@ class ucp_pm
|
|||||||
$folder_id = (int) $row['folder_id'];
|
$folder_id = (int) $row['folder_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_pms_read'))
|
||||||
|
{
|
||||||
|
mark_folder_read($user->data['user_id'], $folder_id);
|
||||||
|
|
||||||
|
meta_refresh(3, $this->u_action);
|
||||||
|
$message = $user->lang['PM_MARK_ALL_READ_SUCCESS'];
|
||||||
|
|
||||||
|
if ($request->is_ajax())
|
||||||
|
{
|
||||||
|
$json_response = new \phpbb\json_response();
|
||||||
|
$json_response->send(array(
|
||||||
|
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||||
|
'MESSAGE_TEXT' => $message,
|
||||||
|
'success' => true,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
$message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
|
||||||
|
|
||||||
|
trigger_error($message);
|
||||||
|
}
|
||||||
|
|
||||||
$message_row = array();
|
$message_row = array();
|
||||||
if ($action == 'view_message' && $msg_id)
|
if ($action == 'view_message' && $msg_id)
|
||||||
{
|
{
|
||||||
@ -332,6 +353,7 @@ class ucp_pm
|
|||||||
'U_SENTBOX' => $this->u_action . '&folder=sentbox',
|
'U_SENTBOX' => $this->u_action . '&folder=sentbox',
|
||||||
'U_CREATE_FOLDER' => $this->u_action . '&mode=options',
|
'U_CREATE_FOLDER' => $this->u_action . '&mode=options',
|
||||||
'U_CURRENT_FOLDER' => $this->u_action . '&folder=' . $folder_id,
|
'U_CURRENT_FOLDER' => $this->u_action . '&folder=' . $folder_id,
|
||||||
|
'U_MARK_ALL' => $this->u_action . '&folder=' . $folder_id . '&mark=all&token=' . generate_link_hash('mark_all_pms_read'),
|
||||||
|
|
||||||
'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false,
|
'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false,
|
||||||
'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false,
|
'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false,
|
||||||
|
@ -417,6 +417,8 @@ $lang = array_merge($lang, array(
|
|||||||
'PM_FROM_REMOVED_AUTHOR' => 'This message was sent by a user no longer registered.',
|
'PM_FROM_REMOVED_AUTHOR' => 'This message was sent by a user no longer registered.',
|
||||||
'PM_ICON' => 'PM icon',
|
'PM_ICON' => 'PM icon',
|
||||||
'PM_INBOX' => 'Inbox',
|
'PM_INBOX' => 'Inbox',
|
||||||
|
'PM_MARK_ALL_READ' => 'Mark all messages read',
|
||||||
|
'PM_MARK_ALL_READ_SUCCESS' => 'All private messages in this folder have been marked read',
|
||||||
'PM_NO_USERS' => 'The requested users to be added do not exist.',
|
'PM_NO_USERS' => 'The requested users to be added do not exist.',
|
||||||
'PM_OUTBOX' => 'Outbox',
|
'PM_OUTBOX' => 'Outbox',
|
||||||
'PM_SENTBOX' => 'Sent messages',
|
'PM_SENTBOX' => 'Sent messages',
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
<!-- IF S_VIEW_MESSAGE -->
|
<!-- IF S_VIEW_MESSAGE -->
|
||||||
<a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO_FOLDER}</a>
|
<a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO_FOLDER}</a>
|
||||||
<!-- ELSEIF FOLDER_CUR_MESSAGES neq 0 -->
|
<!-- ELSEIF FOLDER_CUR_MESSAGES neq 0 -->
|
||||||
|
<!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}" class="mark">{L_PM_MARK_ALL_READ}</a> • <!-- ENDIF -->
|
||||||
{TOTAL_MESSAGES}
|
{TOTAL_MESSAGES}
|
||||||
<!-- IF .pagination -->
|
<!-- IF .pagination -->
|
||||||
<!-- INCLUDE pagination.html -->
|
<!-- INCLUDE pagination.html -->
|
||||||
|
Reference in New Issue
Block a user