PDA

View Full Version : How To integrate each author's adsense code in their own articles?



costisefu
02-18-2011, 03:36 PM
I managed to put authors in diferent usergroups.

For their forum posts I modified postbit template with this condition, that checks the usergroup they belong to:

<vb:if condition="is_member_of($post, 10)">

Still, for their CMS articles, this conditional doesn't work in vbcms_content_article_page.

What conditional to use, regarding author's user id or usergroup id, so I can show his adsense code in his articles only?

Dave A
02-20-2011, 09:11 AM
I suspect the problem is the variable isn't initalised in the template you're trying to add the condition to.

I've been trying to wrap my head around this, but by my understanding:

In vB3 variables such as usergroup were globalised and you could use them in a conditional almost anywhere on a page.
vB4 goes about processing of variables in a totally different way. If you want to use a variable in any template, it has to be initialised for that particular template first.

Don't ask me the syntax needed on how to do it - as I say I've only just wrapped my head around the concept. At this point (with the unpredictable nature of vB4 development) I'm trying to avoid that level of modifying like the plague.

costisefu
04-02-2011, 01:29 AM
thanks a lot, Dave!
NOBODY ELSE, PLEASE? :(