AdBlock Tracker & Usergroup Swap

AdBlock Tracker & Usergroup Swap [Paid] v2.4.2

No permission to buy ($45.00)
There is no view statistics permission. Moderators need to see the /account/adblock-tracker data, but the only way to do that is to edit the user. Only admins can do this.
Could that data be available in the front end somewhere? Like in a tab in the user's profile page?
Okay. I'll have to look into what moderators can do, I've never actually tinkered with that. Looking at it now.
 
I'm an admin but not a moderator. I have given moderators and admin permission to view the history. It's not appearing for me in the moderator drop-down. Is it only available to moderators or anyone who has permission?
Interesting, it showed up for me as administrator. I'll check in a bit and post back.
 
Can you elaborate? Specifically, what you're aiming to do?

I'm not sure adding a global variable to the existing visitor state is the most efficient way to do things as most visitors (including guests), wouldn't need this to be set.
I plan to check if a visitor or user is currently adblocking and if so blur our every second post for them.

I have this working for users as i can simply target based on the adblocking usergroup but cannot use this on visitors for obvious reasons.
 
I plan to check if a visitor or user is currently adblocking and if so blur our every second post for them.

I have this working for users as i can simply target based on the adblocking usergroup but cannot use this on visitors for obvious reasons.
Visitors are in the database by IP if you have guest tracking enabled, but they don't undergo user-swaps because visitors don't have usergroups.
You'd have to match on the IP record in the database and look at the column that is marked for them. It wouldn't be very accurate though for a variety of reasons.
 
I'm an admin but not a moderator. I have given moderators and admin permission to view the history. It's not appearing for me in the moderator drop-down. Is it only available to moderators or anyone who has permission?
Hmm, works good for me. Moderator, even if the only permission is viewAdblockHistory get the tooltip. Administrative always has the tooltip for AdBlock History.

Not sure if this is a cache/flush for permissions issue?

Found it. The template modification wasn't included for the build. I'll add to next release.
 
@tajhay i'll see if I can think of something, but the tracking takes place after the page renders by Ajax Post, so it's not really possible to add something until the following page load... then you're dealing with something in the session or a cookie. You have any thoughts?
 
@tajhay i'll see if I can think of something, but the tracking takes place after the page renders by Ajax Post, so it's not really possible to add something until the following page load... then you're dealing with something in the session or a cookie. You have any thoughts?
How do you do it fir this addon though:

I assume in there you are able to target messages to visitors with adblock to register or remove adblock.

Ideally want something i can read in a template mod and make changes to how they see the pages if they are a visitor(not registered user) and has adblock on (until its turned off)
 
I assume in there you are able to target messages to visitors with adblock to register or remove adblock.

Ideally want something i can read in a template mod and make changes to how they see the pages if they are a visitor(not registered user) and has adblock on (until its turned off)
Yeah, that's just it, they're geared up differently because this add-on runs quietly, and the other one doesn't. Subtle difference, but this one is intended for users, the other for guests.

Doing what you're asking would be essentially building the other add-on's functionality into this one. It's not something I'm too keen to support because of the overlap and breadth of work. Also adds attack vectors which I'd like to avoid in this add-on just in case things change with extensions moving forward.

I'll add a session variable and you can look for that to do your custom work; despite it being outside the scope of this add-on it should be relatively easy to include. Probably need to add another option for it so it doesn't affect existing installations, or any installations that doesn't need/want this feature.

Personally, I hate the idea for a variety of reasons, but specifically the fact that Adblock extensions can look for this session as a tip-off something is running to detect itself. But maybe I can add a config option for you to set so you can keep your session variable unique and have a way to change it if needed.
 
Wutime updated AdBlock Tracker & Usergroup Swap with a new update entry:

v2.2.8

  • FIXED: Moderator/administrative tooltip added for AdBlock History reviewing
  • ADDED: Config.php option to enable guest session variable
  • ADDED: Config.php option to enable cache busting
  • UPDATED: FAQ with help information regarding template modifications
You can add an option to your config.php as follows. I recommend you use a unique variable name in your config. This example uses: isAdBlocking

Update your config.php as shown below.

Please ensure you...

Read the rest of this update entry...
 
I assume in there you are able to target messages to visitors with adblock to register or remove adblock.

Ideally want something i can read in a template mod and make changes to how they see the pages if they are a visitor(not registered user) and has adblock on (until its turned off)

Update to v2.2.8 and try this:

You can add an option to your config.php as follows.

I recommend you use a unique variable name in your config.php

This example uses: isAdBlocking

Update your config.php as shown below.

Please ensure you have guest tracking enabled in the Add-On options or the following will changes will have no effect within templates for guests:

