encapsulation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gordan

    #1

    encapsulation

    I manage a small site and here and there we manage to sell some banners.
    Recently we started working with an advertising company who (of course)
    requires us to pull banners from their server. The problem is: although we
    sell a certain number of impressions their server load balances the
    impressions and if too much banners are being showed he sends back our own
    banner. Problem? I can never tell how many real banners I showed and how
    many of my own banners. Yes there's a stats page at the advertisers server
    but..... I have my own stats app which has become useless....

    So.... the process of showing a banner goes something like this:
    -user requests page
    -page runs db query and gets a banner
    -echo <a><img src="banners/asdasd.jpg"/></a>
    or ...
    echo <a><src="www.ad verserver.com/mysite/id=324234" img/>

    What do I want? :-)
    I want to know exactly how many my banners and "real" banners are showed.
    Therefore I came up with the following encapsulation idea :-)
    I fopen the www.adverserver.com/mysite/id=324234 check the size, if it's ==
    with my banner I do a mybanner++ query else their_banner++ query. Show the
    image and everybody is happy :-)
    There are of course some technical problems related to my idea because I
    have to echo a raw image on a page that already sent headers but I'll think
    of something :-))

    Is there any better/faster/smarter way to deal with my problem?

    cheers,
    gordan

    PS
    in case anybody from Croatia/Slovenia is familiar with the situation the
    advert company is Httpool :-)


  • Aquila Deus

    #2
    Re: encapsulation

    "Gordan" <gordan@torkulM AKNI.hr> wrote in message news:<cja2ek$ok q$1@news1.xnet. hr>...[color=blue]
    > I manage a small site and here and there we manage to sell some banners.
    > Recently we started working with an advertising company who (of course)
    > requires us to pull banners from their server. The problem is: although we
    > sell a certain number of impressions their server load balances the
    > impressions and if too much banners are being showed he sends back our own
    > banner. Problem? I can never tell how many real banners I showed and how
    > many of my own banners. Yes there's a stats page at the advertisers server
    > but..... I have my own stats app which has become useless....
    >
    > So.... the process of showing a banner goes something like this:
    > -user requests page
    > -page runs db query and gets a banner
    > -echo <a><img src="banners/asdasd.jpg"/></a>
    > or ...
    > echo <a><src="www.ad verserver.com/mysite/id=324234" img/>
    >
    > What do I want? :-)
    > I want to know exactly how many my banners and "real" banners are showed.
    > Therefore I came up with the following encapsulation idea :-)
    > I fopen the www.adverserver.com/mysite/id=324234 check the size, if it's ==
    > with my banner I do a mybanner++ query else their_banner++ query. Show the
    > image and everybody is happy :-)
    > There are of course some technical problems related to my idea because I
    > have to echo a raw image on a page that already sent headers but I'll think
    > of something :-))[/color]

    You could buffer all the page contents. i.e. use "$page_stri ng .= XXX"
    instead of "echo XXX", and do echo $page_string at the end of page.

    But since the page has to do a db query to get banner link, why not
    check it there?
    [color=blue]
    >
    > Is there any better/faster/smarter way to deal with my problem?[/color]

    What about redirecting all requests to
    www.adverserver.com/mysite/id=324234 to a php script, which then does
    $mybanner++ and sends your banner?
    [color=blue]
    >
    > cheers,
    > gordan
    >
    > PS
    > in case anybody from Croatia/Slovenia is familiar with the situation the
    > advert company is Httpool :-)[/color]

    uh.. Croatia?

    Comment

    Working...