Search by

floxum / ad-units

Luceos

Ad units for your Flarum forum.

Package info

gitlab.com/floxum/extensions/flarum-ext-ad-units

Issues

Type:flarum-extension

pkg:composer/floxum/ad-units

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

1.0 2026-11-23 20:45 UTC

This package is auto-updated.

Last update: 2026-11-23 19:48:56 UTC


README

License Latest Stable Version Total Downloads

A Flarum 2.x extension that places ad units on your forum: in the header, the side navigation, between posts, above the first post of a discussion, in the discussion sidebar and in the footer.

This is the Flarum 2.x continuation of davwheat/flarum-ext-ads by David Wheatley.

Installation

composer require floxum/ad-units:"*"

Moving from davwheat/flarum-ext-ads

davwheat/flarum-ext-ads only supports Flarum 1.x. When you upgrade your forum to Flarum 2.x, Ad Units takes over its configuration: the enabled locations, all HTML and JavaScript code, the AdSense publisher ID, custom script URLs, the between-posts settings and the groups holding the "Hide advertisements" permission. Values you already set in Ad Units are never overwritten.

  1. Before upgrading, keep the old extension's data. You can disable davwheat Ad Units, but do not uninstall it with its data (purge): its settings are what Ad Units copies.
  2. As part of the Flarum 2.x upgrade, remove the old package, which cannot be installed on 2.x: composer remove davwheat/flarum-ext-ads
  3. composer require floxum/ad-units:"*" and enable Ad Units in the admin panel. The configuration is copied when the extension is enabled.

The davwheat-ad* CSS classes are still applied to every ad, so custom CSS targeting them keeps working.

"Between posts" now places ads after post N, 2N, 3N…, and the ad directly below the opening post has its own location, "below the first post". davwheat-ads always put a between-posts ad there, so when between-posts ads were enabled, that location is enabled with the same code during the move.

Usage

Head to the extension's settings page, switch on the locations you'd like and paste your ad code into the boxes that appear.

  • AdSense: set your publisher ID and paste only the <ins> tag of each ad unit into the HTML box.
  • <script> tags in the HTML boxes are not executed; put that code in the JavaScript box of the same location instead.
  • Members of groups with the Hide advertisements permission (including all admins) never see ads. Test in a private window.

Updating

composer update floxum/ad-units:"*"
php flarum migrate
php flarum cache:clear

Links