Line 166 | Line 166 |
---|
if ($config['load_db_lastread']) {
|
if ($config['load_db_lastread']) {
|
$read_tracking_join = ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')'; $read_tracking_select = ', tt.mark_time';
| $sql_read_tracking['LEFT_JOIN'][] = ['FROM' => [TOPICS_TRACK_TABLE => 'tt'], 'ON' => 'tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id']]; $sql_read_tracking['SELECT'] = ', tt.mark_time';
|
} else {
|
} else {
|
$read_tracking_join = $read_tracking_select = '';
| $sql_read_tracking['LEFT_JOIN'] = []; $sql_read_tracking['SELECT'] = '';
|
}
/* @var $phpbb_content_visibility \phpbb\content_visibility */
| }
/* @var $phpbb_content_visibility \phpbb\content_visibility */
|
Line 209 | Line 210 |
---|
} $db->sql_freeresult($result);
|
} $db->sql_freeresult($result);
|
$sql = "SELECT t.*$read_tracking_select FROM " . TOPICS_TABLE . " t $read_tracking_join WHERE " . $db->sql_in_set('t.topic_id', $topic_list, false, true);
| $sql_ary = [ 'SELECT' => 't.*' . $sql_read_tracking['SELECT'], 'FROM' => [TOPICS_TABLE => 't'], 'LEFT_JOIN' => $sql_read_tracking['LEFT_JOIN'], 'WHERE' => $db->sql_in_set('t.topic_id', $topic_list, false, true), ];
|
|
|
| /** * Event to modify SQL query before MCP forum topic data is queried * * @event core.mcp_forum_topic_data_modify_sql * @var array sql_ary SQL query array to get the MCP forum topic data * @var int forum_id The forum ID * @var array topic_list The array of MCP forum topic IDs * * @since 3.3.4-RC1 */ $vars = [ 'sql_ary', 'forum_id', 'topic_list', ]; extract($phpbb_dispatcher->trigger_event('core.mcp_forum_topic_data_modify_sql', compact($vars)));
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
$result = $db->sql_query($sql); while ($row_ary = $db->sql_fetchrow($result)) {
| $result = $db->sql_query($sql); while ($row_ary = $db->sql_fetchrow($result)) {
|
Line 322 | Line 344 |
---|
} $topic_row = array_merge($topic_row, array( 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row_ary['topic_id']}&mode=topic_view"),
|
} $topic_row = array_merge($topic_row, array( 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row_ary['topic_id']}&mode=topic_view"),
|
| 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row_ary['topic_id']}&mode=topic_view&view=unread#unread"),
|
'S_SELECT_TOPIC' => ($merge_select && !in_array($row_ary['topic_id'], $source_topic_ids)) ? true : false, 'U_SELECT_TOPIC' => $u_select_topic,
| 'S_SELECT_TOPIC' => ($merge_select && !in_array($row_ary['topic_id'], $source_topic_ids)) ? true : false, 'U_SELECT_TOPIC' => $u_select_topic,
|
Line 520 | Line 543 |
---|
sync('forum', 'forum_id', $sync_forums, true, true);
// Link to the new topic
|
sync('forum', 'forum_id', $sync_forums, true, true);
// Link to the new topic
|
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id");
| $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $to_topic_id) . '">', '</a>'); $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?t=$to_topic_id");
|
$redirect = reapply_sid($redirect);
/**
| $redirect = reapply_sid($redirect);
/**
|