1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-25 19:11:47 +02:00

[feature/soft-delete] Lay the groundwork for a soft-delete feature

So far, I've added no new functionality.  The biggest change here is adjusting the DB column names to "visibility" rather than "approved".  Some things here are pretty likely to change, for example the name and location of the topic_visibility class. Happy birthday phpBB :)

PHPBB3-9657
This commit is contained in:
Josh Woody
2010-06-17 23:58:18 -05:00
committed by Joas Schilling
parent 1128ff1e58
commit b8c55291ed
36 changed files with 9164 additions and 9149 deletions

View File

@@ -265,7 +265,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
* @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
* @param array $m_approve_fid_sql specifies which types of posts a user may view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -292,7 +292,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
implode(',', $m_approve_fid_ary),
// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary)
)));
@@ -354,7 +354,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
break;
}
if (!sizeof($m_approve_fid_ary))
/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -366,6 +366,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
*/
$sql_select = (!$result_count) ? 'SQL_CALC_FOUND_ROWS ' : '';
$sql_select = ($type == 'posts') ? $sql_select . 'p.post_id' : 'DISTINCT ' . $sql_select . 't.topic_id';
@@ -445,7 +446,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
* @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
* @param array $m_approve_fid_sql specifies which types of posts a user may view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -473,7 +474,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
implode(',', $m_approve_fid_ary),
// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -523,7 +524,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
break;
}
if (!sizeof($m_approve_fid_ary))
/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -535,6 +536,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
*/
// If the cache was completely empty count the results
$calc_results = ($result_count) ? '' : 'SQL_CALC_FOUND_ROWS ';

View File

@@ -414,7 +414,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
* @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
* @param array $m_approve_fid_sql specifies which types of posts the user can view
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -451,7 +451,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
implode(',', $m_approve_fid_ary),
// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -628,7 +628,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sql_where[] = '(' . implode(' OR ', $is_null_joins) . ')';
}
if (!sizeof($m_approve_fid_ary))
/* if (!sizeof($m_approve_fid_ary))
{
$sql_where[] = 'p.post_approved = 1';
}
@@ -636,6 +636,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
$sql_where[] = '(p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
*/
$sql_where[] = $m_approve_fid_sql;
if ($topic_id)
{
@@ -808,7 +810,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
* @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
* @param array $m_approve_fid_sql specifies which posts a user can view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -836,7 +838,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
implode(',', $m_approve_fid_ary),
// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -886,7 +888,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
break;
}
if (!sizeof($m_approve_fid_ary))
/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -898,6 +900,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
*/
$select = ($type == 'posts') ? 'p.post_id' : 't.topic_id';
$is_mysql = false;