Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $where = '';
- if (!empty($primary_membergroups) && count(array_keys($primary_membergroups) == 1))
- $formatted_primary_groups = array($primary_membergroups[0]);
- else
- $formatted_primary_groups = implode(',', $primary_membergroups);
- if (!empty($post_based_membergroups) && count(array_keys($post_based_membergroups) == 1))
- $formatted_post_based_groups = array($post_based_membergroups[0]);
- else
- $formatted_post_based_groups = implode(',', $post_based_membergroups);
- if (empty($context['current_agreement']))
- $where = 'WHERE lngfile = \'\' OR lngfile = {string:english}';
- else
- $where = 'WHERE lngfile = {string:language}';
- if (!empty($primary_membergroups))
- $where .= ' AND id_group NOT IN({array_int:primary_groups})
- AND NOT FIND_IN_SET({array_int:primary_groups}, additional_groups)';
- if (!empty($post_based_membergroups))
- $where .= ' AND NOT FIND_IN_SET({array_int:post_based_groups}, id_post_group)';
- $smcFunc['db_query']('', '
- UPDATE {db_prefix}members
- SET has_agreed = {int:set_false}
- ' . $where,
- array(
- 'set_false' => 0,
- 'english' => 'english',
- 'primary_groups' => $formatted_primary_groups,
- 'post_based_groups' => $formatted_post_based_groups,
- 'language' => !empty($context['current_agreement']) ? str_replace('.', '', $context['current_agreement']) : '',
- )
- );
Add Comment
Please, Sign In to add comment