mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge 17c64bada3
into bdbd0be548
This commit is contained in:
commit
5667769eb6
2 changed files with 63 additions and 5 deletions
|
@ -865,6 +865,7 @@ $lang = array_merge($lang, array(
|
||||||
'UNREAD_MESSAGES' => 'Unread messages',
|
'UNREAD_MESSAGES' => 'Unread messages',
|
||||||
'UNREAD_POST' => 'Unread post',
|
'UNREAD_POST' => 'Unread post',
|
||||||
'UNREAD_POSTS' => 'Unread posts',
|
'UNREAD_POSTS' => 'Unread posts',
|
||||||
|
'UNRECOGNISED_PAGE' => 'Unrecognised page',
|
||||||
'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?',
|
'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?',
|
||||||
'UNWATCH_FORUM_DETAILED' => 'Are you sure you wish to unsubscribe from the forum “%s”?',
|
'UNWATCH_FORUM_DETAILED' => 'Are you sure you wish to unsubscribe from the forum “%s”?',
|
||||||
'UNWATCH_TOPIC_CONFIRM' => 'Are you sure you wish to unsubscribe from this topic?',
|
'UNWATCH_TOPIC_CONFIRM' => 'Are you sure you wish to unsubscribe from this topic?',
|
||||||
|
|
|
@ -268,6 +268,57 @@ foreach ($session_data_rowset as $row)
|
||||||
case 'viewtopic':
|
case 'viewtopic':
|
||||||
$forum_id = $row['session_forum_id'];
|
$forum_id = $row['session_forum_id'];
|
||||||
|
|
||||||
|
if (!$forum_id)
|
||||||
|
{
|
||||||
|
$array_match_index = 5;
|
||||||
|
// find the forum_id from the page URI
|
||||||
|
$matches = array();
|
||||||
|
|
||||||
|
$pattern = '#(viewtopic|posting)\.' . $phpEx . '((\?|&)\w+=\w+)*(\?|&)';
|
||||||
|
preg_match($pattern . 'f=(\d+)#', $row['session_page'], $matches);
|
||||||
|
if ($matches[$array_match_index])
|
||||||
|
{
|
||||||
|
$forum_id = (int) $matches[$array_match_index];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
preg_match($pattern . 't=(\d+)#', $row['session_page'], $matches);
|
||||||
|
if ($matches[$array_match_index])
|
||||||
|
{
|
||||||
|
$topic_id = $matches[$array_match_index];
|
||||||
|
|
||||||
|
$sql = 'SELECT forum_id
|
||||||
|
FROM ' . TOPICS_TABLE . "
|
||||||
|
WHERE topic_id = $topic_id";
|
||||||
|
$result1 = $db->sql_query($sql);
|
||||||
|
$forum_id = (int) $db->sql_fetchfield('forum_id');
|
||||||
|
$db->sql_freeresult($result1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
preg_match($pattern . 'p=(\d+)#', $row['session_page'], $matches);
|
||||||
|
if ($matches[$array_match_index])
|
||||||
|
{
|
||||||
|
$post_id = $matches[$array_match_index];
|
||||||
|
|
||||||
|
$topic_forum = array();
|
||||||
|
|
||||||
|
$sql = 'SELECT t.forum_id
|
||||||
|
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
|
||||||
|
WHERE p.post_id = ' . $post_id . '
|
||||||
|
AND t.topic_id = p.topic_id';
|
||||||
|
$result1 = $db->sql_query($sql);
|
||||||
|
$forum_id = (int) $db->sql_fetchfield('forum_id');
|
||||||
|
$db->sql_freeresult($result1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$forum_id = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($forum_id && $auth->acl_get('f_list', $forum_id))
|
if ($forum_id && $auth->acl_get('f_list', $forum_id))
|
||||||
{
|
{
|
||||||
$location = '';
|
$location = '';
|
||||||
|
@ -309,7 +360,7 @@ foreach ($session_data_rowset as $row)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$location = $user->lang['INDEX'];
|
$location = $user->lang['UNRECOGNISED_PAGE'];
|
||||||
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
|
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -382,17 +433,23 @@ foreach ($session_data_rowset as $row)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$location = $user->lang['INDEX'];
|
|
||||||
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
|
|
||||||
|
|
||||||
if ($row['session_page'] === 'app.' . $phpEx . '/help/faq' ||
|
if ($row['session_page'] === 'app.' . $phpEx . '/help/faq' ||
|
||||||
$row['session_page'] === 'app.' . $phpEx . '/help/bbcode')
|
$row['session_page'] === 'app.' . $phpEx . '/help/bbcode')
|
||||||
{
|
{
|
||||||
$location = $user->lang['VIEWING_FAQ'];
|
$location = $user->lang['VIEWING_FAQ'];
|
||||||
$location_url = $controller_helper->route('phpbb_help_faq_controller');
|
$location_url = $controller_helper->route('phpbb_help_faq_controller');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$location = $user->lang['UNRECOGNISED_PAGE'];
|
||||||
|
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if ($auth->acl_get('a_'))
|
||||||
|
{
|
||||||
|
$location .= nl2br("\n" . substr($row['session_page'], 0, 99));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overwrite the location's name and URL, which are displayed in the list
|
* Overwrite the location's name and URL, which are displayed in the list
|
||||||
|
|
Loading…
Add table
Reference in a new issue