mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-03 00:28:53 +00:00
Compare commits
17 commits
7f8d7b0d40
...
5212659a1c
Author | SHA1 | Date | |
---|---|---|---|
|
5212659a1c | ||
|
f94423d491 | ||
|
b6200d6690 | ||
|
04f2141a7d | ||
|
4b7d7c2fc7 | ||
|
3d76a8bd09 | ||
|
1c399dcab7 | ||
|
e91c7d42a9 | ||
|
3eaf4829bb | ||
|
3b233d9c28 | ||
|
3801eb0946 | ||
|
3a553f07bc | ||
|
b666bc9e0a | ||
|
81c49aa6a5 | ||
|
6fd9a78872 | ||
|
7f3b37560e | ||
|
8d0d6c012c |
15 changed files with 305 additions and 110 deletions
|
@ -1746,29 +1746,33 @@ overall_header_body_before
|
||||||
overall_header_breadcrumb_append
|
overall_header_breadcrumb_append
|
||||||
===
|
===
|
||||||
* Locations:
|
* Locations:
|
||||||
+ styles/prosilver/template/navbar_header.html
|
+ styles/prosilver/template/breadcrumbs.html
|
||||||
* Since: 3.1.0-a1
|
* Since: 3.1.0-a1
|
||||||
|
* Changed: 4.0.0-a1 Moved to breadcrumbs.html
|
||||||
* Purpose: Add links to the list of breadcrumbs in the header
|
* Purpose: Add links to the list of breadcrumbs in the header
|
||||||
|
|
||||||
overall_header_breadcrumb_prepend
|
overall_header_breadcrumb_prepend
|
||||||
===
|
===
|
||||||
* Locations:
|
* Locations:
|
||||||
+ styles/prosilver/template/navbar_header.html
|
+ styles/prosilver/template/breadcrumbs.html
|
||||||
* Since: 3.1.0-RC3
|
* Since: 3.1.0-RC3
|
||||||
|
* Changed: 4.0.0-a1 Moved to breadcrumbs.html
|
||||||
* Purpose: Add links to the list of breadcrumbs in the header (after site-home, but before board-index)
|
* Purpose: Add links to the list of breadcrumbs in the header (after site-home, but before board-index)
|
||||||
|
|
||||||
overall_header_breadcrumbs_after
|
overall_header_breadcrumbs_after
|
||||||
===
|
===
|
||||||
* Locations:
|
* Locations:
|
||||||
+ styles/prosilver/template/navbar_header.html
|
+ styles/prosilver/template/breadcrumbs.html
|
||||||
* Since: 3.1.0-RC3
|
* Since: 3.1.0-RC3
|
||||||
|
* Changed: 4.0.0-a1 Moved to breadcrumbs.html
|
||||||
* Purpose: Add content after the breadcrumbs (outside of the breadcrumbs container)
|
* Purpose: Add content after the breadcrumbs (outside of the breadcrumbs container)
|
||||||
|
|
||||||
overall_header_breadcrumbs_before
|
overall_header_breadcrumbs_before
|
||||||
===
|
===
|
||||||
* Locations:
|
* Locations:
|
||||||
+ styles/prosilver/template/navbar_header.html
|
+ styles/prosilver/template/breadcrumbs.html
|
||||||
* Since: 3.1.0-RC3
|
* Since: 3.1.0-RC3
|
||||||
|
* Changed: 4.0.0-a1 Moved to breadcrumbs.html
|
||||||
* Purpose: Add content before the breadcrumbs (outside of the breadcrumbs container)
|
* Purpose: Add content before the breadcrumbs (outside of the breadcrumbs container)
|
||||||
|
|
||||||
overall_header_content_before
|
overall_header_content_before
|
||||||
|
@ -1830,15 +1834,17 @@ overall_header_navigation_prepend
|
||||||
overall_header_navlink_append
|
overall_header_navlink_append
|
||||||
===
|
===
|
||||||
* Locations:
|
* Locations:
|
||||||
+ styles/prosilver/template/navbar_header.html
|
+ styles/prosilver/template/breadcrumbs.html
|
||||||
* Since: 3.1.0-b3
|
* Since: 3.1.0-b3
|
||||||
|
* Changed: 4.0.0-a1 Moved to breadcrumbs.html
|
||||||
* Purpose: Add content after each individual navlink (breadcrumb)
|
* Purpose: Add content after each individual navlink (breadcrumb)
|
||||||
|
|
||||||
overall_header_navlink_prepend
|
overall_header_navlink_prepend
|
||||||
===
|
===
|
||||||
* Locations:
|
* Locations:
|
||||||
+ styles/prosilver/template/navbar_header.html
|
+ styles/prosilver/template/breadcrumbs.html
|
||||||
* Since: 3.1.0-b3
|
* Since: 3.1.0-b3
|
||||||
|
* Changed: 4.0.0-a1 Moved to breadcrumbs.html
|
||||||
* Purpose: Add content before each individual navlink (breadcrumb)
|
* Purpose: Add content before each individual navlink (breadcrumb)
|
||||||
|
|
||||||
overall_header_page_body_before
|
overall_header_page_body_before
|
||||||
|
|
|
@ -112,10 +112,16 @@ abstract class base implements search_backend_interface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the sort direction differs from the direction in the cache, then reverse the ids array
|
// If the sort direction differs from the direction in the cache, then recalculate array keys
|
||||||
if ($reverse_ids)
|
if ($reverse_ids)
|
||||||
{
|
{
|
||||||
$stored_ids = array_reverse($stored_ids);
|
$keys = array_keys($stored_ids);
|
||||||
|
array_walk($keys, function (&$value, $key) use ($result_count)
|
||||||
|
{
|
||||||
|
$value = ($value >= 0) ? $result_count - $value - 1 : $value;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$stored_ids = array_combine($keys, $stored_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
|
for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
|
||||||
|
@ -166,6 +172,8 @@ abstract class base implements search_backend_interface
|
||||||
}
|
}
|
||||||
|
|
||||||
$store_ids = array_slice($id_ary, 0, $length);
|
$store_ids = array_slice($id_ary, 0, $length);
|
||||||
|
$id_range = range($start, $start + $length - 1);
|
||||||
|
$store_ids = array_combine($id_range, $store_ids);
|
||||||
|
|
||||||
// create a new resultset if there is none for this search_key yet
|
// create a new resultset if there is none for this search_key yet
|
||||||
// or add the ids to the existing resultset
|
// or add the ids to the existing resultset
|
||||||
|
@ -200,29 +208,26 @@ abstract class base implements search_backend_interface
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
$store = array(-1 => $result_count, -2 => $sort_dir);
|
$store = array(-1 => $result_count, -2 => $sort_dir);
|
||||||
$id_range = range($start, $start + $length - 1);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// we use one set of results for both sort directions so we have to calculate the indizes
|
// we use one set of results for both sort directions so we have to calculate the indizes
|
||||||
// for the reversed array and we also have to reverse the ids themselves
|
// for the reversed array
|
||||||
if ($store[-2] != $sort_dir)
|
if ($store[-2] != $sort_dir)
|
||||||
{
|
{
|
||||||
$store_ids = array_reverse($store_ids);
|
$keys = array_keys($store_ids);
|
||||||
$id_range = range($store[-1] - $start - $length, $store[-1] - $start - 1);
|
array_walk($keys, function (&$value, $key) use ($store) {
|
||||||
}
|
$value = $store[-1] - $value - 1;
|
||||||
else
|
});
|
||||||
{
|
$store_ids = array_combine($keys, $store_ids);
|
||||||
$id_range = range($start, $start + $length - 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$store_ids = array_combine($id_range, $store_ids);
|
|
||||||
|
|
||||||
// append the ids
|
// append the ids
|
||||||
if (is_array($store_ids))
|
if (is_array($store_ids))
|
||||||
{
|
{
|
||||||
$store += $store_ids;
|
$store += $store_ids;
|
||||||
|
ksort($store);
|
||||||
|
|
||||||
// if the cache is too big
|
// if the cache is too big
|
||||||
if (count($store) - 2 > 20 * $this->config['search_block_size'])
|
if (count($store) - 2 > 20 * $this->config['search_block_size'])
|
||||||
|
|
|
@ -550,7 +550,6 @@ class fulltext_mysql extends base implements search_backend_interface
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
|
||||||
// if the total result count is not cached yet, retrieve it from the db
|
// if the total result count is not cached yet, retrieve it from the db
|
||||||
if (!$result_count && count($id_ary))
|
if (!$result_count && count($id_ary))
|
||||||
{
|
{
|
||||||
|
@ -576,9 +575,9 @@ class fulltext_mysql extends base implements search_backend_interface
|
||||||
$id_ary[] = (int) $row[$field];
|
$id_ary[] = (int) $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
||||||
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
||||||
|
@ -758,6 +757,8 @@ class fulltext_mysql extends base implements search_backend_interface
|
||||||
// Build the query for really selecting the post_ids
|
// Build the query for really selecting the post_ids
|
||||||
if ($type == 'posts')
|
if ($type == 'posts')
|
||||||
{
|
{
|
||||||
|
// For sorting by non-unique columns, add unique sort key to avoid duplicated rows in results
|
||||||
|
$sql_sort .= ', p.post_id' . (($sort_dir == 'a') ? ' ASC' : ' DESC');
|
||||||
$sql = "SELECT $sql_select
|
$sql = "SELECT $sql_select
|
||||||
FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
|
FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
|
||||||
WHERE $sql_author
|
WHERE $sql_author
|
||||||
|
@ -821,9 +822,9 @@ class fulltext_mysql extends base implements search_backend_interface
|
||||||
$id_ary[] = (int) $row[$field];
|
$id_ary[] = (int) $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
if (count($id_ary))
|
if (count($id_ary))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1004,6 +1004,8 @@ class fulltext_native extends base implements search_backend_interface
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$id_ary = array_unique($id_ary);
|
||||||
|
|
||||||
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
||||||
$this->save_ids($search_key, $this->search_query, $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, $this->search_query, $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
||||||
$id_ary = array_slice($id_ary, 0, (int) $per_page);
|
$id_ary = array_slice($id_ary, 0, (int) $per_page);
|
||||||
|
@ -1225,6 +1227,8 @@ class fulltext_native extends base implements search_backend_interface
|
||||||
// Build the query for really selecting the post_ids
|
// Build the query for really selecting the post_ids
|
||||||
if ($type == 'posts')
|
if ($type == 'posts')
|
||||||
{
|
{
|
||||||
|
// For sorting by non-unique columns, add unique sort key to avoid duplicated rows in results
|
||||||
|
$sql_sort .= ', p.post_id' . (($sort_dir == 'a') ? ' ASC' : ' DESC');
|
||||||
$sql = "SELECT $select
|
$sql = "SELECT $select
|
||||||
FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t' : '') . "
|
FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t' : '') . "
|
||||||
WHERE $sql_author
|
WHERE $sql_author
|
||||||
|
@ -1289,6 +1293,8 @@ class fulltext_native extends base implements search_backend_interface
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$id_ary = array_unique($id_ary);
|
||||||
|
|
||||||
if (count($id_ary))
|
if (count($id_ary))
|
||||||
{
|
{
|
||||||
$this->save_ids($search_key, '', $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, '', $author_ary, $total_results, $id_ary, $start, $sort_dir);
|
||||||
|
|
|
@ -478,8 +478,6 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
|
||||||
|
|
||||||
// if the total result count is not cached yet, retrieve it from the db
|
// if the total result count is not cached yet, retrieve it from the db
|
||||||
if (!$result_count)
|
if (!$result_count)
|
||||||
{
|
{
|
||||||
|
@ -509,9 +507,9 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||||
$id_ary[] = $row[$field];
|
$id_ary[] = $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
||||||
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
||||||
|
@ -683,6 +681,8 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||||
// Build the query for really selecting the post_ids
|
// Build the query for really selecting the post_ids
|
||||||
if ($type == 'posts')
|
if ($type == 'posts')
|
||||||
{
|
{
|
||||||
|
// For sorting by non-unique columns, add unique sort key to avoid duplicated rows in results
|
||||||
|
$sql_sort .= ', p.post_id' . (($sort_dir == 'a') ? ' ASC' : ' DESC');
|
||||||
$sql = "SELECT p.post_id
|
$sql = "SELECT p.post_id
|
||||||
FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
|
FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
|
||||||
WHERE $sql_author
|
WHERE $sql_author
|
||||||
|
@ -775,9 +775,9 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||||
$id_ary[] = (int) $row[$field];
|
$id_ary[] = (int) $row[$field];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
$id_ary = array_unique($id_ary);
|
$id_ary = array_unique($id_ary);
|
||||||
}
|
|
||||||
|
|
||||||
if (count($id_ary))
|
if (count($id_ary))
|
||||||
{
|
{
|
||||||
|
|
53
phpBB/styles/prosilver/template/breadcrumbs.html
Normal file
53
phpBB/styles/prosilver/template/breadcrumbs.html
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<ul id="nav-breadcrumbs" class="nav-breadcrumbs linklist navlinks" role="menubar">
|
||||||
|
{% set MICRODATA = 'itemtype="https://schema.org/ListItem" itemprop="itemListElement" itemscope' %}
|
||||||
|
{% set navlink_position = 1 %}
|
||||||
|
|
||||||
|
{% EVENT overall_header_breadcrumbs_before %}
|
||||||
|
|
||||||
|
<li class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList">
|
||||||
|
{% if U_SITE_HOME %}
|
||||||
|
<span class="crumb" {{ MICRODATA }}>
|
||||||
|
{% apply spaceless %}
|
||||||
|
<a itemprop="item" href="{{ U_SITE_HOME }}" data-navbar-reference="home">
|
||||||
|
{{ Icon('font', 'home', '', true, 'fas o-icon-baseline') }}
|
||||||
|
<span itemprop="name">{{ L_SITE_HOME }}</span>
|
||||||
|
</a>
|
||||||
|
{% endapply %}
|
||||||
|
<meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}">
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% EVENT overall_header_breadcrumb_prepend %}
|
||||||
|
|
||||||
|
<span class="crumb" {{ MICRODATA }}>
|
||||||
|
{% apply spaceless %}
|
||||||
|
<a itemprop="item" href="{{ U_INDEX }}" accesskey="h" data-navbar-reference="index">
|
||||||
|
{% if not U_SITE_HOME %}{{ Icon('font', 'home', '', true, 'fas o-icon-baseline') }}{% endif %}
|
||||||
|
<span itemprop="name">{{ L_INDEX }}</span>
|
||||||
|
</a>
|
||||||
|
{% endapply %}
|
||||||
|
<meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}">
|
||||||
|
</span>
|
||||||
|
|
||||||
|
{% for navlink in navlinks %}
|
||||||
|
{% set NAVLINK_NAME = navlink.BREADCRUMB_NAME | default(navlink.FORUM_NAME) %}
|
||||||
|
{% set NAVLINK_LINK = navlink.U_BREADCRUMB | default(navlink.U_VIEW_FORUM) %}
|
||||||
|
|
||||||
|
{% EVENT overall_header_navlink_prepend %}
|
||||||
|
<span class="crumb" {{ MICRODATA }}{% if navlink.MICRODATA %} {{ navlink.MICRODATA }}{% endif %}>
|
||||||
|
{% apply spaceless %}
|
||||||
|
<a itemprop="item" href="{{ NAVLINK_LINK }}">
|
||||||
|
<span itemprop="name">{{ NAVLINK_NAME }}</span>
|
||||||
|
</a>
|
||||||
|
{% endapply %}
|
||||||
|
<meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}">
|
||||||
|
</span>
|
||||||
|
{% EVENT overall_header_navlink_append %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% EVENT overall_header_breadcrumb_append %}
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% EVENT overall_header_breadcrumbs_after %}
|
||||||
|
</ul>
|
|
@ -44,7 +44,7 @@
|
||||||
<!-- END faq_block -->
|
<!-- END faq_block -->
|
||||||
|
|
||||||
<div class="to-top-button">
|
<div class="to-top-button">
|
||||||
<a href="#faqlinks">
|
<a href="#faqlinks" title="{{ lang('BACK_TO_TOP') }}">
|
||||||
{{ Icon('font', 'chevron-up', '', false) }}
|
{{ Icon('font', 'chevron-up', '', false) }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -203,68 +203,5 @@
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul id="nav-breadcrumbs" class="nav-breadcrumbs linklist navlinks" role="menubar">
|
|
||||||
{% set MICRODATA = 'itemtype="https://schema.org/ListItem" itemprop="itemListElement" itemscope' %}
|
|
||||||
{% set navlink_position = 1 %}
|
|
||||||
|
|
||||||
{% EVENT overall_header_breadcrumbs_before %}
|
|
||||||
|
|
||||||
<li class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList">
|
|
||||||
{% if U_SITE_HOME %}
|
|
||||||
<span class="crumb" {{ MICRODATA }}>
|
|
||||||
{% apply spaceless %}
|
|
||||||
<a itemprop="item" href="{{ U_SITE_HOME }}" data-navbar-reference="home">
|
|
||||||
{{ Icon('font', 'home', '', true, 'fas o-icon-baseline') }}
|
|
||||||
<span itemprop="name">{{ L_SITE_HOME }}</span>
|
|
||||||
</a>
|
|
||||||
{% endapply %}
|
|
||||||
<meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}">
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% EVENT overall_header_breadcrumb_prepend %}
|
|
||||||
|
|
||||||
<span class="crumb" {{ MICRODATA }}>
|
|
||||||
{% apply spaceless %}
|
|
||||||
<a itemprop="item" href="{{ U_INDEX }}" accesskey="h" data-navbar-reference="index">
|
|
||||||
{% if not U_SITE_HOME %}{{ Icon('font', 'home', '', true, 'fas o-icon-baseline') }}{% endif %}
|
|
||||||
<span itemprop="name">{{ L_INDEX }}</span>
|
|
||||||
</a>
|
|
||||||
{% endapply %}
|
|
||||||
<meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}">
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{% for navlink in navlinks %}
|
|
||||||
{% set NAVLINK_NAME = navlink.BREADCRUMB_NAME | default(navlink.FORUM_NAME) %}
|
|
||||||
{% set NAVLINK_LINK = navlink.U_BREADCRUMB | default(navlink.U_VIEW_FORUM) %}
|
|
||||||
|
|
||||||
{% EVENT overall_header_navlink_prepend %}
|
|
||||||
<span class="crumb" {{ MICRODATA }}{% if navlink.MICRODATA %} {{ navlink.MICRODATA }}{% endif %}>
|
|
||||||
{% apply spaceless %}
|
|
||||||
<a itemprop="item" href="{{ NAVLINK_LINK }}">
|
|
||||||
<span itemprop="name">{{ NAVLINK_NAME }}</span>
|
|
||||||
</a>
|
|
||||||
{% endapply %}
|
|
||||||
<meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}">
|
|
||||||
</span>
|
|
||||||
{% EVENT overall_header_navlink_append %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% EVENT overall_header_breadcrumb_append %}
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
{% EVENT overall_header_breadcrumbs_after %}
|
|
||||||
|
|
||||||
{% if S_DISPLAY_SEARCH and not S_IN_SEARCH %}
|
|
||||||
<li class="rightside responsive-search">
|
|
||||||
<a href="{{ U_SEARCH }}" title="{{ lang('SEARCH_ADV_EXPLAIN') }}" role="menuitem">
|
|
||||||
{{ Icon('font', 'search', lang('SEARCH'), true) }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
<!-- EVENT overall_header_stylesheets_after -->
|
<!-- EVENT overall_header_stylesheets_after -->
|
||||||
|
|
||||||
{% if NOTIFICATIONS_WEBPUSH_ENABLE %}
|
{% if NOTIFICATIONS_WEBPUSH_ENABLE %}
|
||||||
{% include('ucp_notifications_webpush.html') %}
|
{% include 'ucp_notifications_webpush.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -79,7 +79,11 @@
|
||||||
<div id="wrap" class="wrap">
|
<div id="wrap" class="wrap">
|
||||||
<a id="top" class="top-anchor" accesskey="t"></a>
|
<a id="top" class="top-anchor" accesskey="t"></a>
|
||||||
<div id="page-header">
|
<div id="page-header">
|
||||||
|
<!-- EVENT overall_header_navbar_before -->
|
||||||
|
|
||||||
<div class="headerbar" role="banner">
|
<div class="headerbar" role="banner">
|
||||||
|
|
||||||
|
{% include 'navbar_header.html' %}
|
||||||
<!-- EVENT overall_header_headerbar_before -->
|
<!-- EVENT overall_header_headerbar_before -->
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
|
|
||||||
|
@ -117,10 +121,10 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- EVENT overall_header_headerbar_after -->
|
<!-- EVENT overall_header_headerbar_after -->
|
||||||
</div>
|
</div>
|
||||||
<!-- EVENT overall_header_navbar_before -->
|
|
||||||
<!-- INCLUDE navbar_header.html -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% include 'breadcrumbs.html' %}
|
||||||
|
|
||||||
<!-- EVENT overall_header_page_body_before -->
|
<!-- EVENT overall_header_page_body_before -->
|
||||||
|
|
||||||
<a id="start_here" class="anchor"></a>
|
<a id="start_here" class="anchor"></a>
|
||||||
|
|
|
@ -423,9 +423,6 @@
|
||||||
<!-- EVENT viewtopic_body_postrow_back2top_before -->
|
<!-- EVENT viewtopic_body_postrow_back2top_before -->
|
||||||
<div class="back2top">
|
<div class="back2top">
|
||||||
<!-- EVENT viewtopic_body_postrow_back2top_prepend -->
|
<!-- EVENT viewtopic_body_postrow_back2top_prepend -->
|
||||||
<a href="#top" class="top" title="{L_BACK_TO_TOP}">
|
|
||||||
{{ Icon('font', 'circle-chevron-up', lang('BACK_TO_TOP'), false, 'fas c-top-icon') }}
|
|
||||||
</a>
|
|
||||||
<!-- EVENT viewtopic_body_postrow_back2top_append -->
|
<!-- EVENT viewtopic_body_postrow_back2top_append -->
|
||||||
</div>
|
</div>
|
||||||
<!-- EVENT viewtopic_body_postrow_back2top_after -->
|
<!-- EVENT viewtopic_body_postrow_back2top_after -->
|
||||||
|
@ -496,6 +493,12 @@
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="to-top-button">
|
||||||
|
<a href="#top" title="{{ lang('BACK_TO_TOP') }}">
|
||||||
|
{{ Icon('font', 'chevron-up', '', false) }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- EVENT viewtopic_body_footer_before -->
|
<!-- EVENT viewtopic_body_footer_before -->
|
||||||
<!-- INCLUDE jumpbox.html -->
|
<!-- INCLUDE jumpbox.html -->
|
||||||
|
|
||||||
|
|
|
@ -99,18 +99,19 @@ th a:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* round cornered boxes and backgrounds */
|
/* round cornered boxes and backgrounds */
|
||||||
.headerbar {
|
.headerbar,
|
||||||
color: #ffffff;
|
.headerbar h1 {
|
||||||
|
color: #eaf8ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerbar,
|
.headerbar,
|
||||||
.forumbg {
|
.forumbg {
|
||||||
background-color: #13a4ec;
|
background-color: #4688ce;
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
}
|
}
|
||||||
|
|
||||||
.forabg {
|
.forabg {
|
||||||
background-color: #13a4ec;
|
background-color: #4688ce;
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,6 +119,18 @@ th a:hover {
|
||||||
background-color: #c9dee8;
|
background-color: #c9dee8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.headerbar .navbar a {
|
||||||
|
color: #eaf8ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerbar .navbar .dropdown a {
|
||||||
|
color: #0f4d8a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-profile {
|
||||||
|
text-shadow: 0 0 1.75rem #eaf8ff;
|
||||||
|
}
|
||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
background-color: #f0f3f5;
|
background-color: #f0f3f5;
|
||||||
color: #29303d;
|
color: #29303d;
|
||||||
|
@ -814,6 +827,10 @@ dd.profile-warnings {
|
||||||
/* icon images */
|
/* icon images */
|
||||||
.site_logo { background-image: url("./images/site_logo.svg"); }
|
.site_logo { background-image: url("./images/site_logo.svg"); }
|
||||||
|
|
||||||
|
.c-hero-logo-img g {
|
||||||
|
fill: #eaf8ff;
|
||||||
|
}
|
||||||
|
|
||||||
/* colours and backgrounds for cp.css */
|
/* colours and backgrounds for cp.css */
|
||||||
|
|
||||||
/* main cp box */
|
/* main cp box */
|
||||||
|
@ -1109,6 +1126,7 @@ input.disabled {
|
||||||
|
|
||||||
.dropdown-extended .dropdown-extended-item {
|
.dropdown-extended .dropdown-extended-item {
|
||||||
border-top-color: #bdbdbd;
|
border-top-color: #bdbdbd;
|
||||||
|
color: #47536b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-extended .dropdown-extended-item:hover {
|
.dropdown-extended .dropdown-extended-item:hover {
|
||||||
|
|
|
@ -17,7 +17,7 @@ body {
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 12px 0;
|
padding: 0 0 12px;
|
||||||
-webkit-print-color-adjust: exact;
|
-webkit-print-color-adjust: exact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,12 +151,13 @@ a:hover {
|
||||||
/* Main blocks
|
/* Main blocks
|
||||||
---------------------------------------- */
|
---------------------------------------- */
|
||||||
.wrap {
|
.wrap {
|
||||||
border: 1px solid transparent;
|
border: solid transparent;
|
||||||
border-radius: 8px;
|
border-width: 0 1px 1px;
|
||||||
|
border-radius: 0 0 8px 8px;
|
||||||
min-width: 625px;
|
min-width: 625px;
|
||||||
max-width: 1152px;
|
max-width: 1152px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 15px;
|
padding: 0 15px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-body {
|
.page-body {
|
||||||
|
@ -200,7 +201,7 @@ a:hover {
|
||||||
/* Round cornered boxes and backgrounds
|
/* Round cornered boxes and backgrounds
|
||||||
---------------------------------------- */
|
---------------------------------------- */
|
||||||
.headerbar {
|
.headerbar {
|
||||||
border-radius: 7px;
|
border-radius: 0 0 7px 7px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
|
@ -212,6 +213,11 @@ a:hover {
|
||||||
padding: 3px 10px;
|
padding: 3px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.headerbar .navbar {
|
||||||
|
background: none;
|
||||||
|
padding: calc(var(--ps-line-height) * 0.25) 5px calc(var(--ps-line-height) * 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
.forabg {
|
.forabg {
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
clear: both;
|
clear: both;
|
||||||
|
@ -340,6 +346,10 @@ ul.linklist .dropdown-up .dropdown {
|
||||||
bottom: 18px;
|
bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.nav-breadcrumbs {
|
||||||
|
margin: calc(var(--ps-line-height) * 0.75) 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Bulletin icons for list items
|
/* Bulletin icons for list items
|
||||||
---------------------------------------- */
|
---------------------------------------- */
|
||||||
ul.linklist.bulletin > li:before {
|
ul.linklist.bulletin > li:before {
|
||||||
|
|
|
@ -465,7 +465,7 @@ p.author {
|
||||||
clear: left;
|
clear: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: calc(var(--ps-font-small) * 1.4);
|
margin: calc(var(--ps-font-small) * 1.4) 0;
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,6 @@
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-width: 100px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pagination
|
/* Pagination
|
||||||
|
|
|
@ -229,6 +229,159 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
|
||||||
$this->delete_topic($topic_multiple_results_count2['topic_id']);
|
$this->delete_topic($topic_multiple_results_count2['topic_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_caching_search_results()
|
||||||
|
{
|
||||||
|
global $phpbb_root_path;
|
||||||
|
|
||||||
|
// Sphinx search doesn't use phpBB search results caching
|
||||||
|
if (strpos($this->search_backend, 'fulltext_sphinx'))
|
||||||
|
{
|
||||||
|
$this->markTestSkipped("Sphinx search doesn't use phpBB search results caching");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->purge_cache();
|
||||||
|
$this->login();
|
||||||
|
$this->admin_login();
|
||||||
|
|
||||||
|
$crawler = self::request('GET', 'search.php?author_id=2&sr=posts');
|
||||||
|
$posts_found_text = $crawler->filter('.searchresults-title')->text();
|
||||||
|
|
||||||
|
// Get total user's post count
|
||||||
|
preg_match('!(\d+)!', $posts_found_text, $matches);
|
||||||
|
$posts_count = (int) $matches[1];
|
||||||
|
|
||||||
|
$this->assertStringContainsString("Search found $posts_count matches", $posts_found_text, $this->search_backend);
|
||||||
|
|
||||||
|
// Set this value to cache less results than total count
|
||||||
|
$sql = 'UPDATE ' . CONFIG_TABLE . '
|
||||||
|
SET config_value = ' . floor($posts_count / 3) . "
|
||||||
|
WHERE config_name = '" . $this->db->sql_escape('search_block_size') . "'";
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
|
// Temporarily set posts_per_page to the value allowing to get several pages (4+)
|
||||||
|
$crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
|
||||||
|
$form = $crawler->selectButton('Submit')->form();
|
||||||
|
$values = $form->getValues();
|
||||||
|
$current_posts_per_page = $values['config[posts_per_page]'];
|
||||||
|
$values['config[posts_per_page]'] = floor($posts_count / 10);
|
||||||
|
$form->setValues($values);
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
$this->assertEquals(1, $crawler->filter('.successbox')->count(), $this->search_backend);
|
||||||
|
|
||||||
|
// Now actually test caching search results
|
||||||
|
$this->purge_cache();
|
||||||
|
|
||||||
|
// Default sort direction is 'd' (descending), browse the 1st page
|
||||||
|
$crawler = self::request('GET', 'search.php?author_id=2&sr=posts');
|
||||||
|
$pagination = $crawler->filter('.pagination')->eq(0);
|
||||||
|
$posts_found_text = $pagination->text();
|
||||||
|
|
||||||
|
$this->assertStringContainsString("Search found $posts_count matches", $posts_found_text, $this->search_backend);
|
||||||
|
|
||||||
|
// Filter all search result page links on the 1st page
|
||||||
|
$pagination = $pagination->filter('li > a')->reduce(
|
||||||
|
function ($node, $i)
|
||||||
|
{
|
||||||
|
return ($node->attr('class') == 'button');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get last page number
|
||||||
|
$last_page = (int) $pagination->last()->text();
|
||||||
|
|
||||||
|
// Browse the last search page
|
||||||
|
$crawler = self::$client->click($pagination->selectLink($last_page)->link());
|
||||||
|
$pagination = $crawler->filter('.pagination')->eq(0);
|
||||||
|
|
||||||
|
// Filter all search result page links on the last page
|
||||||
|
$pagination = $pagination->filter('li > a')->reduce(
|
||||||
|
function ($node, $i)
|
||||||
|
{
|
||||||
|
return ($node->attr('class') == 'button');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Now change sort direction to ascending
|
||||||
|
$form = $crawler->selectButton('sort')->form();
|
||||||
|
$values = $form->getValues();
|
||||||
|
$values['sd'] = 'a';
|
||||||
|
$form->setValues($values);
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
|
||||||
|
$pagination = $crawler->filter('.pagination')->eq(0);
|
||||||
|
|
||||||
|
// Filter all search result page links on the 1st page with new sort direction
|
||||||
|
$pagination = $pagination->filter('li > a')->reduce(
|
||||||
|
function ($node, $i)
|
||||||
|
{
|
||||||
|
return ($node->attr('class') == 'button');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Browse the rest of search results pages with new sort direction
|
||||||
|
$pages = range(2, $last_page);
|
||||||
|
foreach ($pages as $page_number)
|
||||||
|
{
|
||||||
|
$crawler = self::$client->click($pagination->selectLink($page_number)->link());
|
||||||
|
$pagination = $crawler->filter('.pagination')->eq(0);
|
||||||
|
$pagination = $pagination->filter('li > a')->reduce(
|
||||||
|
function ($node, $i)
|
||||||
|
{
|
||||||
|
return ($node->attr('class') == 'button');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get search results cache varname
|
||||||
|
$finder = new \Symfony\Component\Finder\Finder();
|
||||||
|
$finder
|
||||||
|
->name('data_search_results_*.php')
|
||||||
|
->files()
|
||||||
|
->in($phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT);
|
||||||
|
$iterator = $finder->getIterator();
|
||||||
|
$iterator->rewind();
|
||||||
|
$cache_filename = $iterator->current();
|
||||||
|
$cache_varname = substr($cache_filename->getBasename('.php'), 4);
|
||||||
|
|
||||||
|
// Get cached post ids data
|
||||||
|
$cache = $this->get_cache_driver();
|
||||||
|
$post_ids_cached = $cache->get($cache_varname);
|
||||||
|
|
||||||
|
$cached_results_count = count($post_ids_cached) - 2; // Don't count '-1' and '-2' indexes
|
||||||
|
|
||||||
|
$post_ids_cached_backup = $post_ids_cached;
|
||||||
|
|
||||||
|
// Cached data still should have initial 'd' sort direction
|
||||||
|
$this->assertTrue($post_ids_cached[-2] === 'd', $this->search_backend);
|
||||||
|
|
||||||
|
// Cached search results count should be equal to displayed on search results page
|
||||||
|
$this->assertEquals($posts_count, $post_ids_cached[-1], $this->search_backend);
|
||||||
|
|
||||||
|
// Actual cached data array count should be equal to displayed on search results page too
|
||||||
|
$this->assertEquals($posts_count, $cached_results_count, $this->search_backend);
|
||||||
|
|
||||||
|
// Cached data array shouldn't change after removing duplicates. That is, it shouldn't have any duplicates.
|
||||||
|
unset($post_ids_cached[-2], $post_ids_cached[-1]);
|
||||||
|
unset($post_ids_cached_backup[-2], $post_ids_cached_backup[-1]);
|
||||||
|
$post_ids_cached = array_unique($post_ids_cached);
|
||||||
|
$this->assertEquals($post_ids_cached_backup, $post_ids_cached, $this->search_backend);
|
||||||
|
|
||||||
|
// Restore this value to default
|
||||||
|
$sql = 'UPDATE ' . CONFIG_TABLE . "
|
||||||
|
SET config_value = 250
|
||||||
|
WHERE config_name = '" . $this->db->sql_escape('search_block_size') . "'";
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
|
// Restore posts_per_page value
|
||||||
|
$crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
|
||||||
|
$form = $crawler->selectButton('Submit')->form();
|
||||||
|
$values = $form->getValues();
|
||||||
|
$values['config[posts_per_page]'] = $current_posts_per_page;
|
||||||
|
$form->setValues($values);
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
$this->assertEquals(1, $crawler->filter('.successbox')->count(), $this->search_backend);
|
||||||
|
}
|
||||||
|
|
||||||
protected function create_search_index($backend = null)
|
protected function create_search_index($backend = null)
|
||||||
{
|
{
|
||||||
$this->add_lang('acp/search');
|
$this->add_lang('acp/search');
|
||||||
|
|
Loading…
Add table
Reference in a new issue