mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-12 20:56:40 +02:00
[ticket/12174] Update the conditions
PHPBB3-12174
This commit is contained in:
@ -448,22 +448,19 @@ class content_visibility
|
|||||||
AND ' . $this->db->sql_in_set('post_id', $post_id, true);
|
AND ' . $this->db->sql_in_set('post_id', $post_id, true);
|
||||||
$result = $this->db->sql_query_limit($sql, 1);
|
$result = $this->db->sql_query_limit($sql, 1);
|
||||||
|
|
||||||
$row = $this->db->sql_fetchrow($result);
|
$has_attachment = (bool) $this->db->sql_fetchfield('has_attachments');
|
||||||
if ($row != false)
|
$this->db->sql_freeresult($result);
|
||||||
{
|
|
||||||
if ($visibility == ITEM_APPROVED)
|
if ($has_attachment && $visibility == ITEM_APPROVED)
|
||||||
{
|
{
|
||||||
$update_topic_attachments_flag = true;
|
$update_topic_attachments_flag = true;
|
||||||
$topic_update_array[] = 'topic_attachment = 1';
|
$topic_update_array[] = 'topic_attachment = 1';
|
||||||
}
|
}
|
||||||
}
|
else if (!$has_attachment)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$update_topic_attachments_flag = true;
|
$update_topic_attachments_flag = true;
|
||||||
$topic_update_array[] = 'topic_attachment = 0';
|
$topic_update_array[] = 'topic_attachment = 0';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->sql_freeresult($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($update_topic_postcount || $update_topic_attachments_flag)
|
if ($update_topic_postcount || $update_topic_attachments_flag)
|
||||||
|
Reference in New Issue
Block a user