473,503 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.adverserver.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 :-)
Jul 17 '05 #1
1 1846
"Gordan" <go****@torkulMAKNI.hr> wrote in message news:<cj**********@news1.xnet.hr>...
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.adverserver.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 :-))
You could buffer all the page contents. i.e. use "$page_string .= 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?

Is there any better/faster/smarter way to deal with my problem?
What about redirecting all requests to
www.adverserver.com/mysite/id=324234 to a php script, which then does
$mybanner++ and sends your banner?

cheers,
gordan

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


uh.. Croatia?
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2271
by: .pd. | last post by:
If I have a control that adds itself to its container, does that break encapsulation? Is it a bad thing? Here's what I mean: public class fred { public barny b; public fred() {
3
1774
by: K.K. | last post by:
Consider the following code: >>>>>>>>>>> // Define an empty class public class ZorgleCollection : Dictionary<string, Zorgle> { } // Somewhere outside ZorgleCollection:
3
41507
by: enchantingdb | last post by:
I have an exam tomorrow that covers the perceived advantages and disadvantages of object oriented programming, in particular polymorphism, inheritance and encapsulation. I know the advantages but...
6
2161
by: William H. Burling | last post by:
I am not sure I understand encapsulation. I thought that one of the objectives in OOPs is to hide data structures from other objects so that they did not have to know how to unpack them. ...
5
1659
by: jmsantoss | last post by:
Hi, This is a design question. I have a class named "DataBuffer" that stores some data. After "DataBuffer" is created it can not be modified. All the methods of "DataBuffer" are const as data...
47
3290
by: Roger Lakner | last post by:
I often see operator implemented something like this: class Foo { ... }; class FooList { public: const Foo& operator (unsigned index) const {return array;}; Foo& operator (unsigned index) ...
32
4165
by: bluejack | last post by:
Ahoy: For as long as I've been using C, I've vacillated on the optimal degree of encapsulation in my designs. At a minimum, I aggregate data and code that operate on that data into classlike...
16
2109
by: copx | last post by:
I have recently read "Everything you ever wanted to know about C types" by Peter Seebach (1), and learned about incomplete types. Now, I realise the value of encapsulation, but I wonder whether it...
2
7611
by: subramanian100in | last post by:
Is my following understanding correct ? Data abstraction means providing the interface - that is, the set of functions that can be called by the user of a class. Information hiding means...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.