Firefox PHP

Special (Ad-free) template for certain users?

Posted by sheik 
Special (Ad-free) template for certain users?
August 31, 2005 07:02AM
My forum uses Google Ads to try and offset hosting costs. I thought it would be nice to allow users that have donated to the site to choose a different template that didn't contain these adverts.

I'm sure I could hack this functionality in, but can anyone suggest a cleaner way of doing it? I'm unsure how custom profile fields will work in 5.1, but if I use them then this could perhaps be created as a module?

Thanks,

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Special (Ad-free) template for certain users?
August 31, 2005 07:33AM
...actually, even better would be the ability to assign a date field to each user. This would allow "yearly subscriptions" for users to use an ad-free template.

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Special (Ad-free) template for certain users?
August 31, 2005 09:11AM
use a custom-field and check its data in the template directly to enable/disable ads.


Thomas Seifert
Re: Special (Ad-free) template for certain users?
August 31, 2005 09:41AM
Cool, many thanks Thomas.
Can I do date comparisons directly within a template or would I have to use PHP to do that?

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Special (Ad-free) template for certain users?
August 31, 2005 11:10AM
you need to use php there for that.
but as you can simply use php in the template directly this shouldn't be a problem.


Thomas Seifert
Re: Special (Ad-free) template for certain users?
September 02, 2005 08:26AM
I thought I'd post an update in case anyone is interested.
Thanks to Brian and Thomas' help I now have what I wanted working as a hack.

Basically, I have a field per user which I store a "subscription expiry" date in, and I can then check this date in my templates to decide whether I should display an advert or not.

I could make this as a module, with probably the following initial features:

- forum administrator can manage list of subscribed users via the admin module screen.
- individual subscribers can choose whether they want to see adverts or not via their profile screen
- new template variables would be available, eg: USER_IS_SUBSCRIBER, SUBSCRIPTIO_EXPIRY_DATE and HIDE_ADVERTS. These could be used creatively in your own templates, and also as a base for other module code (eg: if you only wanted to allow subscribers to see full posts, and normal users just the first 50% of each post then that would be possible (nasty, but possible!).

If you have any ideas, please post them and I will see if I can clear some time to write the mod.

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Special (Ad-free) template for certain users?
September 03, 2005 09:43PM
My module is now written and in testing. I'll post it shortly.

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Special (Ad-free) template for certain users?
September 04, 2005 12:11AM
Module posted at : [phorum.org]

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Special (Ad-free) template for certain users?
September 06, 2005 12:49PM
Thnx, I will test it. Looks very interesting.

Sergej

------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Sorry, only registered users may post in this forum.

Click here to login