-
Notifications
You must be signed in to change notification settings - Fork 9
Permission based ads #6
Comments
great thought |
I 👍 this idea (and I may have made a duplicate request in #12). |
+1 for this one. I'm re-launching my forum in Flarum (was SMF) this week and I would LOVE to give my volunteer members an ad-free experience. |
Launching membership soon and wanting to hide some/all of ads for paid membership. Would be great to be able to assign ad blocks to user groups in Flarum. |
@jrock17 we would be more than happy to push such a feature forward in priority if there was something in it for us. Become a patron over at https://patreon.com/flagrow or chat us up on discord to have us built this for you specifically. In any other case, please have patience, we're doing our best to move all our projects forward at a steady pace. |
@luceos of course, happy to support all your efforts. I just signed up as a patron. |
2 years late and patreon link is dead. |
This extension moved to friends of flarum. Flagrow as a developer team folded as all of these joined the core team. Friends of flarum can still benefit from your donation and support on open collective, check the donate button on this repository. |
Hello, how is this process going? |
FriendsOfFlarum is not actively working on this feature as we focus primarily on maintenance and not new features. You could get the feature commissioned for a fee by contacting one of our members directly. |
Seems like Apple doing open source. I'll do, but I'll charge for it. Not nice. @jesusmoreno24 I did this by hand, pretty much hardcoded (I don't have experience in PHP to develop the admin interface, etc. to do a proper contribution). What I did was to check for a specific group in the JS and then don't display the ads for them: import { extend } from 'flarum/extend';
import app from 'flarum/app';
import PostStream from 'flarum/components/PostStream';
export default function() {
extend(PostStream.prototype, 'view', function(component) {
const advertisement = app.forum.attribute('flagrow.ads.between-posts');
if(app.session && app.session.user && app.session.user.data && app.session.user.data.relationships && app.session.user.data.relationships.groups && app.session.user.data.re$
for(const group of app.session.user.data.relationships.groups.data) {
if(group.type === "groups" && group.id === "5") {
console.warn("Premium user");
return;
}
}
} I did that for all JS files (addAdBetweenPosts, addAdUnderHeader and addAdUnderNavItems). My premium group is id 5, so, if the authenticated user belongs to that group, it just returns. Definitely not the right way to do but, again, I don't know Flarum api or PHP to contribute more. |
PRs are welcome 🤗 You can read more about FriendsOfFlarum mission at https://friendsofflarum.org/about |
Thanks! @JCKodel |
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
The text was updated successfully, but these errors were encountered: