Thanks.
For those unfamiliar with DFP, it's Google's ad serving system, free for businesses up to a certain size (bigger than us) which is extremely flexible in the way it allows you to manage ad serving on your website.
Because it's flexible, it's also somewhat complicated.
When, for example, an advertiser wants to place 100,000 advert impressions in a particular forum on your site, showing 3 times max per person, only to forum members (not guests) located in the UK and made up of a combination of leaderboards and MPUs, DFP will let you know whether you have the inventory to do this, and will serve the ads for you.
So Chris created a system which allows us to set up ad slots in the various controllers (which create the different pages) in any template hook, defining the slot name (as set up in DFP) and the ad size options (e.g. for leaderboard: 728 x 90 / 970 x 90 / 970 x 250) and css classes for a surrounding div. We can also define the parameter names and values for things like node id, usergroups, thread id, thread title, search keywords and breadcrumb node ids so that DFP can target ads appropriately. The breadcrumb node ids is something particularly useful which I wanted to continue from our current vBulletin setup. It's a comma separated list of the current and all parent forum ids for the currently viewed thread or forum. It means that you can tell DFP to target a particular breadcrumb node id so that it will then target ads to every thread in a particular category/forum and all its subforums. A highly targetted ad campaign could, alternatively use the thread id to only target advertising in a particular thread. So we have the ability to satisfy the needs of our advertisers to a high degree.
e.g.