News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Paid Subscription to remove ads by changing theme for group

Started by Jeff B, April 22, 2024, 08:33:11 AM

Previous topic - Next topic

Jeff B

I recently decided to add ads for the first time in the 23 years my forum has existed. It is not going over well with many of the old timers.  They are however open to a subscription service that would allow them to turn off the ads.

Is it possible, or can it be made possible, to have a subscription that turns on the ability for that member to switch themes once subscribed and then remove it if the subscription expires.  I have a copy of the default theme installed called noads, that does not include the ad company's script in the template. I also created a members group called Premium Subscription group based on the permissions of the regular members.

I'd appreciate any insight you may have. Thank you.
Jeff

Aleksi "Lex" Kilpinen

How I did this at one point, fairly simple depending on how you display ads.
- Create an "Ad free" membergroup
- Create a subscription that adds users to that membergroup
- Add code to the ad display that simply says "If not in membergroup X", and so only display ads to everyone else.

Even simpler if you just use something like Ad Management mod, I think that would just allow you to choose groups that see the ads (through permissions).

No need for a different theme.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Jeff B

Our ads are through the Monumetrics company.  There is a line of code in our theme index.template for the default theme. I do not allow user switching of themes

Lex, your post got me thinking, maybe that code could be moved to a block in tiny portal that I use, and then use tiny portal to set permission for the subscription membergroup.

Kindred

yes, that would be your best bet -- use a code-block in TinyPortal and there is no need to mess with custom coding themes
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Aleksi "Lex" Kilpinen

You could probably just add the if statement in index.template.php around the existing ad code as well, I don't have a working example handy at the moment, but I can dig for one later if you want to try.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: