It would be useful to have a "Show Ads" permission, so ads could be hidden for admin or registered users. You can edit the block settings, but that gets cumbersome when you've got multiple ads and page layouts.

Comments

13rac1’s picture

StatusFileSize
new1.61 KB

Here is a quick implementation of a "Show ads for Administrator" checkbox in the administrative menus. Probably could/should be expanded to have more features, but I needed something so I don't lose my mind while working on this project.

13rac1’s picture

StatusFileSize
new1.51 KB

I was too excited to disable the ads and missed some logic. This works as advertised...

jcisio’s picture

Title: "Show Ads" permission » "Hide Ads" permission
Status: Active » Needs work

I prefer a "hide ads" permission rather than hard code it to uid 1.

User having this permission won't see ads. A step farther (but not indispensable now) is users with this permission will have a checkbox in their profile to choose whether they want to see ads.

13rac1’s picture

This was as first step, I don't think this version will be committed. I figured my quick fix could get the ball rolling.

13rac1’s picture

Status: Needs work » Active

The reason it is "Active" and not "Needs Review"

13rac1’s picture

Title: "Hide Ads" permission » Adjust ad visibility by role
Status: Active » Needs review
StatusFileSize
new3.81 KB

This can't be done with a standard permission since user_access() always returns TRUE for UID 1. Instead, I implemented it using code from the Google Analytics module to allow ad visibility selection by role. New section added to settings page at: /admin/config/system/google_admanager