Config.php Update
PHP:
/* AdBlock Tracker and Usergroup Swap */
/* https://xenforo.com/community/resources/adblock-tracker-usergroup-swap.7530/field?field=faq */
$config['adBlockTrackerGuestSession']['enabled'] = true;
$config['adBlockTrackerGuestSession']['config'] = [
    'variable' => 'isAdBlocking', // recommend using something unique here
    'removeOnNonDetect' => true,
    'forceRemoval' => false,
];

You can access the following in your templates once this is set.

Here's an example:

Code:
<xf:if is="$xf.session.isAdBlocking">
    <div style="background-color:#f8d7da;color:#721c24;padding:20px;border-radius:8px;">
        <p>Ad Blocking Detected!</p>
        <p>Pages counted: {{ $xf.session.isAdBlocking }}</p>
    </div>
</xf:if>

By default, your variable will be the count of the number of page views AdBlocked consecutively.

If the AdBlocker is disabled the session variable will be unset and cleared.

Note, depending on your caching system you may need to enable forceRemoval. This will delete the sessionId from the database directly. Use at your own risk.
 
@tajhay one thing I should mention is that I wouldn't rely too much on your messages... simply because it only takes one person to submit something to the EasyList to block your specific message. While the session variable should always work, the actual message, if it uses any identifier, can be magically removed with most eye-dropping tools in the AdBlock extension.

You'll have to see what happens. I'm happy to try to help, but it's pretty difficult to get around it. You need to post your messaging using random identifiers at the very least. JavaScript works best, but even then, if it's loaded through XenForo it often gets a unique and specific identifier, especially in XF 2.3. This identifier makes it really easy for knowledgable AdBlock users to specifically target and remove the messaging (css class or ID). You'll need to keep an eye on it over time, and test periodically if you think the messaging is both important and imperative to be read by visitors.

You could probably use the sessionId() or something similarly random and unique per visitor. But even then, the actual message probably stays static, which again, can be targeted. Your mileage may vary. Not sure what else to say other than good luck :)

Note, I know you said you're doing something to posts, but just letting you know.

Let me know how it goes. I'm curious.
 
Bug.
If I open the View AdBlock history link in a new window, I'm getting a template error:

Template errors​

  • Template admin:wutime_adblock_tracker_user_edit_buttons: [E_USER_WARNING] Template admin:wutime_adblock_tracker_user_edit_buttons is unknown (src/XF/Template/Templater.php:693)
Example URL is
I'm hoping to have this as the link under the adblock button (visible to moderators) over the user profile using
Code:
https://www.avforums.com/wutime-adblock-tracker/view/{$fallbackName}.{$user.user_id}/1

Also, the user's name is not shown at the top. Not hugely important.
1.webp
 
Last edited:
Thanks for the heads up. This is fixed to allow opening in windows without errors, as well as ensuring the username is always found.

I'm not sure what "I'm hoping to have this as the link under the adblock button", or what button you're referring to, but as long as {$fallbackName}.{$user.user_id} resolves properly, and the user has the moderator permission the linking should work without issue. If not, post a sketch of what you're trying to accomplish.
 
Last edited:
Wutime updated AdBlock Tracker & Usergroup Swap with a new update entry:

v2.2.9

  • FIX: username not properly passing display under certain conditions
  • FIX: opening history display on public side tries to load buttons that are admin only
  • ADD: canView permission for AdBlockHistory permission by extending User
  • ADD: CSS in xenforo xf:css template for proper inclusion where needed
  • Updated title on admin listing page to remove html from <title>

Read the rest of this update entry...
 
Wutime updated AdBlock Tracker & Usergroup Swap with a new update entry:

v2.3.0 - Added alert notices and numerous quality of life updates

  • NEW: Alert users when they're added to the AdBlocking usergroup
  • NEW: Alert users when they're removed from the usergroup
  • NEW: Option for "Log user change when usergroup added" (default=on)
  • NEW: Option for "Log user change when usergroup removed" (default=on)
    • Both alerts are separate options
    • Both alerts are separate templates to edit
  • NEW: Job to rebuild caches for ignored user roles (read below)
  • ADDED: Remove AssignRoleId as a possible selection...

Read the rest of this update entry...
 
With the most recent version I recommended the following post upgrade (not required for new installs):

After upgrade, visit and run:
Code:
admin.php?tools/rebuild#job-wutime\adblocktracker\job\rebuildadblocktrackingusers

If you're curious, view the following to see how many users were changed:
Code:
admin.php?logs/user-change

The above will check any users that are being tracked that are supposed to be "Ignored Usergroups". This issue is a result of not having properly checked this logic previously. Moving forward, with the currently updated changes, the above shouldn't really be required unless you've changed "ignore roles" in the options. This "NOTE" is noted under the usergroup ignore roles in options.

Also, "Alerts" are now possible. They're disabled by default. Under the "Options" they're listed under "User Displays". You can alert users on usergroup Added and usergroup Removed. The associated templates are listed under the corresponding option.

Alert.webp
 
Back
Top Bottom