1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[feature/soft-delete] I told you I was going to rename the class!

Rename topic_visibility class to phpbb_visibility. Also a bit of work to the class itself, mostly cleanup and adding the comments that I'd previously written.

PHPBB3-9657
This commit is contained in:
Josh Woody
2010-06-20 15:01:26 -05:00
committed by Joas Schilling
parent 244f6e2ddc
commit c32d760806
9 changed files with 82 additions and 43 deletions

View File

@@ -83,7 +83,7 @@ if ($view && !$post_id)
$sql = 'SELECT post_id, topic_id, forum_id
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
AND " . topic_visibility::get_visibility_sql('post', $forum_id) . "
AND " . phpbb_visibility::get_visibility_sql('post', $forum_id) . "
AND post_time > $topic_last_read
AND forum_id = $forum_id
ORDER BY post_time ASC";
@@ -137,7 +137,7 @@ if ($view && !$post_id)
WHERE forum_id = ' . $row['forum_id'] . "
AND topic_moved_id = 0
AND topic_last_post_time $sql_condition {$row['topic_last_post_time']}
AND" . topic_visibility::get_visibility_sql('topic', $row['forum_id']) . "
AND" . phpbb_visibility::get_visibility_sql('topic', $row['forum_id']) . "
ORDER BY topic_last_post_time $sql_ordering";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
@@ -277,7 +277,7 @@ if ($post_id)
$sql = 'SELECT COUNT(p.post_id) AS prev_posts
FROM ' . POSTS_TABLE . " p
WHERE p.topic_id = {$topic_data['topic_id']}
" . topic_visibility::get_visibility_sql('post', $forum_id, 'p');
" . phpbb_visibility::get_visibility_sql('post', $forum_id, 'p');
if ($sort_dir == 'd')
{
@@ -408,7 +408,7 @@ if ($sort_days)
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
AND post_time >= $min_post_time
AND " . topic_visibility::get_visibility_sql('post', $forum_id);
AND " . phpbb_visibility::get_visibility_sql('post', $forum_id);
$result = $db->sql_query($sql);
$total_posts = (int) $db->sql_fetchfield('num_posts');
$db->sql_freeresult($result);
@@ -944,7 +944,7 @@ $i = $i_total = 0;
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p' . (($join_user_sql[$sort_key]) ? ', ' . USERS_TABLE . ' u': '') . "
WHERE p.topic_id = $topic_id
AND " . topic_visibility::get_visibility_sql('post', $forum_id, 'p.') . "
AND " . phpbb_visibility::get_visibility_sql('post', $forum_id, 'p.') . "
" . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . "
$limit_posts_time
ORDER BY $sql_sort_order";