mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-24 10:31:57 +02:00
Merge pull request #6206 from marc1706/ticket/13713
[ticket/13713] User Mentions
This commit is contained in:
@@ -195,7 +195,7 @@ class acp_bbcodes
|
||||
$data = $this->build_regexp($bbcode_match, $bbcode_tpl);
|
||||
|
||||
// Make sure the user didn't pick a "bad" name for the BBCode tag.
|
||||
$hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash=');
|
||||
$hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash=', 'mention');
|
||||
|
||||
if (($action == 'modify' && strtolower($data['bbcode_tag']) !== strtolower($row['bbcode_tag'])) || ($action == 'create'))
|
||||
{
|
||||
|
@@ -220,7 +220,12 @@ class acp_board
|
||||
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
|
||||
'legend3' => 'ACP_SUBMIT_CHANGES',
|
||||
'legend3' => 'MENTIONS',
|
||||
'allow_mentions' => array('lang' => 'ALLOW_MENTIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'mention_names_limit' => array('lang' => 'MENTION_NAMES_LIMIT', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
|
||||
'mention_batch_size' => array('lang' => 'MENTION_BATCH_SIZE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => true),
|
||||
|
||||
'legend4' => 'ACP_SUBMIT_CHANGES',
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@@ -575,6 +575,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||
// Mark all topic notifications read for this user
|
||||
$phpbb_notifications->mark_notifications(array(
|
||||
'notification.type.topic',
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.bookmark',
|
||||
'notification.type.post',
|
||||
@@ -660,6 +661,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$phpbb_notifications->mark_notifications_by_parent(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.bookmark',
|
||||
'notification.type.post',
|
||||
@@ -771,6 +773,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||
), $topic_id, $user->data['user_id'], $post_time);
|
||||
|
||||
$phpbb_notifications->mark_notifications_by_parent(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.bookmark',
|
||||
'notification.type.post',
|
||||
@@ -3943,6 +3946,10 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||
'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
|
||||
'U_FEED' => $controller_helper->route('phpbb_feed_index'),
|
||||
|
||||
'S_ALLOW_MENTIONS' => ($config['allow_mentions'] && $auth->acl_get('u_mention') && (empty($forum_id) || $auth->acl_get('f_mention', $forum_id))) ? true : false,
|
||||
'S_MENTION_NAMES_LIMIT' => $config['mention_names_limit'],
|
||||
'U_MENTION_URL' => $controller_helper->route('phpbb_mention_controller'),
|
||||
|
||||
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
|
||||
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
|
||||
'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false,
|
||||
@@ -3964,6 +3971,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||
'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
|
||||
'S_FORUM_ID' => $forum_id,
|
||||
'S_TOPIC_ID' => $topic_id,
|
||||
'S_USER_ID' => $user->data['user_id'],
|
||||
|
||||
'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id)),
|
||||
'S_LOGIN_REDIRECT' => $s_login_redirect,
|
||||
|
@@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
|
||||
*/
|
||||
function adm_page_header($page_title)
|
||||
{
|
||||
global $config, $user, $template;
|
||||
global $config, $user, $template, $auth;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
|
||||
global $phpbb_dispatcher, $phpbb_container;
|
||||
|
||||
@@ -66,6 +66,9 @@ function adm_page_header($page_title)
|
||||
}
|
||||
}
|
||||
|
||||
/** @var \phpbb\controller\helper $controller_helper */
|
||||
$controller_helper = $phpbb_container->get('controller.helper');
|
||||
|
||||
$phpbb_version_parts = explode('.', PHPBB_VERSION, 3);
|
||||
$phpbb_major = $phpbb_version_parts[0] . '.' . $phpbb_version_parts[1];
|
||||
|
||||
@@ -86,6 +89,10 @@ function adm_page_header($page_title)
|
||||
'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
|
||||
'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
|
||||
|
||||
'S_ALLOW_MENTIONS' => ($config['allow_mentions'] && $auth->acl_get('u_mention')) ? true : false,
|
||||
'S_MENTION_NAMES_LIMIT' => $config['mention_names_limit'],
|
||||
'U_MENTION_URL' => $controller_helper->route('phpbb_mention_controller'),
|
||||
|
||||
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
|
||||
'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
|
||||
'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
|
||||
@@ -108,6 +115,7 @@ function adm_page_header($page_title)
|
||||
'ICON_SYNC' => '<i class="icon acp-icon acp-icon-resync fa-refresh fa-fw" title="' . $user->lang('RESYNC') . '"></i>',
|
||||
'ICON_SYNC_DISABLED' => '<i class="icon acp-icon acp-icon-disabled fa-refresh fa-fw" title="' . $user->lang('RESYNC') . '"></i>',
|
||||
|
||||
'S_USER_ID' => $user->data['user_id'],
|
||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||
'S_CONTENT_ENCODING' => 'UTF-8',
|
||||
|
@@ -908,6 +908,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
|
||||
// Notifications types to delete
|
||||
$delete_notifications_types = array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.approve_post',
|
||||
'notification.type.post_in_queue',
|
||||
|
@@ -2443,6 +2443,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
{
|
||||
case 'post':
|
||||
$phpbb_notifications->add_notifications(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.topic',
|
||||
), $notification_data);
|
||||
@@ -2451,6 +2452,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
case 'reply':
|
||||
case 'quote':
|
||||
$phpbb_notifications->add_notifications(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.bookmark',
|
||||
'notification.type.post',
|
||||
@@ -2465,6 +2467,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
||||
if ($user->data['user_id'] == $poster_id)
|
||||
{
|
||||
$phpbb_notifications->update_notifications(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
), $notification_data);
|
||||
}
|
||||
|
@@ -810,10 +810,14 @@ class mcp_queue
|
||||
), $post_data);
|
||||
}
|
||||
}
|
||||
$phpbb_notifications->add_notifications(array('notification.type.quote'), $post_data);
|
||||
$phpbb_notifications->add_notifications(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
), $post_data);
|
||||
$phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id);
|
||||
|
||||
$phpbb_notifications->mark_notifications(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.bookmark',
|
||||
'notification.type.post',
|
||||
@@ -1045,12 +1049,13 @@ class mcp_queue
|
||||
if ($topic_data['topic_visibility'] == ITEM_UNAPPROVED)
|
||||
{
|
||||
$phpbb_notifications->add_notifications(array(
|
||||
'notification.type.mention',
|
||||
'notification.type.quote',
|
||||
'notification.type.topic',
|
||||
), $topic_data);
|
||||
}
|
||||
|
||||
$phpbb_notifications->mark_notifications('quote', $topic_data['post_id'], $user->data['user_id']);
|
||||
$phpbb_notifications->mark_notifications(array('mention', 'quote'), $topic_data['post_id'], $user->data['user_id']);
|
||||
$phpbb_notifications->mark_notifications('topic', $topic_id, $user->data['user_id']);
|
||||
|
||||
if ($notify_poster)
|
||||
|
Reference in New Issue
Block a user