Pattern: Rule based integration of the phpads into your site


you have news site, consisting from miscelannous pages. Some are used for site functionality (voting, login forms etc), some are set of articles marked with category

you need robust way to show context based advertisements. Existing banner system (for example phpads) allows you to define zones and rules providing you with invocation codes to be inserted on your website

However you need to define rules on your site to present specific invocation code depending on context. How to implement such rules?