PDA


View Full Version : Conditionals in html file pages?


MikeM79
02-14-2006, 03:42 PM
I am in the process of migrating my old home page and content to vBa.

I use Google adsense in most of my old content. Here is an example with adsense just below the header:

http://www.nastyz28.com/camaro/camaro71.html

Here is the same content in vBa:

http://www.nastyz28.com/cmps_index.php?page=Camaro71

Now the wrinkle....... I sell Gold Memberships at my site and among the things you get with a Gold Membership is an advertising free site.

IMO, adsense will work better if it is incorporated into the content as it was in the first link. Obviously, if I left adense in its own module then I can only show that module to specific user groups.....but I am afraid it will be less effective away from the content. Also, sticking the adsense in the content then frees up a module for a banner ad, etc.

I thought of removing the adv_portal_shell templates, but that still puts the adsense away from the content, which is sub-optimal.

So, I am looking for a way to include a conditional inside the html file that gets served up in Custom Content Module. In English, it would say "if this guy is a Gold Member then skip this adsense ad, if not then show it".

I think this involves plug ins / hooks, etc...... but now I am really in the deep end of the pool and I am not much of a swimmer (yet).

Would you be kind enough to step me through it "Dick and Jane" style?

Many thanks.

- Mike

Brian
02-15-2006, 03:10 PM
I don't think there's really going to be an easy way to do that if the content is in an HTML file. What I would suggest would be to copy the code from your file into a template, then change your page to a template page which includes your new template. Then you would be able to use an if condition around your GAS code that looks something like this:

<if condition="is_member_of($bbuserinfo, X)"> GAS Code Here </if>

MikeM79
02-15-2006, 05:13 PM
Thanks Brian, that did the trick.

I will finish setting up and debugging all my pages as html pages because it involves fewer steps then convert them to templates just before I go live.

I gather that I will have to duplicate the template for each style? I don't suppose there is an easier way (have more than one style share a common template, or a template duplication utility, etc.).

It will be worth it for me even it is cumbersome to set up because these pages consist of static data.