1. Jeansuizo
  2. General
  3. Thursday, May 03 2018, 07:22 AM
hi,
I combined the original custom where "user_id IN (SELECT DISTINCT userid FROM #__session WHERE client_id=0)"
with "group_id NOT IN (55)" this way:

user_id IN (SELECT DISTINCT userid FROM #__session WHERE client_id=0) AND group_id NOT IN (55)

It seems to be wrong, because it doesn't work
What would be the correct syntax? (I just want to see all the registered visitors except some users who are in the hidden administration group.)

Thank you
admin Accepted Answer
Admin
Hi,
It seems to be wrong, because it doesn't work
It mean that you see a empty list?
  1. more than a month ago
  2. General
  3. # 1
Jeansuizo Accepted Answer
No, the module appears, with the same users, it seems as if the exclusion would not work


I controlled every factor: the group number is oK, group assignation too, but no way to make it disappear from the list.

For example: I activated the new group "virtual user" (ID Nr 65) for the test user "test registrado", and with " user_id IN (SELECT DISTINCT userid FROM #__session WHERE client_id=0) AND group_id NOT IN (65) all users see this user in module "who is online".
  1. more than a month ago
  2. General
  3. # 2
Jeansuizo Accepted Answer
I noticed that it works only with following combination:

user_id IN (SELECT DISTINCT userid FROM #__session WHERE client_id=0) AND user_id NOT IN (990,1107,1109)

but doesn't work like this:

user_id IN (SELECT DISTINCT userid FROM #__session WHERE client_id=0) AND group_id NOT IN (65)

could be a bug?

For practical reasons I would need the second option.
  1. more than a month ago
  2. General
  3. # 3
admin Accepted Answer
Admin
Hi,
this is not a bug, this happen because probably users in usergroup 65 are also in some other usergroup.

try with this:
user_id IN (SELECT DISTINCT userid FROM #__session WHERE client_id=0)  AND user_id NOT IN (SELECT user_id FROM #__user_usergroup_map WHERE group_id IN (65))


We need something like this because there is a INNER JOIN between Joomla User Table and Joomla Usergroups Table.
  1. more than a month ago
  2. General
  3. # 4
Jeansuizo Accepted Answer
IT works perfect!!
you're a genius! thank you a lot!
  1. more than a month ago
  2. General
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.