Advertisement Management

Ad not showing when user is member of more groups - Advertisement Management

Ad not showing when user is member of more groups

by martijns » Fri Jan 31, 2020 9:00 pm

I've just installed this extension on our 3.2.9 board on request so I do not have a lot of experience yet with it.

Maybe I'm doing something wrong but it seems that the ad will not be shown to users that are member of multiple groups and one of the groups is selected in the hide list. Even if that particular group is not the users default group the ad will not show.

For example I only want the members of the administrator group to see the ads for now so they can approve the layout before it's activated for the other users. So I select all the groups in the hide list except the administrators group. This results that nobody is able to see the ads.
If I also deselect the registered users group in the hide list then the ads are showing up. but not only for the administrators also for the registered users. This is because everybody is a member of the registered users group. I made sure that for all users that are member of the administrator group that this is their default group.

How can I setup the hide list so that only the administrators will see the ads without changing the group memberships?
martijns
Registered User
Posts: 5
Joined: Fri Apr 24, 2015 10:03 am
Contact:

Re: Ad not showing when user is member of more groups

by KYPREO » Tue Mar 03, 2020 11:35 pm

Since no one else has replied...
martijns wrote:How can I setup the hide list so that only the administrators will see the ads without changing the group memberships?
No you can't, as the extension is designed to HIDE the ads by user group and once a user is part of that group, the ad will be hidden even if the user is also a member of a non-hidden group.

If the extension was designed to DISPLAY ads by user group, then this would solve your problem but potentially create others because you want to show an ad to Registered Users but not Administrators, in which case you couldn't do it (since all Administrators are Registered Users).

The way group permissions are set up hierarchically in phpBB, it is difficult to see how the extension could work both ways perfectly.

However, you can solve this manually in your case, by changing the code that instead of ads being HIDDEN for all groups selected in the ad's setting, they are DISPLAYED only for those selected groups (in your case, Administrators). This posts explains how to do that:

https://www.phpbb.com/customise/db/exte ... 61#p704461
phpBB user since 2002
www.AusRotary.com
KYPREO
Registered User
Posts: 388
Joined: Fri Feb 02, 2018 9:56 am
Contact: