Git Product home page Git Product logo

ads's Introduction

Ads by Flagrow logo Flagrow, a project of Gravure

MIT license Latest Stable Version Total Downloads Donate Join our Discord server

Allows you to configure ads in several locations.

Warning this is a beta version, make sure you test your ads out on a non-production website before publishing!

Preview

Please note that I might decide to make this extension available only with a license in the future. Any version published under MIT license will however remain available. And if a license will be required, you will be informed in advance.

Goals

  • Allow configuration of ads on your forum at different locations.

Installation

Use Bazaar or install manually:

composer require flagrow/ads

Updating

composer update flagrow/ads
php flarum cache:clear

Configuration

Enable the extension under the extensions tab in the admin area.

Make sure you configure extension on the separate tab;

  • Your ads on different locations, leave empty for none.
  • If you use ads between posts, set the spacing.

Support our work

We prefer to keep our work available to everyone. In order to do so we rely on voluntary contributions on Patreon.

Security

If you discover a security vulnerability within Ads, please send an email to the Gravure team at [email protected]. All security vulnerabilities will be promptly addressed.

Please include as many details as possible. You can use php flarum info to get the PHP, Flarum and extension versions installed.

Links

An extension by Flagrow, a project of Gravure.

ads's People

Contributors

clarkwinkelmann avatar dsevillamartin avatar dshovchko avatar kyrnedev avatar luceos avatar marianord avatar rylat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ads's Issues

Left Column Layout issue

Hi,
I'm testing the plugin on a flarum board and I'm getting this inconsistency when using an adsense responsive html block inside "Ad position in the left column under tags on frontpage":

scrn

It's appearing partially under the discussions list.

Prevent ad slots between posts from jumping around

Currently, ad slots between posts are calculated by considering only the currently rendered posts (PostStream children):

https://github.com/FriendsOfFlarum/ads/blob/44f401a207ef2ca39684367a4339a7b6ea7b9bb2/js/src/forum/addAdBetweenPosts.js#L13-L26

This has the side effect that when new posts are loaded "above", ad slots are recalculated and might be positioned differently, since the code assumes that the first post of the discussion is the first vnode in the stream.

One solution to this would be to use the actual post number (post.attrs['data-number']) instead of the index of the vnode (i), and the total posts count (this.count()) instead of the total number of loaded comments (commentPosts.length). The main difference would be that all kinds of posts would be taken into account for the "between" count, instead of only the comment posts. I'm not even sure if this is better or worse in terms of where you would expect ads to be placed... But it is a solution.

Display ads by user groups

It would be great if we could turn ads on/off by user group. So we could have a group of paid members that wouldn't see ads and public members that would see ads.

Or even better, be able to enable/disable each ad position by group for more control.

Reload ads after switching pages

While switching on topics or pages, adsense ads under navigational headers are not being reloaded. This means, one ad is staying for the whole visit of a user, till he reloads the page, which is not effective.

My suggestion is to reload the ad after switching pages, each time or x times.

Permission based ads

An enhancement would be to show ads only to guests.
It would be also interesting to set specific ad areas to a specific group/s only.

For example: Guest -> All ad areas, Donators -> only sidebar, Members -> only in between posts

White divider line with dark theme

Using the dark theme in Flarum within post ads creates an issue with the dividers for the ad. The bottom divider line is correctly dark but the divider line above the add is white:

ads

Be able to differentiate ad code between left side and mobile

Currently when you paste your ad code into:

"Ad position in the left column under tags on frontpage"

This ad in mobile mode becomes a top ad. I would love to be able to specify different code to use for the top spot in mobile mode.

Thanks, keep up the great work!

AdSense not loading in Firefox (No slot size for availableWidth=0)

When using Flagrow Ads with AdSense banners, it seems there are problems when viewing the forum with Mozilla Firefox (tested with v63).

Particularly, this error is shown in the console every time an AdSense banner is attempted to be rendered:

TagError: adsbygoogle.push() error: No slot size for availableWidth=0

My configuration is the following. In Admin => Appearance => Custom header I put the AdSense script include:

immagine

I know it's not the best idea, but the easiest.

In Admin => Ads, I have the AdSense code for the banners:

immagine

The issue can be seen live on this forum: https://forum.fibra.click/

Or, as reported here, also on https://www.seekadventure.net/

If testing with Firefox in incognito mode, be sure to disable "Content/tracking blocking", because it blocks ads as well.

After a quick search, it appears that the issue is related to the fact that the (adsbygoogle = window.adsbygoogle || []).push({}); line is called when the rest of the code has still to be rendered on screen.

(Note: for anyone wondering, what that line is doing is creating a local variabile called adsbygoogle and assigning it the value of the global window.adsbygoogle, or an empty array if it doesn't exist. Then an empty object is pushed on that array. This works because if the AdSense script is already loaded, the push function is actually some custom code that loads the next ad slot. If AdSense is still not loaded, the adsbygoogle array will be used to know how many slots to load, as soon as AdSense is ready)

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.