Jump to content

Abstract advert impression counts to a separate function


Colonel_mortis

Recommended Posts

Posted

Currently, in \IPS\Output::sendOutput, you check whether there are any ads on the current page, and update the ad impressions count in the DB. Aside from this not working correctly, it would also be really useful (and sensible) if this were abstracted to a separate function, probably as a member of \IPS\core\Advertisment. That way, you're not including arbitrary code in the output class (code in the output class shouldn't really care whether there are ads on the page), and you also make it hookable, so if I decide that I want to increment some other advert counts for a third party plugin, or that I don't want to log the impression count in the database (or maybe not log it at all, which is entirely reasonable), it is actually possible without overriding the entirety of \IPS\Output::sendOutput.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...